pub struct Span {
pub start: usize,
pub end: usize,
pub text: String,
pub weakest_token: String,
pub min_prob: f64,
pub alternatives: Vec<Candidate>,
pub entropy_bits: Option<f64>,
}Expand description
A run of low-confidence words.
Fields§
§start: usizeFirst token index (inclusive).
end: usizeLast token index (exclusive).
text: StringThe span text, tokens joined.
weakest_token: StringThe least likely token in the span and its probability.
min_prob: f64Probability of the weakest token.
alternatives: Vec<Candidate>What the model considered at the weakest token, most likely first.
Empty when the input has no top_logprobs.
entropy_bits: Option<f64>Entropy in bits of the alternatives at the weakest token, after
renormalising them to sum to 1 (only the top-k alternatives are
returned, so this is a lower bound on the model’s real entropy).
0 for one alternative, 1 for two equally likely ones. None without
top_logprobs.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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