#include <julius/julius.h>
関数 | |
| static int | compare_nw (NEXTWORD **a, NEXTWORD **b) |
| 次単語候補ソート用 qsort コールバック関数. | |
| static NEXTWORD * | search_nw (NEXTWORD **nw, WORD_ID w, int num) |
| 次単語候補リスト内から単語を検索する. | |
| static LOGPROB | ngram_forw2back (NGRAM_INFO *ngram, WORD_ID *w, int wlen) |
| 後向きの N-gram スコアを前向き N-gram から算出する. | |
| static int | pick_backtrellis_words (RecogProcess *r, NEXTWORD **nw, int oldnum, NODE *hypo, short t) |
| 単語トレリスから次単語候補を抽出する. | |
| static int | get_backtrellis_words (RecogProcess *r, NEXTWORD **nw, NODE *hypo, short tm, short t_end) |
| 単語トレリスから次単語集合を決定する. | |
| static int | limit_nw (NEXTWORD **nw, NODE *hypo, int num, WORD_INFO *winfo) |
| 非展開単語を除去. | |
| int | ngram_firstwords (NEXTWORD **nw, int peseqlen, int maxnw, RecogProcess *r) |
| 初期単語仮説集合を求める. | |
| int | ngram_nextwords (NODE *hypo, NEXTWORD **nw, int maxnw, RecogProcess *r) |
| 次単語仮説集合を返す. | |
| boolean | ngram_acceptable (NODE *hypo, RecogProcess *r) |
| 受理判定 | |
Julius のN-gramを用いたスタックデコーディング(第2パス)において, 次に接続しうる単語の集合を決定する.
与えられた展開元仮説の始端フレームを予測し,単語トレリス上で その予測フレーム周辺に終端が存在する単語の集合を, そのN-gram出現確率とともに返す.
Julius では ngram_firstwords(), ngram_nextwords(), ngram_acceptable() が それぞれ第2パスのメイン関数 wchmm_fbs() から呼び出される. なお, Julian ではこれらの関数の代わりに dfa_decode.c の関数が用いられる.
ngram_decode.c で定義されています。
次単語候補ソート用 qsort コールバック関数.
| a | [in] 要素1 | |
| b | [in] 要素2 |
ngram_decode.c の 69 行で定義されています。
次単語候補リスト内から単語を検索する.
| nw | [in] 次単語候補リスト | |
| w | [in] 検索する単語のID | |
| num | [in] 次単語候補リストの長さ |
ngram_decode.c の 99 行で定義されています。
| static LOGPROB ngram_forw2back | ( | NGRAM_INFO * | ngram, | |
| WORD_ID * | w, | |||
| int | wlen | |||
| ) | [static] |
後向きの N-gram スコアを前向き N-gram から算出する.
| ngram | [in] N-gram data structure | |
| w | [in] word sequence | |
| wlen | [in] length of w |
ngram_decode.c の 139 行で定義されています。
| static int pick_backtrellis_words | ( | RecogProcess * | r, | |
| NEXTWORD ** | nw, | |||
| int | oldnum, | |||
| NODE * | hypo, | |||
| short | t | |||
| ) | [static] |
単語トレリスから次単語候補を抽出する.
単語トレリス上の指定したフレーム上に終端が存在するトレリス単語 のリストを抽出し,それらの次単語としての N-gram 接続確率を計算する. そのリストを次単語情報構造体に追加して返す.
| r | [in] 認識処理インスタンス | |
| nw | [i/o] 次単語候補リスト(抽出結果は oldnum 以降に追加される) | |
| oldnum | [in] nw にすでに格納されている次単語の数 | |
| hypo | [in] 展開元の文仮説 | |
| t | [in] 指定フレーム |
< Last two non-transparent words
< Last two non-transparent words
< Num of found non-transparent words (<=2)
< Num of skipped transparent words
ngram_decode.c の 192 行で定義されています。
| static int get_backtrellis_words | ( | RecogProcess * | r, | |
| NEXTWORD ** | nw, | |||
| NODE * | hypo, | |||
| short | tm, | |||
| short | t_end | |||
| ) | [static] |
単語トレリスから次単語集合を決定する.
指定フレームの前後 lookup_range 分に終端があるトレリス上の単語を集め, 次単語構造体を構築する. 同じ単語が上記の範囲内に複数ある場合, 指定フレームにもっとも近いトレリス上の単語が選択される.
| r | [in] 認識処理インスタンス | |
| nw | [out] 次単語集合を格納する構造体へのポインタ | |
| hypo | [in] 展開元の部分文仮説 | |
| tm | [in] 単語を探す中心となる指定フレーム | |
| t_end | [in] 単語を探すフレームの右端 |
ngram_decode.c の 334 行で定義されています。
参照元 ngram_nextwords().
非展開単語を除去.
制約により展開対象とならない単語をリストから消去する.
| nw | [i/o] 次単語集合(集合中の展開できない単語が消去される) | |
| hypo | [in] 展開元の部分文仮説 | |
| num | [in] nw に現在格納されている単語数 | |
| winfo | [in] 単語辞書 |
ngram_decode.c の 427 行で定義されています。
参照元 ngram_nextwords().
| int ngram_firstwords | ( | NEXTWORD ** | nw, | |
| int | peseqlen, | |||
| int | maxnw, | |||
| RecogProcess * | r | |||
| ) |
初期単語仮説集合を求める.
N-gramベースの探索では,初期仮説は単語末尾の無音単語に固定されている. ただし,ショートポーズセグメンテーション時は,第1パスで最終フレームに終端が 残った単語の中で尤度最大の単語となる.
| nw | [out] 次単語候補リスト(得られた初期単語仮説を格納する) | |
| peseqlen | [in] 入力フレーム長 | |
| maxnw | [in] nw に格納できる単語の最大数 | |
| r | [in] 認識処理インスタンス |
ngram_decode.c の 495 行で定義されています。
| int ngram_nextwords | ( | NODE * | hypo, | |
| NEXTWORD ** | nw, | |||
| int | maxnw, | |||
| RecogProcess * | r | |||
| ) |
次単語仮説集合を返す.
与えられた部分文仮説から,次に接続しうる単語の集合を返す. 実際には, 第1パスの結果であるトレリス単語集合 bt 上で,展開元の部分文仮説の最終単語の (推定された)始端フレーム hypo->estimated_next_t の前後に存在する 単語集合を取出し,それらの N-gram 接続確率を計算して返す. 取り出された次単語仮説は,あらかじめ maxnm の長さだけ 領域が確保されている nw に格納される.
| hypo | [in] 展開元の文仮説 | |
| nw | [out] 次単語候補リストを格納する領域へのポインタ | |
| maxnw | [in] nw の最大長 | |
| r | [in] 認識処理インスタンス |
ngram_decode.c の 562 行で定義されています。
| boolean ngram_acceptable | ( | NODE * | hypo, | |
| RecogProcess * | r | |||
| ) |
受理判定
与えられた部分文仮説が,文(すなわち探索終了)として 受理可能であるかどうかを返す. N-gram では文頭に対応する無音単語 (silhead) であれば受理する.
| hypo | [in] 部分文仮説 | |
| r | [in] 認識処理インスタンス |
ngram_decode.c の 612 行で定義されています。
1.5.4