Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Function result discrepancy #228

Open
EvGe22 opened this issue Jun 10, 2024 · 1 comment
Open

Multiple Function result discrepancy #228

EvGe22 opened this issue Jun 10, 2024 · 1 comment

Comments

@EvGe22
Copy link

EvGe22 commented Jun 10, 2024

Given a text in Ukrainian, two methods provide two completely different results.

detector = LanguageDetectorBuilder.from_all_languages().build()
string = "Що найбільше подобається читачам у жанрі \"Фентезі\"?"

print(detector.compute_language_confidence_values(string))
>>> [ConfidenceValue(language=Language.KAZAKH, value=1), ConfidenceValue(language=Language.AFRIKAANS, value=0), ConfidenceValue(language=Language.ALBANIAN, value=0), ...] 

print(detector.detect_multiple_languages_of(string))
>>> [DetectionResult(start_index=0, end_index=51, word_count=7, language=Language.UKRAINIAN)]
@pemistahl
Copy link
Owner

Both methods use different algorithms, so this can happen. I will try to improve them with each new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants