summaryrefslogtreecommitdiff
path: root/java/src/com/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-10-04 12:33:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-10-04 12:33:08 +0000
commit424c4c75121a12cca48365e2a1be4d8d2589cc8e (patch)
treefe50fb9e1c2bb53c9c261e4fc55ed4e276932361 /java/src/com/android
parent2c40e7630da711b732f13fa54b8b5293852a72ba (diff)
parentf65db3ccc53a38f181ecde9aaa3147fa17e2a8bd (diff)
downloadlibtextclassifier-424c4c75121a12cca48365e2a1be4d8d2589cc8e.tar.gz
Merge "Remove significantThreshold"
Diffstat (limited to 'java/src/com/android')
-rw-r--r--java/src/com/android/textclassifier/TextClassifierImpl.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/java/src/com/android/textclassifier/TextClassifierImpl.java b/java/src/com/android/textclassifier/TextClassifierImpl.java
index 989af36..f385684 100644
--- a/java/src/com/android/textclassifier/TextClassifierImpl.java
+++ b/java/src/com/android/textclassifier/TextClassifierImpl.java
@@ -832,9 +832,6 @@ final class TextClassifierImpl {
// Original detection score to surrounding text detection score ratios.
final float subjectTextScoreRatio = langIdContextSettings[2];
final float moreTextScoreRatio = 1f - subjectTextScoreRatio;
- // Use a significant threshold here to avoid a long tail of languages with super
- // low score. TODO: Read this from the model file.
- final float significantThreshold = 0.1f;
TcLog.v(
TAG,
String.format(
@@ -852,7 +849,7 @@ final class TextClassifierImpl {
}
final String subject = text.substring(start, end);
- final EntityConfidence scores = detectLanguages(subject, significantThreshold);
+ final EntityConfidence scores = detectLanguages(subject, /* threshold= */ 0f);
if (subject.length() >= minimumTextSize
|| subject.length() == text.length()
@@ -864,7 +861,7 @@ final class TextClassifierImpl {
if (moreTextScoreRatio >= 0) {
// Attempt to grow the detection text to be at least minimumTextSize long.
final String moreText = StringUtils.getSubString(text, start, end, minimumTextSize);
- moreTextScores = detectLanguages(moreText, significantThreshold);
+ moreTextScores = detectLanguages(moreText, /* threshold= */ 0f);
} else {
moreTextScores = EntityConfidence.EMPTY;
}