Instructions to use Phazel/fa-floret-wiki-vectors with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- spaCy
How to use Phazel/fa-floret-wiki-vectors with spaCy:
!pip install https://huggingface.co/Phazel/fa-floret-wiki-vectors/resolve/main/fa-floret-wiki-vectors-any-py3-none-any.whl # Using spacy.load(). import spacy nlp = spacy.load("fa-floret-wiki-vectors") # Importing as module. import fa-floret-wiki-vectors nlp = fa-floret-wiki-vectors.load() - fastText
How to use Phazel/fa-floret-wiki-vectors with fastText:
from huggingface_hub import hf_hub_download import fasttext model = fasttext.load_model(hf_hub_download("Phazel/fa-floret-wiki-vectors", "model.bin")) - Notebooks
- Google Colab
- Kaggle
fa-floret-wiki-vectors
Floret word vectors for Persian, trained on Persian Wikipedia with floret-torch, a GPU (PyTorch) port of explosion/floret.
Trained on the full fawiki dump (WikiExtractor, spaCy blank("fa")
tokenization): 8,428,449 sentences, 190,781,621 tokens.
--model cbow --mode floret --dim 300 --minn 5 --maxn 5 \
--hashCount 2 --bucket 200000 --neg 10 --epoch 5 --lr 0.05 \
--minCount 20 --batch 8192
This is the table the fa_dep_news_lg / fa_core_news_lg / fa_ent_news_lg
pipelines are trained against.
Files
- fa.floret โ hashed bucket table. Reconstructs a vector for any word,
including ones never seen in training, via subword n-gram hashing.
python -m spacy init vectors fa fa.floret ./fa_pipeline --mode floret - fa.vec โ plain word2vec text format, fixed vocabulary above
minCount 20. No OOV lookup.from gensim.models import KeyedVectors kv = KeyedVectors.load_word2vec_format("fa.vec") - fa_floret_wiki_200k-0.1.0-py3-none-any.whl โ installable vectors-only
spaCy pipeline (
pipeline: []) withfa.floretembedded as a 200,000-row x 300d table.pip install https://huggingface.co/Phazel/fa-floret-wiki-vectors/resolve/main/fa_floret_wiki_200k-0.1.0-py3-none-any.whlTo train against it without installing anything, point spaCy'simport spacy nlp = spacy.load("fa_floret_wiki_200k") print(nlp.vocab.vectors.shape) # (200000, 300)--paths.vectorsat an unpacked copy (scripts/unpack_vectors.pyin spacy-persian).
Related tables
| Package | Rows | Corpus | Used by |
|---|---|---|---|
fa_floret_400k |
50k | 400k Persian documents | md tier |
fa_floret_full_wiki |
50k | full Persian Wikipedia dump | โ |
fa_floret_wiki_200k (this repo) |
200k | full Persian Wikipedia dump, 5 epochs | lg tier |
Licence
CC BY-SA 4.0. The vectors are a derivative of Persian Wikipedia text
(CC BY-SA 4.0), so the share-alike condition carries over; this is also the
licence recorded for this table in the lg pipelines' meta.json.
The floret-torch training tooling is MIT and imposes no condition on the
output.
- Downloads last month
- 8