Financial report parser
Build a Financial Report Parser flow with the Structured output and Parser components to parse LLM responses into a structured format.
In this example, the Chat Input component is pre-loaded with a sample financial report to demonstrate extracting Gross Profit
, EBITDA
, and Net Income
.
Prerequisites
Create the financial report parser flow
- From the Langflow dashboard, click New Flow.
- Select Financial Report Parser.
The Financial Report Parser flow is created.
Run the memory chatbot flow
- Add your OpenAI API key to the OpenAI model.
- Click the Playground button, and then click Send. The Chat Input component is pre-loaded with a sample financial report for demonstration purposes. The chat returns a structured response:
_10EBITDA: $900 million , Net Income: $500 million , GROSS_PROFIT: $1.2 billion
Inspect the flow to understand how this information was extracted.
- To inspect the output schema table, in the Structured Output component, click Open table. The Structured Output component uses the attached OpenAI model component as its "brain" to extract financial data into a DataFrame with this defined schema.
_10| Name | Description | Type | Multiple |_10|--------------|-----------------------|------|----------|_10| EBITDA | description of field | text | False |_10| NET_INCOME | description of field | text | False |_10| GROSS_PROFIT | description of field | text | False |
- To inspect the template that contains the extracted data, in the Parser component, click the Scan icon in the Template field. The Parser component converts the extracted data into formatted messages for chat consumption. Each variable receives its value from the structured outputs.
_10EBITDA: {EBITDA} , Net Income: {NET_INCOME} , GROSS_PROFIT: {GROSS_PROFIT}