pub struct Entity {
pub mention: String,
pub score: f32,
pub span: (usize, usize),
}Expand description
An entity mention located in a chunk of source text.
Fields are deliberately flat and serde-round-trippable so that an
ingest pipeline can attach the list verbatim to a Node’s props
bag or persist it as an audit artefact without an intermediate DTO.
Fields§
§mention: StringSurface form of the mention, exactly as it appears in the source text (whitespace-normalised but otherwise untouched).
score: f32Extractor-assigned score in [0.0, 1.0]. For the KeyBERT
extractor this is the cosine similarity between the candidate
embedding and the chunk embedding after MMR diversification.
span: (usize, usize)Byte span (start, end) of the mention in the original chunk
text. end is exclusive, matching str::get(start..end).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entity
impl<'de> Deserialize<'de> for Entity
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
impl StructuralPartialEq for Entity
Auto Trait Implementations§
impl Freeze for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnsafeUnpin for Entity
impl UnwindSafe for Entity
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