[−][src]Trait finalfusion::vocab::Vocab
Embedding vocabularies.
Required methods
fn idx(&self, word: &str) -> Option<WordIndex>
Get the index of a token.
fn words_len(&self) -> usize
Get the number of words in the vocabulary.
fn vocab_len(&self) -> usize
Get the total length of this vocabulary, including possible subword indices.
fn words(&self) -> &[String]
Get the words in the vocabulary.
Implementors
impl Vocab for VocabWrap
[src]
fn idx(&self, word: &str) -> Option<WordIndex>
[src]
fn words_len(&self) -> usize
[src]
Get the vocabulary size.
fn vocab_len(&self) -> usize
[src]
fn words(&self) -> &[String]
[src]
Get the words in the vocabulary.
impl Vocab for SimpleVocab
[src]
fn idx(&self, word: &str) -> Option<WordIndex>
[src]
fn words_len(&self) -> usize
[src]
fn vocab_len(&self) -> usize
[src]
fn words(&self) -> &[String]
[src]
impl<I> Vocab for SubwordVocab<I> where
I: Indexer,
[src]
I: Indexer,