Commit
·
0f716f8
1
Parent(s):
209ad11
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: fasttext
|
3 |
+
tags:
|
4 |
+
- language-identification
|
5 |
+
---
|
6 |
+
This is a fastText-based language classification model from the paper "The first neural machine translation system for the Erzya language".
|
7 |
+
|
8 |
+
It supports 323 languages used in Wikipedia (as of July 2022), and has extended support of the Erzya (`myv`) and Moksha (`mdf`) languages.
|
9 |
+
|
10 |
+
Example usage:
|
11 |
+
|
12 |
+
```Python
|
13 |
+
import fasttext
|
14 |
+
import urllib.request
|
15 |
+
import os
|
16 |
+
model_path = 'lid.323.ftz'
|
17 |
+
url = 'https://huggingface.co/slone/fastText-LID-323/resolve/main/lid.323.ftz'
|
18 |
+
if not os.path.exists(model_path):
|
19 |
+
urllib.request.urlretrieve(url, model_path) # or just download it manually
|
20 |
+
|
21 |
+
model = fasttext.load_model(model_path)
|
22 |
+
languages, scores = model.predict("эрзянь кель", k=3) # k is the number of returned hypotheses
|
23 |
+
```
|
24 |
+
|
25 |
+
The model was trained on texts of articles randomly sampled from Wikipedia. It works better with sentences and longer texts than with words, and may be sensitive to noise.
|