#[non_exhaustive]pub struct NlpLabelMaps {
pub pos: Vec<String>,
pub ner: Vec<String>,
pub deprel: Vec<String>,
pub srl: Vec<String>,
pub cls: Vec<String>,
pub morph: Vec<String>,
pub lemma: Vec<String>,
pub sentiment: Vec<String>,
pub ent_type: Vec<String>,
}Expand description
The label vocabularies a model decodes against, one list per head.
Each vector is indexed by the model’s internal class id, so a decoded class
id k for a head maps to labels.<head>[k]. In particular
cls is parallel to SpeechAct::scores. Exposing
these lets consumers map labels back to ids without embedding a parallel
copy of the model’s label_maps.json.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pos: Vec<String>Part-of-speech tag vocabulary.
ner: Vec<String>Named-entity BIO tag vocabulary.
deprel: Vec<String>Dependency relation vocabulary.
srl: Vec<String>Semantic-role BIO tag vocabulary.
cls: Vec<String>Dialog-act / sentence-classification vocabulary, parallel to
SpeechAct::scores.
morph: Vec<String>Morphological feature-bundle vocabulary. Empty for models without a morphology head.
lemma: Vec<String>Lemmatiser vocabulary. kniv v7 predicts an edit script
("case|strip|append") rather than the lemma itself, so these are
scripts, not words.
sentiment: Vec<String>Sentiment vocabulary. Empty for models without a sentiment head.
ent_type: Vec<String>Coarse entity-type vocabulary used by the default entity head, i.e.
what NlpEntity::ty carries when the request has no
ExtractionSchema::entity_types.
Trait Implementations§
Source§impl Clone for NlpLabelMaps
impl Clone for NlpLabelMaps
Source§fn clone(&self) -> NlpLabelMaps
fn clone(&self) -> NlpLabelMaps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NlpLabelMaps
impl Debug for NlpLabelMaps
Source§impl Default for NlpLabelMaps
impl Default for NlpLabelMaps
Source§fn default() -> NlpLabelMaps
fn default() -> NlpLabelMaps
Auto Trait Implementations§
impl Freeze for NlpLabelMaps
impl RefUnwindSafe for NlpLabelMaps
impl Send for NlpLabelMaps
impl Sync for NlpLabelMaps
impl Unpin for NlpLabelMaps
impl UnsafeUnpin for NlpLabelMaps
impl UnwindSafe for NlpLabelMaps
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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