SausageMaker API

<span style="font-size:24px;">public class SausageMaker extends AbstractSausageMaker
Sausage製造者SausageMaker 需要字格lattice當做輸入,並把字lattice轉換爲sausage(混淆網絡)根據 "Finding Consensus in Speech Recognition: word error minimization and other applications of confusion networks"論文所提出的方法。注意通過score(Result)返回的ConfidenceResult對象的getBestHypothesis方法返回的路徑爲路徑上的所有字在相應的時間槽內是有着最高的後驗概率的。
本類的構造方法:
   public SausageMaker();創建一個空的sausage製造者對象。
 public SausageMaker(float languageWieght);通過給定語言權重來創建此類對象。
 public SausageMaker(Lattice l);給定字lattice來創建對象。Lattice爲用來構造sausage的字lattice。
本類的方法:
 protected void interWordCluster(List<Cluster> clusters);執行內部字聚集步驟。聚集當前的cluster集。
 protected boolean interWordClusterStep(List<Cluster> clusters);執行內部字聚集步驟。聚集當前的cluster集。
 protected double interClusterDistance(Cluster c1, Cluster c2);計算2個cluster之間的距離。Cluster之間的相似性。返回的如果是Double.NEGATIVE_INFINITY則那些cluster永遠都不可能聚聚到一起。
 protected boolean areClustersInRelation(Cluster cluster1, Cluster cluster2);2個clusters是有關係的如果一個cluster的成員是另一個cluster成員的祖宗ancestor。有關係返回爲true。檢查那些cluster是否彼此存在的關係。
 protected double computePhoneticSimilarity(Node n1, Node n2);計算2個lattice節點的音素的相似性,此是基於它們的最有可能的發音的字符串編輯距離。 返回的是在0到1之間的值。
protected static int stringEditDistance(List<?> p1, List<?> p2) ;查找2個對象列表之間的字符串編輯距離。對象都被用equeals()方法比較。
  public int getLatestBeginTime(List<Node> cluster);返回在給定cluster中的所有節點中的最後開始時間。返回的是最後的開始時間。
 public int getEarliestEndTime(List<Node> cluster);返回的是給定cluster中的所有節點中的最早的結束時間。
protected double intraClusterDistance(Cluster cluster1, Cluster cluster2);計算2個cluster之間的距離,使他們有着相同的字在它們中,使它們彼此不存在關係。返回的是intra-cluster distance。如果返回的是Double.NEGATIVE_INFINITY 則永遠都不可能聚集起來它們。
 protected void intraWordCluster(List<Cluster> clusters);執行intra word 聚集。 Perform the intra word clustering stage of the algorithm
 protected boolean intraWordClusterStep(List<Cluster> clusters);執行intra word 聚集。返回的是2個cluster是否合併
 public Sausage makeSausage();把一個lattice轉換爲sausage對象。返回的是the sausage producing by collapsing the lattice.
 public ConfidenceResult score(Result result);此方法獲得confidenceresult對象,在此方法中對lattice進行了設置,並對其進行了優化並計算了節點的後驗概率,並根據此lattice創造了sausage對象。
 private List<Cluster> topologicalSort(List<Cluster> clusters);對cluster進行拓撲排序。注意此是一個強有力的排序方法通過從cluster列表中移除最小的cluster,經管Collections.sort()方法不是在所有的情況下都能夠很好的工作。返回的是排序後的cluster列表。














</span>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章