combine_tessdata.1.asc 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. COMBINE_TESSDATA(1)
  2. ===================
  3. NAME
  4. ----
  5. combine_tessdata - combine/extract/overwrite/list/compact Tesseract data
  6. SYNOPSIS
  7. --------
  8. *combine_tessdata* ['OPTION'] 'FILE'...
  9. DESCRIPTION
  10. -----------
  11. combine_tessdata(1) is the main program to combine/extract/overwrite/list/compact
  12. tessdata components in [lang].traineddata files.
  13. To combine all the individual tessdata components (unicharset, DAWGs,
  14. classifier templates, ambiguities, language configs) located at, say,
  15. /home/$USER/temp/eng.* run:
  16. combine_tessdata /home/$USER/temp/eng.
  17. The result will be a combined tessdata file /home/$USER/temp/eng.traineddata
  18. Specify option -e if you would like to extract individual components
  19. from a combined traineddata file. For example, to extract language config
  20. file and the unicharset from tessdata/eng.traineddata run:
  21. combine_tessdata -e tessdata/eng.traineddata \
  22. /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharset
  23. The desired config file and unicharset will be written to
  24. /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharset
  25. Specify option -o to overwrite individual components of the given
  26. [lang].traineddata file. For example, to overwrite language config
  27. and unichar ambiguities files in tessdata/eng.traineddata use:
  28. combine_tessdata -o tessdata/eng.traineddata \
  29. /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharambigs
  30. As a result, tessdata/eng.traineddata will contain the new language config
  31. and unichar ambigs, plus all the original DAWGs, classifier templates, etc.
  32. Note: the file names of the files to extract to and to overwrite from should
  33. have the appropriate file suffixes (extensions) indicating their tessdata
  34. component type (.unicharset for the unicharset, .unicharambigs for unichar
  35. ambigs, etc). See k*FileSuffix variable in ccutil/tessdatamanager.h.
  36. Specify option -u to unpack all the components to the specified path:
  37. combine_tessdata -u tessdata/eng.traineddata /home/$USER/temp/eng.
  38. This will create /home/$USER/temp/eng.* files with individual tessdata
  39. components from tessdata/eng.traineddata.
  40. OPTIONS
  41. -------
  42. *-c* '.traineddata' 'FILE'...:
  43. Compacts the LSTM component in the .traineddata file to int.
  44. *-d* '.traineddata' 'FILE'...:
  45. Lists directory of components from the .traineddata file.
  46. *-e* '.traineddata' 'FILE'...:
  47. Extracts the specified components from the .traineddata file
  48. *-l* '.traineddata' 'FILE'...:
  49. List the network information.
  50. *-o* '.traineddata' 'FILE'...:
  51. Overwrites the specified components of the .traineddata file
  52. with those provided on the command line.
  53. *-u* '.traineddata' 'PATHPREFIX'
  54. Unpacks the .traineddata using the provided prefix.
  55. CAVEATS
  56. -------
  57. 'Prefix' refers to the full file prefix, including period (.)
  58. COMPONENTS
  59. ----------
  60. The components in a Tesseract lang.traineddata file as of
  61. Tesseract 4.0 are briefly described below; For more information on
  62. many of these files, see
  63. <https://tesseract-ocr.github.io/tessdoc/Training-Tesseract.html>
  64. and
  65. <https://tesseract-ocr.github.io/tessdoc/TrainingTesseract-4.00.html>
  66. lang.config::
  67. (Optional) Language-specific overrides to default config variables.
  68. For 4.0 traineddata files, lang.config provides control parameters which
  69. can affect layout analysis, and sub-languages.
  70. lang.unicharset::
  71. (Required - 3.0x legacy tesseract) The list of symbols that Tesseract recognizes, with properties.
  72. See unicharset(5).
  73. lang.unicharambigs::
  74. (Optional - 3.0x legacy tesseract) This file contains information on pairs of recognized symbols
  75. which are often confused. For example, 'rn' and 'm'.
  76. lang.inttemp::
  77. (Required - 3.0x legacy tesseract) Character shape templates for each unichar. Produced by
  78. mftraining(1).
  79. lang.pffmtable::
  80. (Required - 3.0x legacy tesseract) The number of features expected for each unichar.
  81. Produced by mftraining(1) from *.tr* files.
  82. lang.normproto::
  83. (Required - 3.0x legacy tesseract) Character normalization prototypes generated by cntraining(1)
  84. from *.tr* files.
  85. lang.punc-dawg::
  86. (Optional - 3.0x legacy tesseract) A dawg made from punctuation patterns found around words.
  87. The "word" part is replaced by a single space.
  88. lang.word-dawg::
  89. (Optional - 3.0x legacy tesseract) A dawg made from dictionary words from the language.
  90. lang.number-dawg::
  91. (Optional - 3.0x legacy tesseract) A dawg made from tokens which originally contained digits.
  92. Each digit is replaced by a space character.
  93. lang.freq-dawg::
  94. (Optional - 3.0x legacy tesseract) A dawg made from the most frequent words which would have
  95. gone into word-dawg.
  96. lang.fixed-length-dawgs::
  97. (Optional - 3.0x legacy tesseract) Several dawgs of different fixed lengths -- useful for
  98. languages like Chinese.
  99. lang.shapetable::
  100. (Optional - 3.0x legacy tesseract) When present, a shapetable is an extra layer between the character
  101. classifier and the word recognizer that allows the character classifier to
  102. return a collection of unichar ids and fonts instead of a single unichar-id
  103. and font.
  104. lang.bigram-dawg::
  105. (Optional - 3.0x legacy tesseract) A dawg of word bigrams where the words are separated by a space
  106. and each digit is replaced by a '?'.
  107. lang.unambig-dawg::
  108. (Optional - 3.0x legacy tesseract) .
  109. lang.params-model::
  110. (Optional - 3.0x legacy tesseract) .
  111. lang.lstm::
  112. (Required - 4.0 LSTM) Neural net trained recognition model generated by lstmtraining.
  113. lang.lstm-punc-dawg::
  114. (Optional - 4.0 LSTM) A dawg made from punctuation patterns found around words.
  115. The "word" part is replaced by a single space. Uses lang.lstm-unicharset.
  116. lang.lstm-word-dawg::
  117. (Optional - 4.0 LSTM) A dawg made from dictionary words from the language.
  118. Uses lang.lstm-unicharset.
  119. lang.lstm-number-dawg::
  120. (Optional - 4.0 LSTM) A dawg made from tokens which originally contained digits.
  121. Each digit is replaced by a space character. Uses lang.lstm-unicharset.
  122. lang.lstm-unicharset::
  123. (Required - 4.0 LSTM) The unicode character set that Tesseract recognizes, with properties.
  124. Same unicharset must be used to train the LSTM and build the lstm-*-dawgs files.
  125. lang.lstm-recoder::
  126. (Required - 4.0 LSTM) Unicharcompress, aka the recoder, which maps the unicharset
  127. further to the codes actually used by the neural network recognizer. This is created as
  128. part of the starter traineddata by combine_lang_model.
  129. lang.version::
  130. (Optional) Version string for the traineddata file.
  131. First appeared in version 4.0 of Tesseract.
  132. Old version of traineddata files will report Version:Pre-4.0.0.
  133. 4.0 version of traineddata files may include the network spec
  134. used for LSTM training as part of version string.
  135. HISTORY
  136. -------
  137. combine_tessdata(1) first appeared in version 3.00 of Tesseract
  138. SEE ALSO
  139. --------
  140. tesseract(1), wordlist2dawg(1), cntraining(1), mftraining(1), unicharset(5),
  141. unicharambigs(5)
  142. COPYING
  143. -------
  144. Copyright \(C) 2009, Google Inc.
  145. Licensed under the Apache License, Version 2.0
  146. AUTHOR
  147. ------
  148. The Tesseract OCR engine was written by Ray Smith and his research groups
  149. at Hewlett Packard (1985-1995) and Google (2006-2018).