LeXtract.ExampleData (lextract v0.1.2)
View SourceRepresents a training example for extraction with input text and expected output.
Used to provide few-shot examples to LLMs and for schema generation from examples.
Fields
:input- The input text to extract from:output- The expected output structure with extractions
Examples
iex> example = %LeXtract.ExampleData{
...> input: "Patient takes aspirin 100mg daily",
...> output: %{
...> "extractions" => [
...> %{
...> "class" => "Medication",
...> "medication_attributes" => %{
...> "name" => "aspirin",
...> "dosage" => "100mg"
...> }
...> }
...> ]
...> }
...> }
iex> example.input
"Patient takes aspirin 100mg daily"
Summary
Functions
Creates a new example data struct.