frame_decoration
original (2019/05/14 付) Google 翻訳 (2019/05/26 付)
------------------------------------ ------------------------------------
## For training Neural net based LSTM Tesseract 4.00 see Training Tesseract 4.00 ##ニューラルネットベースのLSTM Tesseract 4.00のトレーニングについては、Training Tesseract 4.00を参照してください。
------------------------------------- -------------------------------------
## How to use the tools provided to train Tesseract 3.03–3.05 for a new language. ## * Tesseract 3.03–3.05を新しい言語用に訓練するために提供されたツールの使い方
Important note: Before you invest time and efforts on training Tesseract, it is highly recommended to read the ImproveQuality page. 重要な注意事項:Tesseractのトレーニングに時間と労力を費やす前に、ImproveQualityページを読むことを強くお勧めします。
Tesseract 3.04 and 3.05 provide a script for an easy way to execute the various phases of training Tesseract. More information on using it can be found on the tesstrain.sh page. Tesseract 3.04および3.05では、Tesseractをトレーニングするさまざまなフェーズを簡単に実行するためのスクリプトが提供されています。それを使用することに関するより多くの情報は[tesstrain.sh](Training-Tesseract ----- tesstrain.sh)ページで見つけることができます。
Questions about the training process トレーニングプロセスに関する質問
* Introduction * はじめに
* Background and Limitations * 背景と制限
* Additional Libraries required * 追加のライブラリが必要
* Building the training tools * トレーニングツールの作成
* Data files required * 必要なデータファイル
* Requirements for text input files   * テキスト入力ファイルの要件
* How little can you get away with?   * あなたはどのくらい逃げることができますか?
 
