Vocabularies¶
finalfusion.vocab
Load any 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. |
-
finalfusion.vocab.
load_vocab
(file: Union[str, bytes, int, os.PathLike]) → finalfusion.vocab.vocab.Vocab[source]¶ Load any 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 vocabulary in the file.
- Return type
- Raises
ValueError – If the file did not contain a vocabulary.