Adding recognition words

January 18, 2013

You can add new words to be recognized to MMDAgent, by making a user dictionary. The location of the user dictionary (.dic) is:

  • the same folder of the executable (MMDAgent.exe), replacing the suffix “.exe” with “.dic”, when MMDAgent is invoked solely with no argument.
  • the same folder of the configuration file (.mdf), replacing the suffix “.mdf” with “.dic”, when invoked with configuration file (.mdf) as argument.

The format of the user dictionary (.dic) is basically a plain text file, having one word entry per line as a space/tab-separated list as shown bellow:

    東京:トーキョー:東京:515 @1.0 鶴舞:ツルマイ:鶴舞:515 [鶴舞]   ts u r u m a i
    花子:ハナコ:花子:513     @2.0 メイ:メイ:メイ:513    [メイ]   m e i
    花子:ハナコ:花子:513     @2.0 メイ:メー:メイ:513    [メイ]   m e:
    <unk>                 @0.0 <unk>              [ヘロー]  h e r o:

The first field is a grammatical string for controlling the word output.  You should specify a string of a similar word that exists in the system dictionary. At speech recognition, the output pattern of the specified word in the system dictionary will also be applied to the new word.  At the first line of the example above, the new word entry “鶴舞” is a place name, and its first field specifies that the word should output as same as “東京:トーキョー:東京:515”, which is already defined in the system dictionary.  If you are not sure on how to set this field properly, you can set this field to “<unk>” and set its output probability manually by changing the value of the second field as described below.

The second field is the additional word score, preceded by “@”.  The default is 0.0, and setting a positive larger value will make the word to output more frequently.

The third field is a grammatical expression of this word, just like the first field.  This field is actually not used in MMDAgent, so any string is acceptable.  You can leave it as “<unk>”.

The forth field is the output string when recognized.

The fifth field and the later lists describe the pronunciation of the word as a sequence of phones.

=== Japanese ========================================

ユーザ用の辞書ファイルを作成することで,辞書にない単語を登録して認識させることができます. ユーザ用の辞書ファイルの場所は,以下のようになります.

  • 実行ファイル(.exe)から起動する時は,実行ファイル(.exe)の拡張子を「.dic」に換えた辞書ファイル(.dic)
  • 設定ファイル(.mdf)から起動する時は,設定ファイル(.mdf)の拡張子を「.dic」に換えた辞書ファイル(.dic)

となります.

辞書ファイル(.dic)にはテキスト形式で,以下のように追加する単語を記述します.

    東京:トーキョー:東京:515 @1.0 鶴舞:ツルマイ:鶴舞:515 [鶴舞]   ts u r u m a i
    花子:ハナコ:花子:513     @2.0 メイ:メイ:メイ:513    [メイ]   m e i
    花子:ハナコ:花子:513     @2.0 メイ:メー:メイ:513    [メイ]   m e:
    <unk>                 @0.0 <unk>              [ヘロー]  h e r o:

第1フィールドは単語の出現を表す文字列を指定します.システム辞書内にある単語の中で似た単語の第1フィールドを指定します.音声認識時には,ここで指定された単語の出現パターンがそのままこの新単語に適用されます.上の最初の例では「鶴舞」は地名であり,システム辞書内にある「東京:トーキョー:東京:515」を指定することで出現を定義しています.分からない場合は「<unk>」と記述して,下記の第2フィールドの補正値を変えることで手動で調整することもできます.

第2フィールドの@の後の数字は補正値で,大きくするほど認識されやすくなります.認識されにくい場合はこの数字を大きくしてください.

第3フィールドにはその単語の登録情報を,表記:発音:基本形の順で記述します.数字は第1フィールドと同じ物を使用してください.また第1フィールド同様,分からない場合は「<unk>」で構いません.

第4フィールドの[]内に書かれたものは,認識結果として出てくる単語となります.

第5フィールドは読みを表す音素列を表します.