您的位置:首页 > 其它

SausageMaker API

2015-06-25 22:16 288 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  sphinx 语音识别