fastText#
fastText is a lightweight text embedder developed at Meta.
Dependencies#
To use fastText in Vecworks additional dependencies need to be installed. You may do so using pip:
pip install vecworks[fasttext]
API#
- class vecworks.vectorizers.fasttext.fastTextVectorizer#
Wrapper class to ease use of fastText-based vectorizers in Vecworks.
Interface#
- __init__(model: str | fastTextModel, backend: Literal['fasttext', 'compress-fasttext'] = 'fasttext', output: Literal['word', 'sentence'] = 'sentence')#
Initializes the vectorizer.
Parameters#
- model
Either file path to a FastText model to load, or a loaded FastText model.
- backend
The FastText implementation to use, one of:
fasttext, the original fastText implementation by Facebook.
compress-fasttext, the implementation by David Dale developed to deploy compressed fastText models.
- output
The kind of vector that needs to be generated, either a ‘word’ vector or a ‘sentence’ vector.