Skip to content

Commit ac8de45

Browse files
revise instruction of setting env for knowledge source data
1 parent daf5222 commit ac8de45

6 files changed

+36
-26
lines changed

docs/choose-signature-options.png

Lines changed: 2 additions & 2 deletions
Loading

docs/get-access-signature.png

Lines changed: 2 additions & 2 deletions
Loading

docs/set_env_for_labeled_data.md

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Set env variables for training data and reference doc for Pro mode
2+
Folders [document_training](../data/document_training/) and [field_extraction_pro_mode](../data/field_extraction_pro_mode) contain the manually labeled data for training and reference doc for Pro mode as a quick sample. Before using these knowledge source files, you need an Azure Storage blob container to store them. Let's follow below steps to prepare the data environment:
3+
4+
1. *Create an Azure Storage Account:* If you don’t already have one, follow the guide to [create an Azure Storage Account](https://aka.ms/create-a-storage-account).
5+
> If you already have an account, you can skip this step.
6+
2. *Install Azure Storage Explorer:* Azure Storage Explorer is a tool which makes it easy to work with Azure Storage data. Install it and login with your credential, follow the [guide](https://aka.ms/download-and-install-Azure-Storage-Explorer).
7+
3. *Create or Choose a Blob Container:* Create a blob container from Azure Storage Explorer or use an existing one.
8+
<img src="./create-blob-container.png" width="600" />
9+
4. *Generate a Shared Access Signature (SAS) URL:*
10+
- Right-click on blob container and select the `Get Shared Access Signature...` in the menu.
11+
- Check the required permissions: `Read`, `Write` and `List`
12+
- Click the `Create` button.
13+
<img src="./get-access-signature.png" height="600" /> <img src="./choose-signature-options.png" height="600" />
14+
5. *Copy the SAS URL:* After creating the SAS, click `Copy` to get the URL with token. This will be used as the value for **TRAINING_DATA_SAS_URL** or **REFERENCE_DOC_SAS_URL** when running the sample code.
15+
<img src="./copy-access-signature.png" width="600" />
16+
6. *Set Environment Variables in `.env` File:* Add the SAS URL as value of **TRAINING_DATA_SAS_URL** and/or **REFERENCE_DOC_SAS_URL** and designated folder path as value of **TRAINING_DATA_PATH** or **REFERENCE_DOC_PATH** into the `.env` file.
17+
18+
```env
19+
TRAINING_DATA_SAS_URL=<Blob container SAS URL>
20+
TRAINING_DATA_PATH=<Designated folder path under the blob container>
21+
REFERENCE_DOC_SAS_URL=<Blob container SAS URL>
22+
REFERENCE_DOC_PATH=<Designated folder path under the blob container>
23+
```
24+
25+
Now, we have completed the preparation of the data environment. Next, we could create an analyzer through code.
26+
27+

notebooks/analyzer_training.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"\n",
2424
"## Prerequisites\n",
2525
"1. Ensure Azure AI service is configured following [steps](../README.md#configure-azure-ai-service-resource)\n",
26-
"1. Follow steps in [Set labeled data](../docs/set_env_for_labeled_data.md) to add training data related env variables in `.env`.\n",
26+
"1. Follow steps in [Set env for trainging data](../docs/set_env_for_training_data_and_reference_doc.md) to add training data related env variables `TRAINING_DATA_SAS_URL` and `TRAINING_DATA_PATH` into the `.env` file.\n",
27+
" - `TRAINING_DATA_SAS_URL`: SAS URL for your Azure Blob container. \n",
28+
" - `TRAINING_DATA_PATH`: Folder path within the container to upload training data. \n",
2729
"1. Install packages needed to run the sample\n",
2830
"\n",
2931
"\n"

notebooks/field_extraction_pro_mode.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
"source": [
2929
"## Prerequisites\n",
3030
"1. Ensure Azure AI service is configured following [steps](../README.md#configure-azure-ai-service-resource)\n",
31-
"1. If using reference documents, please set up `REFERENCE_DOC_SAS_URL` and `REFERENCE_DOC_PATH` in `.env` file. You can refer to similar steps in [Set labeled data](../docs/set_env_for_labeled_data.md).\n",
31+
"1. If using reference documents, please follow [Set env for reference doc](../docs/set_env_for_training_data_and_reference_doc.md) to set up `REFERENCE_DOC_SAS_URL` and `REFERENCE_DOC_PATH` in the `.env` file.\n",
3232
" - `REFERENCE_DOC_SAS_URL`: SAS URL for your Azure Blob container. \n",
33-
" - `REFERENCE_DOC_PATH`: Folder path within the container for reference docs. \n",
33+
" - `REFERENCE_DOC_PATH`: Folder path within the container for uploading reference docs. \n",
3434
"1. Install the required packages to run the sample."
3535
]
3636
},

0 commit comments

Comments
 (0)