Document Ingestion API can be used to summarize tables, figures and charts in documents.
ParameterDescriptionDefault Value
table_summarizationEnable summarization of tables present in the document. This will generate a summary of the table content, including key insights and trends.false
figure_summarizationEnable summarization of figures present in the document. This will generate a summary of the figure content, including key insights and trends.false
table_summarization_promptA custom prompt to use for table summarization. This can be used to provide additional context or instructions to the AI model for summarizing tables in the document. If not specified, the default prompt will be used.-
figure_summarization_promptA custom prompt to use for figure summarization. This can be used to provide additional context or instructions to the AI model for summarizing figures in the document. If not specified, the default prompt will be used.-

Why would you want to summarize tables, figures and charts?

  • Even though LLMs have long context, embedding models often don’t. In such cases, summarizing tables, embedding them, and storing their image along side the summary can help retreive the right table or figure when needed for the LLM to answer questions.
  • Figures often encode complex information which can’t be converted to Markdown or HTML. Summarizing and indexing them can help retreive the right figure when relevant questions are asked.

Summarizing Tables

Tales can be summarized by setting table_summarization to true in the enrichment_options JSON object when calling the parse API.
{
    "enrichment_options": {
        "table_summarization": true,
        "table_summarization_prompt": "Summarize the table in a way that is easy to understand and use for answering questions."
    }
}
The table summary prompt is optional. If not provided, a default prompt will be used.

Summarizing Figures and Charts

Figures can be summarized by setting figure_summarization to true in the enrichment_options JSON object when calling the parse API.
{
    "enrichment_options": {
        "figure_summarization": true,
        "figure_summary_prompt": "Summarize the figure in a way that is easy to understand and use for answering questions."
    }
}
The figure summary prompt is optional. If not provided, a default prompt will be used.