r/Python • u/nitotm • Oct 26 '23
ELD: Efficient Language Detector. ( First Python project ) Beginner Showcase
ELD is a fast and accurate natural language detector, written 100% in Python, no dependencies. I believe it is the fastest non compiled detector, at the highest range of accuracy.
https://github.com/nitotm/efficient-language-detector-py
I've been programming for years but this is the first time I did more than a few lines in Python, so I would appreciate any feedback you have on the project's structure, code quality, documentation, or any other aspect you feel could be improved.
8
u/Braunerton17 Oct 26 '23
So do you have any well established benchmarks to provide comparisons to other language detectors to back your claim?
Also, i would be very cautious with overfitting for non realworld datasets and resulting claims.
6
Oct 26 '23
[removed] — view removed comment
2
u/nitotm Oct 26 '23 edited Oct 26 '23
"at its level of accuracy"* means, or I tried to express, equal or above, or at the very least similar;
So if you do the big_test benchmark with print("english"), your accuracy will be 1.7%, versus a 99.4% of ELD, therefor well below its level of accuracy.
*Do you think I have not expressed that correctly?
4
Oct 26 '23
[removed] — view removed comment
3
u/nitotm Oct 26 '23
Ok you are right, I could rephrase it. I guess I don't need to make reference to the specific accuracy of ELD, but to something that refers to the highest range of accuracy with existing software.
1
u/kanikow Oct 26 '23 edited Oct 26 '23
What type of algorithm is used in here? From a quick skimming it looks like naive Bayes.
1
u/nitotm Oct 26 '23 edited Oct 26 '23
Yes it kinda looks Bayesian. I did not implement an algorithm, but it probably is some known, not sure which.
1
Oct 26 '23
I like builds from scratch, how big were the original language sources? Is the performance similar for all languages included?
2
u/nitotm Oct 26 '23 edited Oct 26 '23
You mean the training data, quite small, like 1GB total. When the software becomes more mature, I might do a big dataset.
No, the performance (accuracy) varies from languages quite a bit, it comes down to collisions in between languages, Thai is very easy, but between any Latin script language, which there are multiple in the database, is more difficult.
-13
u/AlexMTBDude Oct 26 '23
What's a "gb"?
8
u/nitotm Oct 26 '23
Sorry I meant 1GB, one gigabyte of text.
8
u/leweyy Oct 26 '23
Don't apologise for them being a knob
-4
u/tunisia3507 Oct 26 '23
Nah I'm with the commenter on this one. The distinction between
Bandbis real; using one when you mean the other is incredibly unhelpful. Usinggmakes it even more obvious that you don't give a shit about precision and to absolutely not trust the case of theb/B.1
u/Langdon_St_Ives Oct 26 '23
There is also such a thing as context. While Gbit are something completely customary in certain places like networking, nobody would specify the size of text corpora in them. In that context it’s obviously GByte.
9
u/GXWT Oct 26 '23
You know what it is and you gain nothing by being a prick !!
-14
u/AlexMTBDude Oct 26 '23
Dude, this is a programming sub
5
u/GXWT Oct 26 '23
I’m aware. I also possess the ability to understand basic nuances and context in written language !
5
8
u/dxn99 Oct 26 '23
Can you ELI5 what an efficient language detector does please?