You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a potential bug in the computeLanguageConfidenceValues method in LanguageDetector class when the same confidence is computed.
The return value SortedMap<Language, Double> uses comparator by prob-value, this means that when any two languages have the same probability then only one of them could remain in the map. So for example, when the original distribution is cs=0.4, de=0.4, en=0.2 then this method will return only de=0.4, en=0.2.
Good catch @mmedek, thank you. I wasn't aware of that. I will write a custom comparator that fixes the issue.
pemistahl
changed the title
Bug in computeLanguageConfidenceValues method when languages have same confidence
One of two languages with same confidence value is erroneously removed
Sep 23, 2020
There is a potential bug in the
computeLanguageConfidenceValues
method inLanguageDetector
class when the same confidence is computed.The return value
SortedMap<Language, Double>
uses comparator by prob-value, this means that when any two languages have the same probability then only one of them could remain in the map. So for example, when the original distribution is cs=0.4, de=0.4, en=0.2 then this method will return only de=0.4, en=0.2.lingua/src/main/kotlin/com/github/pemistahl/lingua/api/LanguageDetector.kt
Line 140 in 1245654
The text was updated successfully, but these errors were encountered: