#[non_exhaustive]pub struct NlpWindow {
pub tokens: Vec<String>,
pub analysed_words: usize,
pub sentences: Vec<WindowSentence>,
pub words: Vec<WordAnalysis>,
pub ner: Vec<WordSpan>,
pub srl: Vec<WindowFrame>,
pub coref: Vec<Vec<(usize, usize)>>,
pub entities: Vec<NlpEntity>,
pub facts: Vec<NlpFact>,
}Expand description
One analysis window: a run of whole sentences of up to the model’s word budget, analysed in a single pass.
Windows never cross a paragraph or a turn, and a sentence is never split
across two windows. Every index in this struct — heads, spans, mention
positions — is a word index into tokens, local to
the window.
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.tokens: Vec<String>The window’s words, in order.
analysed_words: usizeHow many leading words fit in the encoder’s subword budget.
Words from this index on are reported in tokens but
carry no analysis. Equal to tokens.len() for a window that fits.
sentences: Vec<WindowSentence>The window’s sentences.
words: Vec<WordAnalysis>Per-word analysis, one entry per analysed word (so
words.len() == analysed_words).
ner: Vec<WordSpan>Named entities as (type, start, end) half-open word spans, using
the model’s own NER vocabulary (kniv v7: OntoNotes).
srl: Vec<WindowFrame>Semantic-role frames, one per predicate — every predicate, not only verbs.
coref: Vec<Vec<(usize, usize)>>Coreference clusters: each cluster is a list of inclusive
(start, end) word spans.
entities: Vec<NlpEntity>Typed entities, grouped across their mentions. In a conversation the speakers come first, in order of first appearance.
facts: Vec<NlpFact>Facts between entities, scored against the request schema’s relations.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NlpWindow
impl RefUnwindSafe for NlpWindow
impl Send for NlpWindow
impl Sync for NlpWindow
impl Unpin for NlpWindow
impl UnsafeUnpin for NlpWindow
impl UnwindSafe for NlpWindow
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