Instructions to use fse/fasttext-crawl-subwords-300 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fse
How to use fse/fasttext-crawl-subwords-300 with fse:
pip install "fse<2"
from fse import SIF, IndexedList, Vectors vectors = Vectors.from_pretrained("fasttext-crawl-subwords-300") model = SIF(vectors) sentences = IndexedList([["hello", "world"], ["fast", "sentence", "embeddings"]]) model.train(sentences) vector = model.sv[0] - fastText
How to use fse/fasttext-crawl-subwords-300 with fastText:
from huggingface_hub import hf_hub_download import fasttext model = fasttext.load_model(hf_hub_download("fse/fasttext-crawl-subwords-300", "model.bin")) - Notebooks
- Google Colab
- Kaggle
fastText Common Crawl with subwords (300 dimensions)
2 million English word vectors trained with subword information on Common Crawl (600 billion tokens). The 2,000,000 ngram buckets are included, so fse also computes vectors for words outside the vocabulary from their character ngrams.
This is a gensim model, packaged for fse (Fast Sentence Embeddings), which turns word vectors into sentence vectors with CBOW averaging, SIF and uSIF.
Usage
This repository uses the fse 1.x API and requires fse<2.
For fse 2.0, use fse/fasttext-crawl-subwords-300-raw for a finished mean encoder.
See the migration guide before upgrading.
pip install "fse<2"
from fse import SIF, IndexedList, FTVectors
vectors = FTVectors.from_pretrained("fasttext-crawl-subwords-300")
model = SIF(vectors)
sentences = IndexedList([["hello", "world"], ["fast", "sentence", "embeddings"]])
model.train(sentences)
model.sv[0] # the vector of the first sentence
FTVectors.from_pretrained("fasttext-crawl-subwords-300", mmap="r") memory-maps the vectors instead of loading them into RAM.
Files
| File | Content |
|---|---|
fasttext-crawl-subwords-300.model |
gensim FastTextKeyedVectors (vocabulary and metadata) |
fasttext-crawl-subwords-300.model.vectors.npy |
2,000,000 ร 300 float32 word vectors including their ngrams (2.4 GB) |
fasttext-crawl-subwords-300.model.vectors_ngrams.npy |
2,000,000 ร 300 float32 ngram vectors (2.4 GB) |
fasttext-crawl-subwords-300.model.vectors_vocab.npy |
2,000,000 ร 300 float32 word vectors (2.4 GB) |
Source and license
The vectors were published by Facebook AI Research with fastText under the Creative Commons Attribution-Share-Alike License 3.0; this redistribution is under the same license. This repository redistributes them in the gensim format.
- Mikolov et al. (2018), Advances in Pre-Training Distributed Word Representations
About fse
fse is maintained by Dr. Oliver Borchers. Source code, documentation and the STS benchmark of all vector sets in this organization: github.com/oborchers/Fast_Sentence_Embeddings.
- Downloads last month
- 143