You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the samples for 2025-05-01-preview API (#30)
* Update samples and apiversion to 2025-05-01-preview.
* Remove unnecessary properties and sample code block.
* Update variable ANALYZER_ID.
* Fix bugs and improve the readme.md.
* Fix bugs and improve the README.md.
* Remove output.
* Improve README.md
* Remove useless characters.
* Remove useless printf() and restore part of 'create analyzer'.
* Improve README.md
* Improve README.md
* Improve README.md
* Remove test person id and with "existing_person_id" to replace.
* Remove test guid and use existing_person_id to replace.
* Improve README.md on updating the usage of 'CUSTOM_ANALYZER_ID'.
* Improve README.md and notebook's description.
* Improve README.md and fix issues of `conversational_field_extraction.ipynb`
* Improve texts of README.md and management.ipynb.
* Update baseAnalyzerId.
* Remove 'chart' line from field_extraction.ipynb.
* add "segmentationMode": "noSegmentation" in market_video.json config section
---------
Co-authored-by: Changjian Wang <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+82-24Lines changed: 82 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,42 +2,71 @@
2
2
3
3
Welcome! Content Understanding is a solution that analyzes and comprehends various media content, such as **documents, images, audio, and video**, transforming it into structured, organized, and searchable data.
4
4
5
-
- The samples in this repository default to the latest preview API version: **(2024-12-01-preview)**.
6
-
7
-
## Features
8
-
9
-
Azure AI Content Understanding is a new Generative AI-based [Azure AI service](https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/overview), designed to process/ingest content of any type (documents, images, audio, and video) into a user-defined output format. Content Understanding offers a streamlined process to reason over large amounts of unstructured data, accelerating time-to-value by generating an output that can be integrated into automation and analytical workflows.
10
-
11
-
## Samples
12
-
13
-
| File | Description |
14
-
| --- | --- |
15
-
|[content_extraction.ipynb](notebooks/content_extraction.ipynb)| In this sample we will show content understanding API can help you get semantic information from your file. For example OCR with table in document, audio transcription, and face analysis in video. |
16
-
|[field_extraction.ipynb](notebooks/field_extraction.ipynb)| In this sample we will show how to create an analyzer to extract fields in your file. For example invoice amount in the document, how many people in an image, names mentioned in an audio, or summary of a video. You can customize the fields by creating your own analyzer template. |
17
-
|[conversational_field_extraction.ipynb](notebooks/conversational_field_extraction.ipynb)| This sample shows you how to evaluate conversational audio data that has previously been transcribed with Content Understanding or Azure AI Speech in in an efficient way to optimize processing quality. This also allows you to re-analyze data in a cost-efficient way. This sample is based on the [field_extraction.ipynb](notebooks/field_extraction.ipynb) sample. |
18
-
|[analyzer_training.ipynb](notebooks/analyzer_training.ipynb)| If you want to futher boost the performance for field extraction, we can do training when you provide few labeled samples to the API. Note: This feature is available to document scenario now. |
19
-
|[management.ipynb](notebooks/management.ipynb)| This sample will demo how to create a minimal analyzer, list all the analyzers in your resource, and delete the analyzer you don't need. |
20
-
|[build_person_directory.ipynb](notebooks/build_person_directory.ipynb)| This sample will demo how to enroll people’s faces from images and build a Person Directory. ||
5
+
- The samples in this repository default to the latest preview API version: **2025-05-01-preview**.
6
+
- This repo will provide more samples for new functionalities in Preview.2 **2025-05-01-preview** soon.
7
+
- As of 2025/05, 2025-05-01-preview is only available in the regions documented in [Content Understanding region and language support](https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/language-region-support).
8
+
- To access the sample code for version 2024-12-01-preview, please check out the corresponding Git tag 2024-12-01-preview, or download it directly from the [release page](https://github.com/Azure-Samples/azure-ai-content-understanding-python/releases/tag/2024-12-01-preview).
21
9
22
10
## Getting started
11
+
You can run the sample in GitHub Codespaces or in your local environment. For a smoother, hassle-free experience, we recommend starting with Codespaces.
12
+
23
13
### GitHub Codespaces
24
14
You can run this repo virtually by using GitHub Codespaces, which will open a web-based VS Code in your browser.
25
15
26
16
[](https://github.com/codespaces/new?skip_quickstart=true&machine=basicLinux32gb&repo=899687170&ref=main&geo=UsEast&devcontainer_path=.devcontainer%2Fdevcontainer.json)
27
17
18
+
Once you click the link above, please follow the steps below to set up the Codespace.
19
+
20
+
1. Create a new Codespace by selecting the main branch, your preferred region for the Codespace, and the 2-core machine type, as shown in the screenshot below. \
2. Once the Codespace is ready, open the terminal and follow the instructions in the "Configure Azure AI service resource" section to set up a valid Content Understanding resource.
- **Important:** If you use `git clone`, make sure to install Git LFS and run `git lfs pull` to download sample files in the `data` directory:
42
+
43
+
```shell
44
+
git lfs install
45
+
git lfs pull
46
+
```
47
+
3. Set Dev container Environment
48
+
- Install tools that support dev containers
49
+
- **Visual Studio Code**
50
+
Download and install [Visual Studio Code](https://code.visualstudio.com/).
51
+
52
+
- **Dev Containers Extension**
53
+
In the VS Code extension marketplace, install the extension named "Dev Containers".\
54
+
(The extension was previously called "Remote - Containers", but has since been renamed and integrated into Dev Containers.)
55
+
56
+
- **Docker**
57
+
Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) (available for Windows, macOS, and Linux).\
58
+
Docker is used to manage and run the container environment.
59
+
- Start Docker and ensure it is running in the background.
60
+
61
+
- Open the project and start the Dev Container
62
+
- Open the project folder with VS Code.
63
+
- Press `F1` or `Ctrl+Shift+P`, type and select:
64
+
```
65
+
Dev Containers: Reopen in Container
66
+
```
67
+
Or click the green icon in the lower left corner of VS Code and select "Reopen in Container".
68
+
- VS Code will automatically detect the `.devcontainer` folder, build the development container, and install the necessary dependencies.
69
+
- 
41
70
42
71
## Configure Azure AI service resource
43
72
### (Option 1) Use `azd` commands to auto create temporal resources to run sample
@@ -46,6 +75,11 @@ You can run this repo virtually by using GitHub Codespaces, which will open a we
46
75
```shell
47
76
azd auth login
48
77
```
78
+
If the previous command doesn’t work, try the following one and follow the on-screen instructions.
79
+
```
80
+
azd auth login --use-device-code
81
+
```
82
+
49
83
1. Setting up environment, following prompts to choose location
50
84
```shell
51
85
azd up
@@ -54,18 +88,42 @@ You can run this repo virtually by using GitHub Codespaces, which will open a we
54
88
55
89
### (Option 2) Manually create resources and set environment variables
56
90
1. Create [Azure AI Services resource](docs/create_azure_ai_service.md)
57
-
1. Go to `Access Control (IAM)`in resource, grant yourself role `Cognitive Services User`
91
+
2. Go to `Access Control (IAM)` in resource, grant yourself role `Cognitive Services User`
58
92
- It's necessary even you are the owner of the resource
59
-
1. Copy `notebooks/.env.sample` to `notebooks/.env`
60
-
1. Fill **AZURE_AI_ENDPOINT** with the endpoint from your Azure portal Azure AI Services instance.
61
-
1. Login Azure
93
+
3. Copy `notebooks/.env.sample` to `notebooks/.env`
94
+
4. Fill **AZURE_AI_ENDPOINT** with the endpoint from your Azure portal Azure AI Services instance.
95
+
5. Login Azure
62
96
```shell
63
97
azd auth login
64
98
```
65
99
66
100
## Open a Jupyter notebook and follow the step-by-step guidance
67
101
68
-
Navigate to the `notebooks` directory and select the sample notebook you are interested in. Since Codespaces is pre-configured with the necessary environment, you can directly execute each step in the notebook.
102
+
Navigate to the `notebooks` directory and select the sample notebook you are interested in. Since the Dev Container (in Codespaces or in your local enviornment) is pre-configured with the necessary environment, you can directly execute each step in the notebook.
103
+
104
+
1. Select one of the notebooks of interest in the notebooks/ directory. We recommend you to start with "content_extraction.ipynb" to understand the basic concepts.
Azure AI Content Understanding is a new Generative AI-based [Azure AI service](https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/overview), designed to process/ingest content of any type (documents, images, audio, and video) into a user-defined output format. Content Understanding offers a streamlined process to reason over large amounts of unstructured data, accelerating time-to-value by generating an output that can be integrated into automation and analytical workflows.
116
+
117
+
## Samples
118
+
119
+
| File | Description |
120
+
| --- | --- |
121
+
|[content_extraction.ipynb](notebooks/content_extraction.ipynb)| In this sample we will show content understanding API can help you get semantic information from your file. For example OCR with table in document, audio transcription, and face analysis in video. |
122
+
|[field_extraction.ipynb](notebooks/field_extraction.ipynb)| In this sample we will show how to create an analyzer to extract fields in your file. For example invoice amount in the document, how many people in an image, names mentioned in an audio, or summary of a video. You can customize the fields by creating your own analyzer template. |
123
+
|[conversational_field_extraction.ipynb](notebooks/conversational_field_extraction.ipynb)| This sample shows you how to evaluate conversational audio data that has previously been transcribed with Content Understanding or Azure AI Speech in in an efficient way to optimize processing quality. This also allows you to re-analyze data in a cost-efficient way. This sample is based on the [field_extraction.ipynb](notebooks/field_extraction.ipynb) sample. |
124
+
|[analyzer_training.ipynb](notebooks/analyzer_training.ipynb)| If you want to futher boost the performance for field extraction, we can do training when you provide few labeled samples to the API. Note: This feature is available to document scenario now. |
125
+
|[management.ipynb](notebooks/management.ipynb)| This sample will demo how to create a minimal analyzer, list all the analyzers in your resource, and delete the analyzer you don't need. |
126
+
|[build_person_directory.ipynb](notebooks/build_person_directory.ipynb)| This sample will demo how to enroll people’s faces from images and build a Person Directory. ||
69
127
70
128
## More Samples using Azure Content Understanding
71
129
[Azure Search with Content Understanding](https://github.com/Azure-Samples/azure-ai-search-with-content-understanding-python)
0 commit comments