pub struct Token {
pub text: String,
pub score: f64,
pub label: String,
pub label_index: i64,
pub sentence: usize,
pub index: u16,
pub word_index: u16,
pub offset: Option<Offset>,
pub mask: Mask,
}
Expand description
§Token generated by a TokenClassificationModel
Fields§
§text: String
String representation of the Token
score: f64
Confidence score
label: String
Token label (e.g. ORG, LOC in case of NER)
label_index: i64
Label index
sentence: usize
Sentence index
index: u16
Token position index
word_index: u16
Token word position index
offset: Option<Offset>
Token offsets
mask: Mask
Token mask
Trait Implementations§
Source§impl ConsolidatableTokens<Token> for Vec<Token>
impl ConsolidatableTokens<Token> for Vec<Token>
Source§fn iter_consolidate_tokens(&self) -> ConsolidatedTokenIterator<'_, Token>
fn iter_consolidate_tokens(&self) -> ConsolidatedTokenIterator<'_, Token>
Creates an iterator from a sequence of
ConsolidatableTokens
.Source§impl<'de> Deserialize<'de> for Token
impl<'de> Deserialize<'de> for Token
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more