Skip to content

Commit fb251ac

Browse files
Add template for showing the use of estimateFieldSourceAndConfidence (#33)
1 parent 50b3814 commit fb251ac

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"description": "Sample invoice analyzer",
3+
"baseAnalyzerId": "prebuilt-documentAnalyzer",
4+
"config": {
5+
"returnDetails": true,
6+
"estimateFieldSourceAndConfidence": true
7+
},
8+
"fieldSchema": {
9+
"fields": {
10+
"VendorName": {
11+
"type": "string",
12+
"method": "extract",
13+
"description": "Vendor issuing the invoice"
14+
},
15+
"Items": {
16+
"type": "array",
17+
"method": "extract",
18+
"items": {
19+
"type": "object",
20+
"properties": {
21+
"Description": {
22+
"type": "string",
23+
"method": "extract",
24+
"description": "Description of the item"
25+
},
26+
"Amount": {
27+
"type": "number",
28+
"method": "extract",
29+
"description": "Amount of the item"
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
}

notebooks/field_extraction.ipynb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,20 @@
5555
"outputs": [],
5656
"source": [
5757
"extraction_templates = {\n",
58-
" \"invoice\": ('../analyzer_templates/invoice.json', '../data/invoice.pdf' ),\n",
59-
" \"call_recording\": ('../analyzer_templates/call_recording_analytics.json', '../data/callCenterRecording.mp3'),\n",
58+
" # Extract fields from invoices (no grounding sources or confidence scores).\n",
59+
" \"invoice\": ('../analyzer_templates/invoice.json', '../data/invoice.pdf'),\n",
60+
"\n",
61+
" # Extract fields from invoices, including grounding sources and confidence scores (optional add-on).\n",
62+
" \"invoice_field_source\": ('../analyzer_templates/invoice_field_source.json', '../data/invoice.pdf'),\n",
63+
"\n",
64+
" # Extract insights from call recordings (e.g., summary, topics, mentioned companies, and people).\n",
65+
" \"call_recording\": ('../analyzer_templates/call_recording_analytics.json', '../data/callCenterRecording.mp3'),\n",
66+
"\n",
67+
" # Extract summary and sentiment from conversation audio (e.g., customer service calls).\n",
6068
" \"conversation_audio\": ('../analyzer_templates/conversational_audio_analytics.json', '../data/callCenterRecording.mp3'),\n",
61-
" \"marketing_video\": ('../analyzer_templates/marketing_video.json', '../data/FlightSimulator.mp4' )\n",
69+
"\n",
70+
" # Extract descriptions and sentiment analysis from marketing videos.\n",
71+
" \"marketing_video\": ('../analyzer_templates/marketing_video.json', '../data/FlightSimulator.mp4'),\n",
6272
"}"
6373
]
6474
},

0 commit comments

Comments
 (0)