27Group/noisy_zarma
Viewer • Updated • 509k • 14
How to use 27Group/zarma-fasttext with fastText:
from huggingface_hub import hf_hub_download
import fasttext
model = fasttext.load_model(hf_hub_download("27Group/zarma-fasttext", "model.bin"))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.
Load the FastText model to get word embeddings for Zarma text.
import fasttext
model = fasttext.load_model('zarma_fasttext.bin')
word = "ay"
embedding = model.get_word_vector(word)
print(f"Embedding for '{word}': {embedding[:5]}...")
import fasttext
import numpy as np
model = fasttext.load_model('zarma_fasttext.bin')
word1 = "ay"
word2 = "ni"
vec1 = model.get_word_vector(word1)
vec2 = model.get_word_vector(word2)
similarity = np.dot(vec1, vec2) / (np.linalg.norm(vec1) * np.linalg.norm(vec2) + 1e-8)
print(f"Similarity between '{word1}' and '{word2}': {similarity:.4f}")
Install FastText: pip install fasttext
Download zarma_fasttext.bin from this repository.
Use the code snippets above to integrate the model into your NLP pipeline.
If you use this model in your work, please cite:
@misc{zarma_fasttext,
title = {Pre-trained FastText Embeddings for Zarma},
author = {Mamadou K. Keita and Christopher Homan},
year = {2025},
howpublished = {\url{https://huggingface.co/27Group/zarma_fasttext}}
}