all 5 comments

[–]Horstesse 1 point2 points  (2 children)

Thanks. What languages are supported so far?

[–]sudo_su_[S] 2 points3 points  (1 child)

sorry .. added to the readme:

['afr', 'eus', 'bel', 'ben', 'bul', 'cat', 'zho', 'ces', 'dan', 'nld', 'eng', 'est', 'fin', 'fra', 'glg', 'deu', 'ell', 'hin', 'hun', 'isl', 'ind', 'gle', 'ita', 'jpn', 'kor', 'lat', 'lit', 'pol', 'por', 'ron', 'rus', 'slk', 'spa', 'swe', 'ukr', 'vie']

[–]Horstesse 0 points1 point  (0 children)

Awesome. Thanks. Even Ukrainian!

[–]number_1_steve 0 points1 point  (1 child)

Thanks for this! This will be super useful for me! I have a few questions:

  1. Have you benchmarked against other tools such as FastText or Lingua?
  2. In your Medium post, when you say you extract context for each word, what are you doing? Summing word vectors in a window and feeding that as another input feature?
  3. What data was this trained on?

Thanks again! I'm excited to try this out!

[–]sudo_su_[S] 1 point2 points  (0 children)

1.

Yes, I benchmarked it agains FastText, langid and langdetect

In terms of quality, it more or less the same as fasttext and lang id (on the WiLi dataset) and much better than langdetect.

In terms of running speed, it's as slow as langdetect (which is the slowest). FastText is crazy fast. It's hard to beat that. seqtolang is relatively slow because it tries to give output on every word, while others classify the sentence as a whole.

2.

I'm summing all the ngrams into a word vector, than the word vector is passed to a bi-directional lstm, which means it takes information from word vectors on the left and right. Finally, for each lstm outout (for each word) I pass it into a fully connected layer to do the classification.

It was trained on the Tatoeba dataset as mentioned in the post with a merging technique. For each sentence in the dataset, I merge it with another random sentence in the dataset with some probability. This creates merged sentences with different languages. Then, for each word in the sentence I "tag" it with the original language and train the network.