frame_decoration
original (2019/05/14 付) Google 翻訳 (2019/05/26 付)
tesstrain.sh is a script that automatically calls the appropriate programs to create a new training for a language. It uses various programs for training, so you need to build them with 'make training' before using it. tesstrain.shは、言語の新しいトレーニングを作成するために適切なプログラムを自動的に呼び出すスクリプトです。それは訓練のために様々なプログラムを使うので、あなたはそれを使う前に 'make training'でそれらを構築する必要があります。
This page details the version used for training of 3.0x branch. Not all files are required for LSTM training. このページでは3.0xブランチのトレーニングに使用されたバージョンについて詳しく説明します。 LSTMトレーニングにすべてのファイルが必要というわけではありません。
For 4.0 LSTM training usage, please see https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00 4.0 LSTMトレーニングの使用方法については、https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00を参照してください
# Example usage #使用例
` | `
$ ./tesstrain.sh --lang kan --langdata_dir /path/to/mylangdata --tessdata_dir /path/to/mytessdata $ ./tesstrain.sh --lang kan --langdata_dir / path / to / mylangdata --tessdata_dir / path / to / mytessdata
` | `
This is the most common usage of tesstrain.sh. See the comments at the top of tesstrain.sh for a description of all of the arguments it accepts. これが tesstrain.shの最も一般的な使い方です。受け付けるすべての引数についての説明は tesstrain.shの先頭のコメントを見てください。
The copy of tesstrain.sh that ships with Ubuntu is slightly modified to have a few of the default parameters automatically Ubuntuに同梱されているtesstrain.shのコピーは、いくつかのデフォルトパラメータを自動的に持つように少し修正されています。
filled out, because many of the directory locations are standardized. The documentation is in the standard location. 多くのディレクトリの場所が標準化されているためです。ドキュメントは標準の場所にあります。
` | `
/usr/share/doc/tesseract/README.debian /usr/share/doc/tesseract/README.debian
` | `
The modification saves some typing. This is an example of training for Japanese. この修正により、入力が少し省けます。これは日本語の研修の一例です。
` | `
git clone https://github.com/tesseract-ocr/langdata.git git clone https://github.com/tesseract-ocr/langdata.git
apt-get install fonts-noto-cjk fonts-japanese-mincho.ttf fonts-takao-gothic fonts-vlgothic apt-getインストールfonts-noto-cjkフォント-japanese-mincho.ttfフォント-tao-gothicフォント-vlgothic
tesstrain.sh --lang jpn --langdata_dir langdata tesstrain.sh --lang jpn --langdata_dir langdata
` | `
# Langdata #ラングデータ
tesstrain.sh needs certain files to use in the training process. These are normally stored in a 'langdata' directory. The langdata for the languages that are officially supported by Tesseract are all stored in the langdata repository, but you can of course store langdata wherever you want. tesstrain.shには、トレーニングプロセスで使用するための特定のファイルが必要です。これらは通常 'langdata'ディレクトリに格納されています。 Tesseractで正式にサポートされている言語の言語データはすべてlangdataリポジトリに保存されていますが、もちろんlangdataを好きな場所に保存することもできます。
## Required files ##必須ファイル
At a minimum the following files need to be provided in your langdata directory (note that [lang] is the language code, e.g. 'kan' or 'eng'): 最低限、以下のファイルをあなたのlangdataディレクトリに提供する必要があります([lang]は言語コードです、例えば 'kan'または 'eng'です)。
* [lang]/[lang].training_text (alternatively this can be specified on the command line with --training_text /path/to/textfile) * [lang] / [lang] .training_text(あるいはこれはコマンドラインで --training_text / path / to / textfileで指定することもできます)
## Optional files ##オプションファイル
These files can optionally be in your langdata directory and will be used by tesstrain.sh to improve the quality of the training: これらのファイルはオプションであなたのlangdataディレクトリにあることができ、トレーニングの質を向上させるためにtesstrain.shによって使用されます。
* [lang]/[lang].wordlist (alternatively this can be specified on the command line with --wordlist /path/to/wordlist) * [lang] / [lang] .wordlist(あるいは、これは --wordlist / path / to / wordlistでコマンドラインに指定することができます)
* [lang]/[lang].word.bigrams * [lang] / [lang] .word.bigrams
* [lang]/[lang].numbers * [lang] / [lang] .numbers
* [lang]/[lang].punc * [lang] / [lang] .punc
* [lang]/[lang].config * [lang] / [lang] .config
* [lang]/[lang].unicharambigs * [lang] / [lang] .unicharambigs
* [lang]/[lang].training_text.bigram_freqs * [lang] / [lang] .training_text.bigram_freqs
* [lang]/[lang].training_text.unigram_freqs * [lang] / [lang] .training_text.unigram_freqs
## General files ##一般ファイル
These are general files that can affect multiple languages, but may be edited if needed (note that [Script] is the script name, e.g. 'Greek' or 'Hebrew' or 'Devanagari'. One script can be used for multiple languages, eg. Devanagari script for Hindi, Sanskrit, Marathi, Nepali etc.): これらは複数の言語に影響を与える可能性がある一般的なファイルですが、必要に応じて編集することができます([Script]はスクリプト名、例えば 'Greek'、 'Hebrew'、 'Devanagari'です)。ヒンディー語、サンスクリット語、マラーティー語、ネパール語などのDevanagariスクリプト:
* [Script].xheights * [スクリプト] .xheights
* [Script].unicharset * [スクリプト] .unicharset
* font_properties * font_properties
Nick White's xheight tool can be used to find xheight of different fonts.To clone it and build the xheights tool, do the following: Nick Whiteのxheightツールを使用して、さまざまなフォントのxheightを見つけることができます。それを複製してxheightsツールを作成するには、次の手順を実行します。
` | `
$ git clone http://ancientgreekocr.org/grctraining.git $ gitクローンhttp://ancientgreekocr.org/grctraining.git
$ cd grctraining $ cd grctraining
$ make tools/xheight $ make tools / xheight
` | `
To see how it's used for the Greek training, do: ギリシャ語のトレーニングにどのように使用されているかを確認するには、次の操作を行います。
` | `
$ make langdata/Greek.xheights $ make langdata / Greek.xheights
` | `
# Langdata files #Langdataファイル
## training_text ## training_text
The training text is a text file that will used to train Tesseract for the language. It should contain several samples of each character, and be as close to a realistic sample of text as possible. トレーニングテキストは、Tesseractをその言語用にトレーニングするために使用されるテキストファイルです。それは各文字のいくつかのサンプルを含み、できるだけ現実的なテキストのサンプルに近くなるべきです。
## wordlist ## 単語リスト
The wordlist is a text file with a list of words, one per line, ordered by decreasing frequency (so the most common word first). 単語リストは、頻度が低い順に並べられた単語のリストを1行に1つずつ含むテキストファイルです(つまり、最も一般的な単語が最初になります)。
## training_text.bigram_freqs ## training_text.bigram_freqs
This is a text file with a list of bigrams (here meaning two characters) and the frequency with which they appear next to each other in the training_text, one bigram per line. これはバイグラム(ここでは2文字を意味します)のリストとそれらが training_textの中で隣同士に現れる頻度、1行につき1バイグラムのテキストファイルです。
## training_text.unigram_freqs ## training_text.unigram_freqs
This is a text file with a list of unigrams (characters) and the frequency with which they appear next to each other in the training_text, one unigram per line. これはユニグラム(文字)のリストとそれらが training_textの中で互いに隣り合って現れる頻度、1行につき1ユニグラムのテキストファイルです。
## word.bigrams ## word.bigrams
This is a text file with a list of bigrams (here meaning two words) separated by a space, one per line, sorted by how often they appear next to each other (most common at the top). これは、1行に1つずつ、スペースで区切られたバイグラム(ここでは2つの単語を意味します)のリストを含むテキストファイルです。
## numbers, punc, config, unicharambigs ## numbers、punc、config、unicharambigs
These files are all combined directly into the final training. See the TrainingTesseract page for details of their function and how to use them. これらのファイルはすべて最終トレーニングに直接結合されています。機能の詳細や使い方については、TrainingTesseractのページをご覧ください。
# Options in language-specific.sh # language-specific.shのオプション
Optionally you can set some training options, as well as set default options for training your language (such as fonts to use), by editing the training/language-specific.sh script. 必要に応じて、 training / language-specific.shスクリプトを編集することで、いくつかのトレーニングオプションを設定したり、あなたの言語をトレーニングするためのデフォルトオプション(使用するフォントなど)を設定することができます。
To set options for your language, look towards the end of language-specific.sh where variables are set according to the language code (the set_lang_specific_parameters() function). あなたの言語のオプションを設定するには、言語コードに従って変数が設定される language-specific.shの最後を見てください(set_lang_specific_parameters()関数)。
## Fonts ##フォント
You can either set the fonts to use as an argument to tesstrain.sh (as --fontlist 'Font 1' 'Font 2') or by specifying the fonts in language-specific.sh. tesstrain.shの引数として使用するフォントを( --fontlist 'Font 1' 'Font 2'のように)設定するか、あるいはlanguage-specific.shでフォントを指定することによって設定できます。
## Other options ## 別のオプション
For other variables that can be set, you're best off just reading the set_lang_specific_parameters() function to see what they do, and tesstrain_utils.sh to see exactly how they are used. 設定できる他の変数については、 set_lang_specific_parameters()関数を読んでそれらが何をするのかを見て、 tesstrain_utils.shを使って正確にそれらがどのように使われているかを調べるのが一番です。
# tesstrain_utils.sh #tesstrain_utils.sh
Note that the majority of the work that tesstrain.sh does is actually imported from the training/tesstrain_utils.sh file, so if you're curious about exactly what it is doing, or want to change its behaviour, look there. tesstrain.shが行う作業の大部分は実際にはtraining / tesstrain_utils.shからインポートされることに注意してください。なので、それが何をしているのか正確に知りたかったり、振る舞いを変えたいのなら、そちらを見てください。
最終更新:2019年08月23日 20:21