CoolFace
Modelpublic

hezarai/fasttext-fa-300

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes2.2kdownloads
Model Card

This is the original fasttext embedding model for Persian from here loaded and converted using Gensim and exported to Hezar compatible format. For more info, see here.

In order to use this model in Hezar you can simply use this piece of code:

bash
pip install hezar
python
from hezar.embeddings import Embedding

fasttext = Embedding.load("hezarai/fasttext-fa-300")
# Get embedding vector
vector = fasttext("هزار")
# Find the word that doesn't match with the rest
doesnt_match = fasttext.doesnt_match(["خانه", "اتاق", "ماشین"])
# Find the top-n most similar words to the given word
most_similar = fasttext.most_similar("هزار", top_n=5)
# Find the cosine similarity value between two words
similarity = fasttext.similarity("مهندس", "دکتر")