Training Procedure トレーニング手順
* Generate Training Images and Box Files * トレーニング画像とボックスファイルの生成
* Prepare a text file   * テキストファイルを準備する
* Automated method   * 自動方式
* Old Manual method   * Old Manual method
* Make Box Files     * ボックスファイルの作成
* Run Tesseract for Training * トレーニングのためにTesseractを実行する
* Generate the unicharset file * unicharsetファイルを生成する
* unicharset_extractor   * unicharset_extractor
* set_unicharset_properties   * set_unicharset_properties
* The font_properties file * font_propertiesファイル
* Clustering * クラスタリング
* shapeclustering   * shapeclustering
* mftraining   * mftraining
* cntraining   * cntraining
* Dictionary Data (Optional) * [辞書データ(任意)](#辞書データ - 任意)
* The unicharambigs file * unicharambigsファイル
* Putting it all together * 全部まとめて
Appendices 付録
[The .tr file format](#the-tr-file-format) [ .trファイル形式](#the-tr-file-format)
* The unicharset file format * unicharsetファイルフォーマット
# Questions about the training process #トレーニングプロセスに関する質問
If you had some problems during the training process and you need help, use tesseract-ocr mailing-list to ask your question(s). トレーニング中に問題が発生した場合、手助けが必要な場合は、tesseract-ocrメーリングリストを使用して質問してください。 )
PLEASE DO NOT report your problems and ask questions about training as issues! **あなたの問題を報告せず、問題としてトレーニングについて質問してください。
# Introduction # 前書き
Tesseract 3.0x is fully trainable. This page describes the training process, provides some guidelines on applicability to various languages, and what to expect from the results. Tesseract 3.0xは完全にトレーニング可能です。このページでは、トレーニングプロセスについて説明し、さまざまな言語への適用性に関するガイドライン、および結果から何を期待するかについて説明します。
Please check the list of languages for which traineddata is already available as of release 3.04 before embarking on training. トレーニングを開始する前に、traineddataがリリース3.04以降ですでに使用可能である言語のリストを確認してください。
3rd Party training tools are also available for training. サードパーティのトレーニングツールもトレーニングに利用できます。
# Background and Limitations #背景と制限
Tesseract was originally designed to recognize English text only. Efforts have been made to modify the engine and its training system to make them able to deal with other languages and UTF-8 characters. Tesseract 3.0 can handle any Unicode characters (coded with UTF-8), but there are limits as to the range of languages that it will be successful with, so please take this section into account before building up your hopes that it will work well on your particular language! Tesseractはもともと英語のテキストだけを認識するように設計されました。エンジンとそのトレーニングシステムを変更して、他の言語とUTF-8文字を処理できるようにする努力がなされています。 Tesseract 3.0は(UTF-8でコード化された)どんなユニコード文字も扱うことができますが、それがうまくいく言語の範囲に関して制限があるので、それがうまくいくことを期待する前にこのセクションを考慮に入れてくださいあなたの特定の言語!
Tesseract 3.01 added top-to-bottom languages, and Tesseract 3.02 added Hebrew (right-to-left). Tesseract 3.01では上から下への言語が追加され、Tesseract 3.02ではヘブライ語(右から左へ)が追加されました。
Tesseract currently handles scripts like Arabic and Hindi with an auxiliary engine called cube (included in Tesseract version 3.01 and up). Don't try to train Tesseract versions earlier than 4.0 for Arabic (same for Persian, Urdu, etc.). It's hopeless. For 4.0 only train with the LSTM method. Tesseractは現在、cubeという名前の補助エンジン(Tesseractバージョン3.01以降に含まれています)を使用して、アラビア語やヒンディー語などのスクリプトを処理します。 アラビア語用に4.0より前のバージョンのTesseractをトレーニングしようとしないでください(ペルシャ語、ウルドゥー語なども同じ)。 4.0ではLSTMメソッドのみでトレーニングしてください。
Traineddata for additional languages has been provided by Google for the 3.04 release. 追加の言語のためのTraineddataは3.04リリースのためにグーグルによって提供されました。
Tesseract is slower with large character set languages (like Chinese), but it seems to work OK. Tesseractは(中国語のような)大きな文字セット言語では遅くなりますが、うまくいくようです。
Tesseract needs to know about different shapes of the same character by having different fonts separated explicitly. The number of fonts is limited to 64 fonts. Note that runtime is heavily dependent on the number of fonts provided, and training more than 32 will result in a significant slow-down. Tesseractは、異なるフォントを明示的に分離することによって、同じ文字の異なる形状について知る必要があります。フォント数は64フォントに制限されています。実行時間は提供されるフォントの数に大きく依存します。32以上のトレーニングは大幅に遅くなります。
# Additional Libraries required #追加のライブラリが必要
Beginning with 3.03, additional libraries are required to build the training tools. 3.03以降では、トレーニングツールを構築するために追加のライブラリが必要です。
` | `
sudo apt-get install libicu-dev sudo apt-get install libicu-dev
sudo apt-get install libpango1.0-dev sudo apt-get install libpango1.0-dev
sudo apt-get install libcairo2-dev sudo apt-get libcairo2-devをインストールする
` | `
# Building the training tools #トレーニングツールを構築する
Beginning with 3.03, if you're compiling Tesseract from source you need to make and install the training tools with separate make commands. Once the above additional libraries have been installed, run the following from the tesseract source directory: 3.03から、Tesseractをソースからコンパイルしている場合は、別々のmakeコマンドでトレーニングツールを作成してインストールする必要があります。上記の追加ライブラリがインストールされたら、tesseractソースディレクトリから以下を実行します。
` | `
make training トレーニングをする
sudo make training-install sudo作るトレーニングインストール
` | `
# Data files required #必要なデータファイル
To train for another language, you have to create some data files in the tessdata subdirectory, and then crunch these together into a single file, using combine_tessdata. The naming convention is languagecode.file_name Language codes for released files follow the ISO 639-3 standard, but any string can be used. The files used for English (3.0x) are: 別の言語を訓練するには、いくつかのデータファイルを tessdataサブディレクトリに作成してから、それらをcombine_tessdataを使用して1つのファイルにまとめる必要があります。命名規則は languagecode.file_nameですリリースされたファイルの言語コードはISO 639-3規格に従いますが、どんな文字列でも使用できます。英語(3.0x)に使用されるファイルは次のとおりです。
* tessdata/eng.config * tessdata / eng.config
* tessdata/eng.unicharset * tessdata / eng.unicharset
* tessdata/eng.unicharambigs * tessdata / eng.unicharambigs
* tessdata/eng.inttemp * tessdata / eng.inttemp
* tessdata/eng.pffmtable * tessdata / eng.pffmtable
* tessdata/eng.normproto * tessdata / eng.normproto
* tessdata/eng.punc-dawg * tessdata / eng.punc-dawg
* tessdata/eng.word-dawg * tessdata / eng.word-dawg
* tessdata/eng.number-dawg * tessdata / eng.number-dawg
* tessdata/eng.freq-dawg * tessdata / eng.freq-dawg
... and the final crunched file is: ...そして最後のクランチファイルは次のとおりです。
* tessdata/eng.traineddata * tessdata / eng.traineddata
and そして
* tessdata/eng.user-words * tessdata / eng.user-words
may still be provided separately. まだ別に提供されるかもしれません。
The traineddata file is simply a concatenation of the input files, with a table of contents that contains the offsets of the known file types. See ccutil/tessdatamanager.h in the source code for a list of the currently accepted filenames. 訓練されたデータファイルは単に既知のファイルタイプのオフセットを含む目次を持つ入力ファイルの連結です。現在受け入れられているファイル名のリストについては、ソースコードのccutil / tessdatamanager.hを参照してください。
## Requirements for text input files ##テキスト入力ファイルの要件
Text input files (lang.config, lang.unicharambigs, font_properties, box files, wordlists for dictionaries...) need to meet these criteria: テキスト入力ファイル(lang.config、lang.unicharambigs、font \ _properties、ボックスファイル、辞書の単語リスト...)は、次の基準を満たす必要があります。
* ASCII or UTF-8 encoding without BOM * [BOM]なしのASCIIまたはUTF-8エンコーディング(http://ja.wikipedia.org/wiki/Byte_order_mark)
* Unix end-of-line marker ('\n') * Unix 行末マーカー( '\ n')
* The last character must be an end of line marker ('\n'). Some text editors will show this as an empty line at the end of file. If you omit this you will get an error message containing last_char == '\n':Error:Assert failed.... *最後の文字は行末マーカー( '\ n')でなければなりません。テキストエディタの中にはこれをファイルの最後に空行として表示するものがあります。これを省略すると、 last_char == '\ n'を含むエラーメッセージが表示されます。エラー:アサートに失敗しました...
## How little can you get away with? ##あなたはどのくらい逃げることができますか?
You must create unicharset, inttemp, normproto, pffmtable using the procedure described below. If you are only trying to recognize a limited range of fonts (like a single font for instance), then a single training page might be enough. The other files do not need to be provided, but will most likely improve accuracy, depending on your application. あなたは以下で説明される手順を使って unicharsetinttempnormprotopffmtableを作成しなければなりません。限られた範囲のフォント(たとえば単一のフォントなど)のみを認識しようとしている場合は、単一のトレーニングページで十分かもしれません。他のファイルを提供する必要はありませんが、アプリケーションによっては正確性が向上する可能性があります。
# Training Procedure #トレーニング手順
Some of the procedure is inevitably manual. As much automated help as possible is provided. The tools referenced below are all built in the training subdirectory. 手順のいくつかは必然的に手動です。できるだけ多くの自動ヘルプが提供されています。下記のツールはすべてtrainingサブディレクトリに構築されています。
You need to run all commands in the same folder where your input files are located. 入力ファイルが置かれているのと同じフォルダーですべてのコマンドを実行する必要があります。
## Generate Training Images and Box Files ##トレーニング画像とボックスファイルを生成する
## Prepare a text file ##テキストファイルを準備する
The first step is to determine the full character set to be used, and prepare a text or word processor file containing a set of examples. The most important points to bear in mind when creating a training file are: 最初のステップは、使用する全文字セットを決定し、一連の例を含むテキストまたはワードプロセッサフ​​ァイルを準備することです。トレーニングファイルを作成する際に留意する必要がある最も重要な点は次のとおりです。
Make sure there are a minimum number of samples of each character. 10 is good, but 5 is OK for rare characters. 各文字のサンプル数が最小であることを確認してください。 10が良いですが、5はまれな文字のためにOKです。
There should be more samples of the more frequent characters - at least 20. より頻繁な文字のより多くのサンプルがあるはずです - 少なくとも20。
Don't make the mistake of grouping all the non-letters together. Make the text more realistic. すべての文字以外のものをまとめて間違えないでください。テキストをよりリアルにします。
For example: 例えば:
` | `
The quick brown fox jumps over the lazy dog. 0123456789 !@#$%^&(),.{}<>/? 速い茶色のキツネは怠惰な犬を飛び越えます。 0123456789!@#$%^&()、。{}&lt;&gt; /?
` | `
is terrible! Much better is: ひどいです!はるかに良いです:
` | `
The (quick) brown {fox} jumps! over the $3,456.78 <lazy> #90 dog & duck/goose, as 12.5% of E-mail from aspammer@website.com is spam? (素早い)茶色の{キツネ}は飛びます! $ 3,456.78以上の
最終更新:2019年08月20日 20:37