LeXtract.Document (lextract v0.1.2)
View SourceRepresents an input document for information extraction.
Fields
:text- Raw text content of the document:additional_context- Extra context provided to LLM (not part of main text):document_id- Unique identifier (auto-generated if not provided):metadata- Optional metadata about the document
Examples
iex> doc = LeXtract.Document.create("The patient has diabetes.")
iex> doc.text
"The patient has diabetes."
Summary
Functions
Creates a new document with the given text.
Creates multiple documents from a list of texts.
Types
Functions
Creates a new document with the given text.
Automatically generates a UUID if document_id is not provided.
Examples
iex> doc = LeXtract.Document.create("Sample text")
iex> String.length(doc.document_id)
36
Creates multiple documents from a list of texts.
Examples
iex> docs = LeXtract.Document.from_texts(["Text 1", "Text 2"])
iex> length(docs)
2