Vocabularies¶
ffp.vocab
|
Load a vocabulary from a finalfusion file. |
Load a FinalfusionBucketVocab from the given finalfusion file. |
|
Load a FastTextVocab from the given finalfusion file. |
|
Load a ExplicitVocab from the given finalfusion file. |
|
Load a SimpleVocab from the given finalfusion file. |
|
Finalfusion vocabulary interface. |
|
|
Simple vocabulary. |
Interface for vocabularies with subword lookups. |
|
Finalfusion Bucket Vocabulary. |
|
|
FastText vocabulary |
|
A vocabulary with explicitly stored n-grams. |
|
Frequency Cutoff |
-
ffp.vocab.
load_vocab
(file: Union[str, bytes, int, os.PathLike]) → ffp.vocab.vocab.Vocab[source]¶ Load a vocabulary from a finalfusion file.
Loads the first known vocabulary from a finalfusion file.
- Parameters
file (str, bytes, int, PathLike) – Path to file containing a finalfusion vocab chunk.
- Returns
vocab – First Vocab in the file.
- Return type
SimpleVocab, FastTextVocab, FinalfusionBucketVocab, ExplicitVocab
- Raises
ValueError – If the file did not contain a vocabulary.