Trait SentenceEncoder

Source
pub trait SentenceEncoder {
    type Encoding;
    type Error: Error;

    // Required method
    fn encode(
        &self,
        sentence: &Sentence,
    ) -> Result<Vec<Self::Encoding>, Self::Error>;
}
Expand description

Trait for sentence encoders.

A sentence encoder extracts a representation of each token in a sentence, such as a part-of-speech tag or a topological field.

Required Associated Types§

Source

type Encoding

Source

type Error: Error

The encoding error type.

Required Methods§

Source

fn encode( &self, sentence: &Sentence, ) -> Result<Vec<Self::Encoding>, Self::Error>

Encode the given sentence.

Implementors§