News for hackers. Stuff that matters.

wooorm

Re:Show HN: Alex – Catch insensitive, inconsiderate writing on Wednesday September 02, 2015 @04:06PM (#10161596)
alex is open to suggestion. See http://alexjs.com/#contributing on how to contribute. So if you have a word to add or phrasing to remove let us know!
Re:Show HN: Franc – Detect natural languages on Monday October 06, 2014 @01:54AM (#8414458)
Perhaps you should ;) If, I’d be interest to know how it goes!
Re:Show HN: Franc – Detect natural languages on Sunday October 05, 2014 @02:40PM (#8413020)
It’s a very interesting idea. Would it work accurate enough when scaled to 160+ languages?
Re:Show HN: Franc – Detect natural languages on Sunday October 05, 2014 @06:14AM (#8411915)
I pushed a fix, incorporating your suggestions, and your examples in the specs.

Thanks a lot!

Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @03:42PM (#8407263)
It’s an interesting thought. I might fiddle on it, but I’m not sure it would work in practice (d’oh). Thanks!
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @03:41PM (#8407255)
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.
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @03:34PM (#8407225)
Thanks ;)
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @11:16AM (#8405878)
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

Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @11:02AM (#8405810)
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!

Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @10:44AM (#8405731)
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!
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @10:35AM (#8405694)
Oh you’re right. I think I have a fix in mind, will work on it. Thanks so much!
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @10:25AM (#8405648)
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 :)

Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @10:16AM (#8405625)
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 :)
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:51AM (#8405523)
Franc seems to work well on longer passages. Such as these: https://github.com/wooorm/franc/blob/master/spec/fixtures.js...

It’s interesting though, I’ll take a look at it!

Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:44AM (#8405484)
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!
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:43AM (#8405480)
That would be awesome :)
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:42AM (#8405478)
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?
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:24AM (#8405394)
And it doesn’t have a Universal Declaration of Human rights: http://www.unicode.org/udhr/index_by_name.html
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:21AM (#8405382)
Fries as in Frisian? I don’t think it has one million speakers (right?) :p
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:11AM (#8405342)
You seem to be completely right, I hand-crawled the data (https://github.com/wooorm/speakers), but seem to have made big typo there! Thanks!
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @09:09AM (#8405331)
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

Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @08:52AM (#8405266)
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!

Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @08:44AM (#8405241)
Agreed :)
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @08:44AM (#8405238)
I’m also really interested in trying something like this: http://www.slideshare.net/shuyo/short-text-language-detectio... (slide 6). But I’d need a lot of training data, more than UDHR.
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @08:36AM (#8405209)
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.
Re:Show HN: Franc – Detect natural languages on Friday October 03, 2014 @08:34AM (#8405203)
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 ;)

Older »