create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: dje
|
| 3 |
+
tags:
|
| 4 |
+
- fasttext
|
| 5 |
+
- word-embeddings
|
| 6 |
+
- zarma
|
| 7 |
+
- nlp
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
datasets:
|
| 10 |
+
- 27Group/noisy_zarma
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
## Description
|
| 14 |
+
This repository contains a pre-trained FastText model for the Zarma language. The model generates word embeddings for Zarma text, capturing semantic and contextual information for various NLP tasks.
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
## Tasks
|
| 18 |
+
- **Word Embeddings**: Generate vector representations for Zarma words.
|
| 19 |
+
- **Part-of-Speech (POS) Tagging**: Provide features for POS tagging models.
|
| 20 |
+
- **Text Classification**: Use embeddings for sentiment analysis or topic classification.
|
| 21 |
+
- **Semantic Similarity**: Compute similarity between Zarma words or phrases.
|
| 22 |
+
|
| 23 |
+
## Usage Examples
|
| 24 |
+
|
| 25 |
+
### 1. Word Embeddings
|
| 26 |
+
Load the FastText model to get word embeddings for Zarma text.
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
import fasttext
|
| 30 |
+
|
| 31 |
+
model = fasttext.load_model('zarma_fasttext.bin')
|
| 32 |
+
|
| 33 |
+
word = "ay"
|
| 34 |
+
embedding = model.get_word_vector(word)
|
| 35 |
+
print(f"Embedding for '{word}': {embedding[:5]}...")
|
| 36 |
+
```
|
| 37 |
+
### 2. Semantic Similarity
|
| 38 |
+
```python
|
| 39 |
+
import fasttext
|
| 40 |
+
import numpy as np
|
| 41 |
+
|
| 42 |
+
model = fasttext.load_model('zarma_fasttext.bin')
|
| 43 |
+
|
| 44 |
+
word1 = "ay"
|
| 45 |
+
word2 = "ni"
|
| 46 |
+
vec1 = model.get_word_vector(word1)
|
| 47 |
+
vec2 = model.get_word_vector(word2)
|
| 48 |
+
|
| 49 |
+
similarity = np.dot(vec1, vec2) / (np.linalg.norm(vec1) * np.linalg.norm(vec2) + 1e-8)
|
| 50 |
+
print(f"Similarity between '{word1}' and '{word2}': {similarity:.4f}")
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## How to Use
|
| 54 |
+
Install FastText: **pip install fasttext**
|
| 55 |
+
|
| 56 |
+
Download **zarma_fasttext.bin** from this repository.
|
| 57 |
+
|
| 58 |
+
Use the code snippets above to integrate the model into your NLP pipeline.
|
| 59 |
+
|
| 60 |
+
## How to cite
|
| 61 |
+
If you use this model in your work, please cite:
|
| 62 |
+
```
|
| 63 |
+
@misc{zarma_fasttext,
|
| 64 |
+
title = {Pre-trained FastText Embeddings for Zarma},
|
| 65 |
+
author = {Mamadou K. Keita and Christopher Homan},
|
| 66 |
+
year = {2025},
|
| 67 |
+
howpublished = {\url{https://huggingface.co/27Group/zarma_fasttext}}
|
| 68 |
+
}
|
| 69 |
+
```
|