Extraction
The point of LlamaExtract is to extract structured data from unstructured files, usually a large number of them. Before you extract you must have created a schema that defines the structure of the data you want to extract.
Running an extraction
To extract data from a set of files, you need to call extractor.extract()
with the schema ID and the files you want to extract data from. This will return a list of ExtractionResult
objects, one for each file you passed in.
extractor = LlamaExtract()
results = extractor.extract(
schema_id="616c354a-dd4e-44b0-a830-89e0f52a2169",
files=["data/file1.pdf", "data/file2.pdf"],
)
for result in results:
print(result)