wooorm
wooorm on Hacker News
Posted by
wooorm on Wednesday September 02, 2015 @01:43PM
from the show-hn dept.
Posted by
wooorm on Friday August 14, 2015 @01:30PM
from the show-hn dept.
Perhaps you should ;) If, I’d be interest to know how it goes!
It’s a very interesting idea. Would it work accurate enough when scaled to 160+ languages?
I pushed a fix, incorporating your suggestions, and your examples in the specs.
Thanks a lot!
It’s an interesting thought. I might fiddle on it, but I’m not sure it would work in practice (d’oh). Thanks!
I agree the task is neither impossible nor useless. There’s work to do. Short passages should be supported. I do however think franc does a good job, and adds support for some languages which before today have never (I think) been supported. Franc, certainly, “attempt”s to fix language detection, which I would argue is an AI-complete problem.
By `correct language` I mean the language
you expect, by `second` and `third` I mean `2.` and `3.` in the previously mentioned demo:
http://wooorm.github.io/franc/). I think we’re talking about the same thing!
Anyway, yeah, franc is for language detecting, but it’s optimised for many languages and works best at longer text. It’s a trade-off. For less languages and shorter texts, check out https://github.com/shuyo/ldig
Ha! Some very nice examples, I have to say :)
Anyway, You’re completely right. Italian is `und` due to LTE 10 characters, the others are slightly off due to short input too, but the demo (http://wooorm.github.io/franc/) shows the correct languages in the second or third place though!
No full-frequency data is kept, only 300 top-trigrams are identified. A quick through the source also reveals wooorm/trigrams, and wooorm/udhr, as sources!
Oh you’re right. I think I have a fix in mind, will work on it. Thanks so much!
I’ll investigate this, but I think I excluded the preamble’s for trigram creation. Sure, the words will be a bit similar, but it’ll be a lot of work to compile 380 fixtures from other sources.
I’ll investigate that too. But it’s lots of work, this already was, give me some time :)
Thanks! Currently, the UDHRs are crawled, and I’d rather not include exceptions and maintain their plain-text and XML/JSON versions by hand. If you’re into growing the language, I suggest contacting the Office of the High Commissioner of Human Rights of the UN, and the Unicode project, or fork wooorm/udhr and add support, I’ll merge :)
It sucks, right? Currently, it’s good at long passages. But for shorter values, the results are pretty poor. The amount of supported languages is just too damn high!
I’m not sure. I don’t know any CJK languages myself. I’d like some test-cases where the current methods do not work, as the example in the Readme seems to work pretty well: `এটি একটি ভাষা একক IBM স্ক্রিপ্ট` is classified as Bengali?
Fries as in Frisian? I don’t think it has one million speakers (right?) :p
One of franc’s focusses was to be pretty small, and usable on the client-side, that’s why no actual training is done and this simple method is used.
Also, I’m interest in a test-suite, before we start talking about accuracy-percentages :p
Yeah, so I’d like to add an easier way to support more, or less, languages through the Node API. Currently, there’s a number (1e6), the amount of speakers of a given language, which is hard-coded in the generation file (I added a link this morning in the statement about forking to the actual line).
If you set that number to 0, or 100,000 and execute `npm prepublish`, your franc supports more languages :) That’s it!
That’s because Haitians always say that! No, joking, it’s just that because of so may supported languages, the accuracy for very short inputs is extremely low.
You are completely right, franc doesn’t state how language are detected. The detection is based on (1) unicode-script usage and (2) trigram-counts. Some scripts are only used by one language. Other scripts, such as Cyrillic, come with many more: those are detected by the top 300 trigrams per their corresponding UDHR (Universal Declaration of Human rights, the most translated document).
Shameless plug, the page clearly stated you can fork franc to support 300+ languages ;)
Posted by
wooorm on Friday October 03, 2014 @06:57AM
from the show-hn dept.
Posted by
wooorm on Friday August 01, 2014 @04:54AM
from the dailyjs.com dept.