pub struct ExampleData {
pub text: String,
pub extractions: Vec<Extraction>,
}
Expand description
Example data for training/prompting
Represents a single training example that shows the model how to extract information from text.
Fields§
§text: String
The raw input text (sentence, paragraph, etc.)
extractions: Vec<Extraction>
List of extractions that should be found in this text
Implementations§
Source§impl ExampleData
impl ExampleData
Sourcepub fn new(text: String, extractions: Vec<Extraction>) -> Self
pub fn new(text: String, extractions: Vec<Extraction>) -> Self
Create a new example with text and extractions
Sourcepub fn add_extraction(&mut self, extraction: Extraction)
pub fn add_extraction(&mut self, extraction: Extraction)
Add an extraction to this example
Trait Implementations§
Source§impl Clone for ExampleData
impl Clone for ExampleData
Source§fn clone(&self) -> ExampleData
fn clone(&self) -> ExampleData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ExampleData
impl Debug for ExampleData
Source§impl<'de> Deserialize<'de> for ExampleData
impl<'de> Deserialize<'de> for ExampleData
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
Source§impl PartialEq for ExampleData
impl PartialEq for ExampleData
Source§impl Serialize for ExampleData
impl Serialize for ExampleData
impl StructuralPartialEq for ExampleData
Auto Trait Implementations§
impl Freeze for ExampleData
impl RefUnwindSafe for ExampleData
impl Send for ExampleData
impl Sync for ExampleData
impl Unpin for ExampleData
impl UnwindSafe for ExampleData
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