Add blank penalty for various language bindings. (#1234)
This commit is contained in:
@@ -11,6 +11,7 @@ public class OfflineRecognizerConfig {
|
||||
private final float hotwordsScore;
|
||||
private final String ruleFsts;
|
||||
private final String ruleFars;
|
||||
private final float blankPenalty;
|
||||
|
||||
private OfflineRecognizerConfig(Builder builder) {
|
||||
this.featConfig = builder.featConfig;
|
||||
@@ -21,6 +22,7 @@ public class OfflineRecognizerConfig {
|
||||
this.hotwordsScore = builder.hotwordsScore;
|
||||
this.ruleFsts = builder.ruleFsts;
|
||||
this.ruleFars = builder.ruleFars;
|
||||
this.blankPenalty = builder.blankPenalty;
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
@@ -40,6 +42,7 @@ public class OfflineRecognizerConfig {
|
||||
private float hotwordsScore = 1.5f;
|
||||
private String ruleFsts = "";
|
||||
private String ruleFars = "";
|
||||
private float blankPenalty = 0.0f;
|
||||
|
||||
public OfflineRecognizerConfig build() {
|
||||
return new OfflineRecognizerConfig(this);
|
||||
@@ -84,5 +87,10 @@ public class OfflineRecognizerConfig {
|
||||
this.ruleFars = ruleFars;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBlankPenalty(float blankPenalty) {
|
||||
this.blankPenalty = blankPenalty;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ public class OnlineRecognizerConfig {
|
||||
private final float hotwordsScore;
|
||||
private final String ruleFsts;
|
||||
private final String ruleFars;
|
||||
private final float blankPenalty;
|
||||
|
||||
private OnlineRecognizerConfig(Builder builder) {
|
||||
this.featConfig = builder.featConfig;
|
||||
@@ -31,6 +32,7 @@ public class OnlineRecognizerConfig {
|
||||
this.hotwordsScore = builder.hotwordsScore;
|
||||
this.ruleFsts = builder.ruleFsts;
|
||||
this.ruleFars = builder.ruleFars;
|
||||
this.blankPenalty = builder.blankPenalty;
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
@@ -54,6 +56,7 @@ public class OnlineRecognizerConfig {
|
||||
private float hotwordsScore = 1.5f;
|
||||
private String ruleFsts = "";
|
||||
private String ruleFars = "";
|
||||
private float blankPenalty = 0.0f;
|
||||
|
||||
public OnlineRecognizerConfig build() {
|
||||
return new OnlineRecognizerConfig(this);
|
||||
@@ -118,5 +121,10 @@ public class OnlineRecognizerConfig {
|
||||
this.ruleFars = ruleFars;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBlankPenalty(float blankPenalty) {
|
||||
this.blankPenalty = blankPenalty;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user