run-llama / create-llama

The easiest way to get started with LlamaIndex
MIT License
921 stars 116 forks source link

[Use-Case] Add Form Filling #362

Open marcusschiesser opened 1 week ago

marcusschiesser commented 1 week ago

Change the structured extraction template to support this use case: https://github.com/run-llama/llamacloud-demo/blob/main/examples/form_filling/Form_Filling_10K_SEC.ipynb

Start with a feasibility test: Instead of making one query for each financial parameter (as in the Jupyter notebook), we try to retrieve all financial parameters for a company for a specific year in one query and save the output in a pydantic model. This is testable with the current structured extraction template after connecting it to the provided LlamaCloud index form the notebook.

One query:

query = f"what are the financial parameters of {company} for the year {year}?. Don't be verbose. Provide 1-5 words answers for mathematical values. If you are unable to provide answer, output as NA"

Model:

class QueryResult(BaseModel):
    """Financial parameters for a company for a specific year."""

   net_income: float
   EPS: float
   EBITDA: float
marcusschiesser commented 3 days ago

Note: here are some ideas concerning form filling: https://www.notion.so/llamaindex/General-Report-Generation-Scoping-117db4b7d41a8015a3f9d60aacbc81ae?pvs=4