Prompt template

#1
by jitvimol - opened

Can you please share what is prompt template of this model? I want to load this model to ollama. Thanks

SCB 10X org

@jitvimol Sure! A structured step-by-step approach is used to parse content types such as receipts, tables, graphs, and image captions using the Chain-of-Thought (CoT) prompt template. Here's how it looks:

prompt_parsing = (
    "You are parsing a document with diverse content types, including a restaurant receipt, graphs, tables, and image captions. "
    "Please proceed with a step-by-step approach for each content type:\n\n"
    
    "1. **Receipt Parsing**:\n"
    "   - First, locate the total amount paid and the tip amount within the receipt. Identify the currency, if present. "
    "   - Ensure that both amounts are clearly extracted and labeled.\n\n"
    
    "2. **Tables**:\n"
    "   - Step 1: Identify the table headers and list them as column labels.\n"
    "   - Step 2: Extract each row, preserving the order and structure exactly as shown. Note any visual cues, like color coding or symbols, "
    "     to indicate significance (e.g., green for high values, yellow for moderate values).\n"
    "   - Step 3: Summarize any key metrics or summary statistics, such as CAGR or average YoY growth, and include units as applicable.\n\n"
    
    "3. **Graphs**:\n"
    "   - Step 1: Determine the graph type (e.g., line, bar) and list the axes labels (e.g., 'Mn Users', '%').\n"
    "   - Step 2: Describe key trends, such as growth or decline patterns, and highlight any major changes over time.\n"
    "   - Step 3: Identify significant data points and extract approximate (X, Y) values from each line in the graph. "
    "     Record these values systematically, capturing the trend and any inflection points or peaks.\n"
    "   - Step 4: Note any percentage growth indicators or additional annotations along the line.\n"
    "   - Step 5: If there are multiple lines with different colors, create a separate list of (X, Y) values for each line based on the color-coding in the legend.\n\n"
    
    "4. **Image Captions**:\n"
    "   - Summarize the image caption by identifying the main description and context provided. Keep the summary concise, capturing "
    "     only the essential information conveyed.\n\n"
    
    "Output each section's extracted data in a structured markdown format, with headers separating each type (e.g., '## Receipt', '## Table', "
    "'## Graph', '## Image Caption'). Use bullet points for lists, maintain tables for tabular data, and ensure content is clearly organized for easy reference. "
    "For graph data, provide a table of X and Y values, with columns labeled appropriately, such as 'Month' and 'Mn Users' for each line."
)

Sign up or log in to comment