Skip to content

Commit 5752956

Browse files
authored
Update audio templates (#14)
* Updating the audio templates and aligning them with our key scenarions in AI Studio. * Updated content_extraction to reflect our hero scenario for callcenter analytics which also contains the most output results from content understanding to ensure best presentation of our audio processing capability.
1 parent e4a3633 commit 5752956

5 files changed

+113
-83
lines changed

analyzer_templates/audio_transcript.json renamed to analyzer_templates/audio_transcription.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scenario": "conversation",
3-
"description": "Sample audio transcript analyzer",
3+
"description": "Sample audio transcription",
44
"config": {
55
"returnDetails": true,
66
"locales": ["en-US"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"description": "Sample call recording analytics",
3+
"scenario": "callCenter",
4+
"config": {
5+
"returnDetails": true,
6+
"locales": ["en-US"]
7+
},
8+
"fieldSchema": {
9+
"fields": {
10+
"Summary": {
11+
"type": "string",
12+
"method": "generate",
13+
"description": "A one-paragraph summary"
14+
},
15+
"Topics": {
16+
"type": "array",
17+
"method": "generate",
18+
"description": "Top 5 topics mentioned",
19+
"items": {
20+
"type": "string"
21+
}
22+
},
23+
"Companies": {
24+
"type": "array",
25+
"method": "generate",
26+
"description": "List of companies mentioned",
27+
"items": {
28+
"type": "string"
29+
}
30+
},
31+
"People": {
32+
"type": "array",
33+
"method": "generate",
34+
"description": "List of people mentioned",
35+
"items": {
36+
"type": "object",
37+
"properties": {
38+
"Name": {
39+
"type": "string",
40+
"description": "Person's name"
41+
},
42+
"Role": {
43+
"type": "string",
44+
"description": "Person's title/role"
45+
}
46+
}
47+
}
48+
},
49+
"Sentiment": {
50+
"type": "string",
51+
"method": "classify",
52+
"description": "Overall sentiment",
53+
"enum": [
54+
"Positive",
55+
"Neutral",
56+
"Negative"
57+
]
58+
},
59+
"Categories": {
60+
"type": "array",
61+
"method": "classify",
62+
"description": "List of relevant categories",
63+
"items": {
64+
"type": "string",
65+
"enum": [
66+
"Agriculture",
67+
"Business",
68+
"Finance",
69+
"Health",
70+
"Insurance",
71+
"Mining",
72+
"Pharmaceutical",
73+
"Retail",
74+
"Technology",
75+
"Transportation"
76+
]
77+
}
78+
}
79+
}
80+
}
81+
}

analyzer_templates/call_transcript.json

-32
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"scenario": "conversation",
3+
"description": "Sample conversational audio analytics",
4+
"config": {
5+
"returnDetails": true,
6+
"locales": ["en-US"]
7+
},
8+
"fieldSchema": {
9+
"fields": {
10+
"Summary": {
11+
"type": "string",
12+
"method": "generate",
13+
"description": "A one-paragraph summary"
14+
},
15+
"Sentiment": {
16+
"type": "string",
17+
"method": "classify",
18+
"description": "Overall sentiment",
19+
"enum": [
20+
"Positive",
21+
"Neutral",
22+
"Negative"
23+
]
24+
}
25+
}
26+
}
27+
}

notebooks/content_extraction.ipynb

+4-50
Original file line numberDiff line numberDiff line change
@@ -92,53 +92,7 @@
9292
"cell_type": "code",
9393
"execution_count": null,
9494
"metadata": {},
95-
"outputs": [
96-
{
97-
"name": "stderr",
98-
"output_type": "stream",
99-
"text": [
100-
"INFO:python.content_understanding_client:Analyzer content-doc-sample-f79b4605-4990-4788-ba6a-47d55d244212 create request accepted.\n",
101-
"INFO:python.content_understanding_client:Request result is ready after 0.00 seconds.\n",
102-
"INFO:python.content_understanding_client:Analyzing file ../data/purchase_order.jpg with analyzer: content-doc-sample-f79b4605-4990-4788-ba6a-47d55d244212\n",
103-
"INFO:python.content_understanding_client:Request 6c1f5fea-8f2e-423b-afbe-cd35872379f6 in progress ...\n",
104-
"INFO:python.content_understanding_client:Request 6c1f5fea-8f2e-423b-afbe-cd35872379f6 in progress ...\n",
105-
"INFO:python.content_understanding_client:Request result is ready after 4.56 seconds.\n"
106-
]
107-
},
108-
{
109-
"name": "stdout",
110-
"output_type": "stream",
111-
"text": [
112-
"{\n",
113-
" \"id\": \"6c1f5fea-8f2e-423b-afbe-cd35872379f6\",\n",
114-
" \"status\": \"Succeeded\",\n",
115-
" \"result\": {\n",
116-
" \"analyzerId\": \"content-doc-sample-f79b4605-4990-4788-ba6a-47d55d244212\",\n",
117-
" \"apiVersion\": \"2024-12-01-preview\",\n",
118-
" \"createdAt\": \"2024-12-10T23:29:52Z\",\n",
119-
" \"warnings\": [],\n",
120-
" \"contents\": [\n",
121-
" {\n",
122-
" \"markdown\": \"Purchase Order\\n\\n\\n# Hero Limited\\n\\nCompany Phone: 555-348-6512\\nWebsite: www.herolimited.com\\nEmail:\\[email protected]\\n\\nPurchase Order\\n\\nDated As: 12/20/2020\\nPurchase Order #: 948284\\n\\nShipped To\\n\\nVendor Name: Hillary Swank\\nCompany Name: Higgly Wiggly Books\\nAddress: 938 NE Burner Road\\nBoulder City, CO 92848\\nPhone: 938-294-2949\\n\\nShipped From\\n\\nName: Bernie Sanders\\nCompany Name: Jupiter Book Supply\\nAddress: 383 N Kinnick Road\\nSeattle, WA 38383\\n\\nPhone: 932-299-0292\\n\\n\\n<table>\\n<tr>\\n<th>Details</th>\\n<th>Quantity</th>\\n<th>Unit Price</th>\\n<th>Total</th>\\n</tr>\\n<tr>\\n<td>Bindings</td>\\n<td>20</td>\\n<td>1.00</td>\\n<td>20.00</td>\\n</tr>\\n<tr>\\n<td>Covers Small</td>\\n<td>20</td>\\n<td>1.00</td>\\n<td>20.00</td>\\n</tr>\\n<tr>\\n<td>Feather Bookmark</td>\\n<td>20</td>\\n<td>5.00</td>\\n<td>100.00</td>\\n</tr>\\n<tr>\\n<td>Copper Swirl Marker</td>\\n<td>20</td>\\n<td>5.00</td>\\n<td>100.00</td>\\n</tr>\\n</table>\\n\\n\\n<table>\\n<tr>\\n<td>SUBTOTAL</td>\\n<td>$140.00</td>\\n</tr>\\n<tr>\\n<td>TAX</td>\\n<td>$4.00</td>\\n</tr>\\n<tr>\\n<td>TOTAL</td>\\n<td>$144.00</td>\\n</tr>\\n</table>\\n\\n\\nBernie Sanders\\n\\nBernie Sanders\\nManager\\n\\nAdditional Notes:\\n\\nDo not Jostle Box. Unpack carefully. Enjoy.\\n\\nJupiter Book Supply will refund you 50% per book if returned within 60 days of reading and\\n\\noffer you 25% off you next total purchase.\\n\",\n",
123-
" \"kind\": \"document\",\n",
124-
" \"startPageNumber\": 1,\n",
125-
" \"endPageNumber\": 1,\n",
126-
" \"unit\": \"pixel\",\n",
127-
" \"pages\": [\n",
128-
" {\n",
129-
" \"pageNumber\": 1,\n",
130-
" \"angle\": 0.05652412,\n",
131-
" \"width\": 1700,\n",
132-
" \"height\": 2200\n",
133-
" }\n",
134-
" ]\n",
135-
" }\n",
136-
" ]\n",
137-
" }\n",
138-
"}\n"
139-
]
140-
}
141-
],
95+
"outputs": [],
14296
"source": [
14397
"ANALYZER_ID = \"content-doc-sample-\" + str(uuid.uuid4())\n",
14498
"ANALYZER_TEMPLATE_FILE = '../analyzer_templates/content_document.json'\n",
@@ -181,8 +135,8 @@
181135
"outputs": [],
182136
"source": [
183137
"ANALYZER_ID = \"content-audio-sample-\" + str(uuid.uuid4())\n",
184-
"ANALYZER_TEMPLATE_FILE = '../analyzer_templates/audio_transcript.json'\n",
185-
"ANALYZER_SAMPLE_FILE = '../data/audio.wav'\n",
138+
"ANALYZER_TEMPLATE_FILE = '../analyzer_templates/call_recording_analytics.json'\n",
139+
"ANALYZER_SAMPLE_FILE = '../data/callCenterRecording.mp3'\n",
186140
"\n",
187141
"# Create analyzer\n",
188142
"response = client.begin_create_analyzer(ANALYZER_ID, analyzer_template_path=ANALYZER_TEMPLATE_FILE)\n",
@@ -343,7 +297,7 @@
343297
"name": "python",
344298
"nbconvert_exporter": "python",
345299
"pygments_lexer": "ipython3",
346-
"version": "3.11.11"
300+
"version": "3.11.10"
347301
}
348302
},
349303
"nbformat": 4,

0 commit comments

Comments
 (0)