Skip to content

Commit 3e150a9

Browse files
committed
Update dotnet samples with GPT-4.1 outputs
1 parent a509f7d commit 3e150a9

10 files changed

Lines changed: 85 additions & 49 deletions

images/dotnet-notebook-kernel.png

15.7 KB
Loading

samples/dotnet/classification/document-classification-gpt-vision.ipynb

Lines changed: 8 additions & 4 deletions
Large diffs are not rendered by default.

samples/dotnet/classification/document-classification-text-embeddings.ipynb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"source": [
77
"# Document Classification with Azure AI Document Intelligence and Text Embeddings\n",
88
"\n",
9+
"**Before running this notebook, ensure you have selected the .NET Interactive kernel.**\n",
10+
"\n",
11+
"![Example devcontainer notebook kernel](../../../images/dotnet-notebook-kernel.png)\n",
12+
"\n",
913
"This sample demonstrates how to classify a document using Azure AI Document Intelligence and text embeddings.\n",
1014
"\n",
1115
"![Data Classification](../../../images/classification-embeddings.png)\n",
@@ -121,7 +125,7 @@
121125
},
122126
{
123127
"cell_type": "code",
124-
"execution_count": null,
128+
"execution_count": 2,
125129
"metadata": {
126130
"polyglot_notebook": {
127131
"kernelName": "csharp"
@@ -362,7 +366,7 @@
362366
},
363367
{
364368
"cell_type": "code",
365-
"execution_count": null,
369+
"execution_count": 7,
366370
"metadata": {
367371
"polyglot_notebook": {
368372
"kernelName": "csharp"
@@ -649,7 +653,7 @@
649653
{
650654
"data": {
651655
"text/html": [
652-
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ Accuracy = 100.00%, ExecutionTime = 12.44 seconds, DocumentIntelligenceExecutionTime = 7.50 seconds, ClassificationEmbeddingExecutionTime = 1.97 seconds, DocumentEmbeddingExecutionTime = 2.97 seconds, ClassificationExecutionTime = 0.01 seconds }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Accuracy</td><td><div class=\"dni-plaintext\"><pre>100.00%</pre></div></td></tr><tr><td>ExecutionTime</td><td><div class=\"dni-plaintext\"><pre>12.44 seconds</pre></div></td></tr><tr><td>DocumentIntelligenceExecutionTime</td><td><div class=\"dni-plaintext\"><pre>7.50 seconds</pre></div></td></tr><tr><td>ClassificationEmbeddingExecutionTime</td><td><div class=\"dni-plaintext\"><pre>1.97 seconds</pre></div></td></tr><tr><td>DocumentEmbeddingExecutionTime</td><td><div class=\"dni-plaintext\"><pre>2.97 seconds</pre></div></td></tr><tr><td>ClassificationExecutionTime</td><td><div class=\"dni-plaintext\"><pre>0.01 seconds</pre></div></td></tr></tbody></table></div></details><style>\r\n",
656+
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ Accuracy = 100.00%, ExecutionTime = 14.89 seconds, DocumentIntelligenceExecutionTime = 10.40 seconds, ClassificationEmbeddingExecutionTime = 1.62 seconds, DocumentEmbeddingExecutionTime = 2.86 seconds, ClassificationExecutionTime = 0.01 seconds }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Accuracy</td><td><div class=\"dni-plaintext\"><pre>100.00%</pre></div></td></tr><tr><td>ExecutionTime</td><td><div class=\"dni-plaintext\"><pre>14.89 seconds</pre></div></td></tr><tr><td>DocumentIntelligenceExecutionTime</td><td><div class=\"dni-plaintext\"><pre>10.40 seconds</pre></div></td></tr><tr><td>ClassificationEmbeddingExecutionTime</td><td><div class=\"dni-plaintext\"><pre>1.62 seconds</pre></div></td></tr><tr><td>DocumentEmbeddingExecutionTime</td><td><div class=\"dni-plaintext\"><pre>2.86 seconds</pre></div></td></tr><tr><td>ClassificationExecutionTime</td><td><div class=\"dni-plaintext\"><pre>0.01 seconds</pre></div></td></tr></tbody></table></div></details><style>\r\n",
653657
".dni-code-hint {\r\n",
654658
" font-style: italic;\r\n",
655659
" overflow: hidden;\r\n",

samples/dotnet/extraction/multimodal/document-extraction-gpt-text-and-vision.ipynb

Lines changed: 8 additions & 4 deletions
Large diffs are not rendered by default.

samples/dotnet/extraction/text/document-extraction-gpt.ipynb

Lines changed: 8 additions & 4 deletions
Large diffs are not rendered by default.

samples/dotnet/extraction/text/document-extraction-phi.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"source": [
77
"# Document Extraction with Azure AI Document Intelligence and Microsoft Phi-4 (Text Only)\n",
88
"\n",
9+
"**Before running this notebook, ensure you have selected the .NET Interactive kernel.**\n",
10+
"\n",
11+
"![Example devcontainer notebook kernel](../../../../images/dotnet-notebook-kernel.png)\n",
12+
"\n",
913
"This sample demonstrates how to extract structured data from any document using Azure AI Document Intelligence and Microsoft's Phi-4 model.\n",
1014
"\n",
1115
"![Data Extraction](../../../../images/extraction-document-intelligence-phi.png)\n",
@@ -121,7 +125,7 @@
121125
},
122126
{
123127
"cell_type": "code",
124-
"execution_count": null,
128+
"execution_count": 2,
125129
"metadata": {
126130
"polyglot_notebook": {
127131
"kernelName": "csharp"
@@ -752,7 +756,7 @@
752756
{
753757
"data": {
754758
"text/html": [
755-
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ Accuracy = 95.95%, Confidence = 52.28%, ExecutionTime = 22.21 seconds, DocumentIntelligenceExecutionTime = 6.31 seconds, PhiExecutionTime = 15.91 seconds, PromptTokens = 3328, CompletionTokens = 554 }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Accuracy</td><td><div class=\"dni-plaintext\"><pre>95.95%</pre></div></td></tr><tr><td>Confidence</td><td><div class=\"dni-plaintext\"><pre>52.28%</pre></div></td></tr><tr><td>ExecutionTime</td><td><div class=\"dni-plaintext\"><pre>22.21 seconds</pre></div></td></tr><tr><td>DocumentIntelligenceExecutionTime</td><td><div class=\"dni-plaintext\"><pre>6.31 seconds</pre></div></td></tr><tr><td>PhiExecutionTime</td><td><div class=\"dni-plaintext\"><pre>15.91 seconds</pre></div></td></tr><tr><td>PromptTokens</td><td><div class=\"dni-plaintext\"><pre>3328</pre></div></td></tr><tr><td>CompletionTokens</td><td><div class=\"dni-plaintext\"><pre>554</pre></div></td></tr></tbody></table></div></details><style>\r\n",
759+
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ Accuracy = 95.95%, Confidence = 52.28%, ExecutionTime = 34.63 seconds, DocumentIntelligenceExecutionTime = 4.72 seconds, PhiExecutionTime = 29.91 seconds, PromptTokens = 3328, CompletionTokens = 554 }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Accuracy</td><td><div class=\"dni-plaintext\"><pre>95.95%</pre></div></td></tr><tr><td>Confidence</td><td><div class=\"dni-plaintext\"><pre>52.28%</pre></div></td></tr><tr><td>ExecutionTime</td><td><div class=\"dni-plaintext\"><pre>34.63 seconds</pre></div></td></tr><tr><td>DocumentIntelligenceExecutionTime</td><td><div class=\"dni-plaintext\"><pre>4.72 seconds</pre></div></td></tr><tr><td>PhiExecutionTime</td><td><div class=\"dni-plaintext\"><pre>29.91 seconds</pre></div></td></tr><tr><td>PromptTokens</td><td><div class=\"dni-plaintext\"><pre>3328</pre></div></td></tr><tr><td>CompletionTokens</td><td><div class=\"dni-plaintext\"><pre>554</pre></div></td></tr></tbody></table></div></details><style>\r\n",
756760
".dni-code-hint {\r\n",
757761
" font-style: italic;\r\n",
758762
" overflow: hidden;\r\n",

samples/dotnet/extraction/vision/document-extraction-gpt-vision.ipynb

Lines changed: 8 additions & 4 deletions
Large diffs are not rendered by default.

samples/dotnet/redaction/document-redaction-gpt.ipynb

Lines changed: 15 additions & 11 deletions
Large diffs are not rendered by default.

samples/dotnet/redaction/document-redaction-language-native-document.ipynb

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"source": [
77
"# Document Redaction with Azure AI Language PII Native Document Analysis\n",
88
"\n",
9+
"**Before running this notebook, ensure you have selected the .NET Interactive kernel.**\n",
10+
"\n",
11+
"![Example devcontainer notebook kernel](../../../images/dotnet-notebook-kernel.png)\n",
12+
"\n",
913
"This sample demonstrates how to use the Azure AI Language service to redact any Personally Identifiable Information (PII) from a provided PDF document using the preview **Native Document Support** features. You can find more information on these new capabilities in [our documentation for analyzing native documents](https://learn.microsoft.com/en-us/azure/ai-services/language-service/native-document-support/use-native-documents?tabs=pii).\n",
1014
"\n",
1115
"> **IMPORTANT**: This feature only supports documents that are digitized (i.e. non-scanned documents) in `.txt`, `.docx`, or `.pdf` format. If you are working with scanned documents, explore the [document redaction with Azure OpenAI sample](./document-redaction-gpt.ipynb).\n",
@@ -66,7 +70,7 @@
6670
},
6771
{
6872
"cell_type": "code",
69-
"execution_count": 52,
73+
"execution_count": 1,
7074
"metadata": {
7175
"polyglot_notebook": {
7276
"kernelName": "csharp"
@@ -137,7 +141,7 @@
137141
},
138142
{
139143
"cell_type": "code",
140-
"execution_count": null,
144+
"execution_count": 2,
141145
"metadata": {
142146
"polyglot_notebook": {
143147
"kernelName": "csharp"
@@ -193,7 +197,7 @@
193197
},
194198
{
195199
"cell_type": "code",
196-
"execution_count": 54,
200+
"execution_count": 3,
197201
"metadata": {
198202
"polyglot_notebook": {
199203
"kernelName": "csharp"
@@ -216,7 +220,7 @@
216220
},
217221
{
218222
"cell_type": "code",
219-
"execution_count": 55,
223+
"execution_count": 4,
220224
"metadata": {
221225
"polyglot_notebook": {
222226
"kernelName": "csharp"
@@ -297,7 +301,7 @@
297301
},
298302
{
299303
"cell_type": "code",
300-
"execution_count": 56,
304+
"execution_count": 5,
301305
"metadata": {
302306
"polyglot_notebook": {
303307
"kernelName": "csharp"
@@ -354,7 +358,7 @@
354358
},
355359
{
356360
"cell_type": "code",
357-
"execution_count": 57,
361+
"execution_count": 6,
358362
"metadata": {
359363
"polyglot_notebook": {
360364
"kernelName": "csharp"
@@ -370,7 +374,7 @@
370374
},
371375
{
372376
"cell_type": "code",
373-
"execution_count": 58,
377+
"execution_count": 7,
374378
"metadata": {
375379
"polyglot_notebook": {
376380
"kernelName": "csharp"
@@ -383,7 +387,7 @@
383387
{
384388
"data": {
385389
"text/html": [
386-
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ ExecutionTime = 16.52 seconds }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ExecutionTime</td><td><div class=\"dni-plaintext\"><pre>16.52 seconds</pre></div></td></tr></tbody></table></div></details><style>\r\n",
390+
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>{ ExecutionTime = 14.60 seconds }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ExecutionTime</td><td><div class=\"dni-plaintext\"><pre>14.60 seconds</pre></div></td></tr></tbody></table></div></details><style>\r\n",
387391
".dni-code-hint {\r\n",
388392
" font-style: italic;\r\n",
389393
" overflow: hidden;\r\n",
@@ -433,7 +437,7 @@
433437
},
434438
{
435439
"cell_type": "code",
436-
"execution_count": 59,
440+
"execution_count": 8,
437441
"metadata": {
438442
"polyglot_notebook": {
439443
"kernelName": "csharp"
@@ -459,7 +463,7 @@
459463
},
460464
{
461465
"cell_type": "code",
462-
"execution_count": null,
466+
"execution_count": 9,
463467
"metadata": {
464468
"polyglot_notebook": {
465469
"kernelName": "csharp"

samples/dotnet/scenarios/invoices/invoice-extraction.ipynb

Lines changed: 11 additions & 7 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)