I see Dutch performs badly. I wouldn't be surprised if that's because of bad/noisy training data. Dutch web content contains an awful amount of English, which pollutes recognition. Cross-check the Dutch tokens with an English dictionary to be sure (although there is quite some overlap for frequent words, e.g. "is", "we", "are", "have", "bent", "had", "brief", etc., and rare ones like "keeshond").<p>BTW, the test statistic for recognizing individual words isn't interesting, unless you sample/weigh by word frequency.
> This engine first determines the alphabet of the input text and searches for characters which are unique in one or more languages. If exactly one language can be reliably chosen this way, the statistical model is not necessary anymore.<p>Can this be a problem? If a text in Language_A includes names/words of Language_B, only relying on special characters would wrongly classify the entire text as Language_B.
What's a good way to detect languages in mixed-language passages? What's the state of art here?<p>For example, given <i>"'I think, therefore I am' is the first principle of René Descartes's philosophy that was originally published in French as je pense, donc je suis."</i>, is there a library that would tell me the main passage is in English, but contains fragments in French?
I appreciate how direct and clear what this library does and who it is for. I have no need for it now, but after 1 paragraph of reading I’ll be remembering its name for later.
> Most libraries only use n-grams of size 3 (trigrams) which is satisfactory for detecting the language of longer text fragments consisting of multiple sentences. For short phrases or single words, however, trigrams are not enough.<p>I only dabbled in language detection at a workshop at a conference years ago, but I was very impressed how well such models work on short text with only bigrams.<p>Maybe once you expand to over 70 languages does bi- and tri-grams fall short, but I just wanted to say that this is a usecase here very simple models can get you really far.<p>If you see a blog post where a language detection problem is solved with deep learning chances are the author doesn’t know what they are doing (towards datascience, I’m looking at you!) or it’s a tutorial for working with an NN framework.
How does it actually compare to fasttext [1] in performance.
Building an interface to that in GO shouldn’t be too complicated.
The claim that all language identification (lid) relies on ngrams is bold and there has been a switch to pure neural network based approaches.<p>[1] <a href="https://fasttext.cc/docs/en/language-identification.html" rel="nofollow">https://fasttext.cc/docs/en/language-identification.html</a>
Great work, thanks for sharing!<p>I see <a href="https://github.com/google/cld3" rel="nofollow">https://github.com/google/cld3</a>, but how does this compare with <a href="https://github.com/CLD2Owners/cld2" rel="nofollow">https://github.com/CLD2Owners/cld2</a> which is used by the large <a href="https://commoncrawl.org" rel="nofollow">https://commoncrawl.org</a> project to classify billions of samples from the whole internet?
Hello everyone,<p>I'm the author of Lingua. Thank you for sharing my work and making it known in the NLP world.<p>Apart from the Go implementation, I've implemented the library in Kotlin, Python and Rust. Just take a look at my profile if you are interested: <a href="https://github.com/pemistahl" rel="nofollow">https://github.com/pemistahl</a>
In general, language detection is surprisingly hard. There is LSTM-based implementation <a href="https://github.com/AU-DIS/LSTM_langid" rel="nofollow">https://github.com/AU-DIS/LSTM_langid</a> which should be better than ngrams.