Update README.md
Browse files
README.md
CHANGED
|
@@ -43,3 +43,25 @@ print(model.most_similar("ዋልዳይት"))
|
|
| 43 |
[('ወቤት', 0.54), ('ሐደክዉ', 0.50), ('ኢመሓዛትካ', 0.47), ...]
|
| 44 |
[('ዋልዳይትተ', 0.94), ('ዋልዳይትናመ', 0.93), ('ከዋልዳይት', 0.93), ...]
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
[('ወቤት', 0.54), ('ሐደክዉ', 0.50), ('ኢመሓዛትካ', 0.47), ...]
|
| 44 |
[('ዋልዳይትተ', 0.94), ('ዋልዳይትናመ', 0.93), ('ከዋልዳይት', 0.93), ...]
|
| 45 |
|
| 46 |
+
```python
|
| 47 |
+
from huggingface_hub import hf_hub_download
|
| 48 |
+
import fasttext
|
| 49 |
+
|
| 50 |
+
# Download the bin file
|
| 51 |
+
bin_path = hf_hub_download(
|
| 52 |
+
repo_id="BeitTigreAI/tigre-data-fasttext",
|
| 53 |
+
filename="tig.bin",
|
| 54 |
+
repo_type="dataset"
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
# Load model
|
| 58 |
+
ft = fasttext.load_model(bin_path)
|
| 59 |
+
|
| 60 |
+
# Example queries
|
| 61 |
+
print(ft.get_word_vector("ሻም")[:10])
|
| 62 |
+
print(ft.get_nearest_neighbors("ሻም"))
|
| 63 |
+
|
| 64 |
+
```css
|
| 65 |
+
[-2.2306, 4.1328, -1.3079, 1.3905, -3.1971, -1.2134, 0.4555, -2.9989, -0.7958, -0.2645]
|
| 66 |
+
[(0.55, 'ሻማት'), (0.53, 'ዴሪር'), (0.46, 'ምልህዮት'), ...]
|
| 67 |
+
|