Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[textanalytics] update readme + docs #21272

Merged
merged 4 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions sdk/textanalytics/azure-ai-textanalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Text Analytics is a cloud-based service that provides advanced natural language processing over raw text, and includes the following main features:

- Sentiment Analysis
- Named Entity Recognition
- Linked Entity Recognition
- Personally Identifiable Information (PII) Entity Recognition
- Entity Recognition (Named, Linked, and Personally Identifiable Information (PII) entities)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section is getting too long, tried to consolidate

- Language Detection
- Key Phrase Extraction
- Multiple Analysis
- Healthcare Entities Analysis
- Extractive Text Summarization
- Custom Entity Recognition
- Custom Single and Multi Category Classification

[Source code][source_code] | [Package (PyPI)][ta_pypi] | [API reference documentation][ta_ref_docs] | [Product documentation][ta_product_documentation] | [Samples][ta_samples]

Expand Down Expand Up @@ -79,13 +79,13 @@ Install the Azure Text Analytics client library for Python with [pip][pip]:
pip install azure-ai-textanalytics --pre
```

> Note: This version of the client library defaults to the v3.2-preview.1 version of the service
> Note: This version of the client library defaults to the v3.2-preview.2 version of the service

This table shows the relationship between SDK versions and supported API versions of the service

| SDK version | Supported API version of service |
| ------------ | --------------------------------- |
| 5.2.0b1 - Latest beta release | 3.0, 3.1, 3.2-preview.2 (default) |
| 5.2.0b2 - Latest beta release | 3.0, 3.1, 3.2-preview.2 (default) |
| 5.1.0 - Latest GA release | 3.0, 3.1 (default) |
| 5.0.0 | 3.0 |

Expand Down Expand Up @@ -233,6 +233,10 @@ The following section provides several code snippets covering some of the most c
- [Detect Language](#detect-language "Detect language")
- [Healthcare Entities Analysis](#healthcare-entities-analysis "Healthcare Entities Analysis")
- [Multiple Analysis](#multiple-analysis "Multiple analysis")
- [Extractive Summarization][extract_summary_sample]
- [Custom Entity Recognition][recognize_custom_entities_sample]
- [Custom Single Category Classification][single_category_classify_sample]
- [Custom Multi Category Classification][multi_category_classify_sample]

### Analyze sentiment

Expand Down Expand Up @@ -510,6 +514,9 @@ Note: The Healthcare Entities Analysis service is available in API version v3.1
- Key Phrase Extraction
- Sentiment Analysis
- Extractive Summarization (see sample [here][extract_summary_sample])
- Custom Entity Recognition (see sample [here][recognize_custom_entities_sample])
- Custom Single Category Classification (see sample [here][single_category_classify_sample])
- Custom Multi Category Classification (see sample [here][multi_category_classify_sample])

```python
from azure.core.credentials import AzureKeyCredential
Expand Down Expand Up @@ -645,6 +652,9 @@ Common scenarios
- Healthcare Entities Analysis: [sample_analyze_healthcare_entities.py][analyze_healthcare_entities_sample] ([async version][analyze_healthcare_entities_sample_async])
- Multiple Analysis: [sample_analyze_actions.py][analyze_sample] ([async version][analyze_sample_async])
- Extractive text summarization: [sample_extract_summary.py][extract_summary_sample] ([async version][extract_summary_sample_async])
- Custom Entity Recognition: [sample_recognize_custom_entities.py][recognize_custom_entities_sample] ([async_version][recognize_custom_entities_sample_async])
- Custom Single Classification: [sample_single_category_classify.py][single_category_classify_sample] ([async_version][single_category_classify_sample_async])
- Custom Multi Classification: [sample_multi_category_classify.py][multi_category_classify_sample] ([async_version][multi_category_classify_sample_async])

Advanced scenarios

Expand Down Expand Up @@ -742,6 +752,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[opinion_mining_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_sentiment_with_opinion_mining_async.py
[extract_summary_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_extract_summary.py
[extract_summary_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_extract_summary_async.py
[recognize_custom_entities_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_custom_entities.py
[recognize_custom_entities_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_custom_entities_async.py
[single_category_classify_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_single_category_classify.py
[single_category_classify_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_single_category_classify_async.py
[multi_category_classify_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_multi_category_classify.py
[multi_category_classify_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_multi_category_classify_async.py
[cla]: https://cla.microsoft.com
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2094,8 +2094,9 @@ def _to_generated(self, api_version, task_id):


class ExtractSummaryAction(DictMixin):
"""ExtractSummaryAction encapsulates the parameters for starting a long-running Extractive
Text Summarization operation.
"""ExtractSummaryAction encapsulates the parameters for starting a long-running Extractive Text
Summarization operation. For a conceptual discussion of extractive summarization, see the service documentation:
https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/extractive-summarization

:keyword str model_version: The model version to use for the analysis.
:keyword str string_index_type: Specifies the method used to interpret string offsets.
Expand Down Expand Up @@ -2256,12 +2257,11 @@ def _from_generated(cls, sentence):


class RecognizeCustomEntitiesAction(DictMixin):
"""RecognizeCustomEntitiesAction.
"""RecognizeCustomEntitiesAction encapsulates the parameters for starting a long-running custom entity
recognition operation. To train a model to recognize your custom entities, see TODO

:param project_name: Required. This field indicates the project name for the model.
:type project_name: str
:param deployment_name: This field indicates the deployment name for the model.
:type deployment_name: str
:param str project_name: Required. This field indicates the project name for the model.
:param str deployment_name: This field indicates the deployment name for the model.
:keyword str string_index_type: Specifies the method used to interpret string offsets.
`UnicodeCodePoint`, the Python encoding, is the default. To override the Python default,
you can also pass in `Utf16CodePoint` or TextElement_v8`. For additional information
Expand Down Expand Up @@ -2380,12 +2380,11 @@ def _from_generated(cls, result):


class MultiCategoryClassifyAction(DictMixin):
"""MultiCategoryClassifyAction.
"""MultiCategoryClassifyAction encapsulates the parameters for starting a long-running custom multi category
classification operation. To train a model to classify your documents, see TODO

:param project_name: Required. This field indicates the project name for the model.
:type project_name: str
:param deployment_name: This field indicates the deployment name for the model.
:type deployment_name: str
:param str project_name: Required. This field indicates the project name for the model.
:param str deployment_name: Required. This field indicates the deployment name for the model.
:keyword bool disable_service_logs: If set to true, you opt-out of having your text input
logged on the service side for troubleshooting. By default, Text Analytics logs your
input text for 48 hours, solely to allow for troubleshooting issues in providing you with
Expand Down Expand Up @@ -2436,10 +2435,11 @@ def _to_generated(self, api_version, task_id): # pylint: disable=unused-argumen


class MultiCategoryClassifyResult(DictMixin):
"""MultiCategoryClassifyResult.
"""MultiCategoryClassifyResult is a result object which contains
the classifications for a particular document.

:ivar str id: Required. Unique, non-empty document identifier.
:ivar classifications: Required. Recognized classification results in the document.
:ivar str id: Unique, non-empty document identifier.
:ivar classifications: Recognized classification results in the document.
:vartype classifications: list[~azure.ai.textanalytics.ClassificationCategory]
:ivar warnings: Warnings encountered while processing document.
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
Expand Down Expand Up @@ -2493,12 +2493,11 @@ def _from_generated(cls, result):


class SingleCategoryClassifyAction(DictMixin):
"""SingleCategoryClassifyAction.
"""SingleCategoryClassifyAction encapsulates the parameters for starting a long-running custom single category
classification operation. To train a model to classify your documents, see TODO

:param project_name: Required. This field indicates the project name for the model.
:type project_name: str
:param deployment_name: This field indicates the deployment name for the model.
:type deployment_name: str
:param str project_name: Required. This field indicates the project name for the model.
:param str deployment_name: Required. This field indicates the deployment name for the model.
:keyword bool disable_service_logs: If set to true, you opt-out of having your text input
logged on the service side for troubleshooting. By default, Text Analytics logs your
input text for 48 hours, solely to allow for troubleshooting issues in providing you with
Expand Down Expand Up @@ -2549,10 +2548,11 @@ def _to_generated(self, api_version, task_id): # pylint: disable=unused-argumen


class SingleCategoryClassifyResult(DictMixin):
"""SingleCategoryClassifyResult.
"""SingleCategoryClassifyResult is a result object which contains
the classification for a particular document.

:ivar str id: Required. Unique, non-empty document identifier.
:ivar classification: Required. Recognized classification results in the document.
:ivar str id: Unique, non-empty document identifier.
:ivar classification: Recognized classification results in the document.
:vartype classification: ~azure.ai.textanalytics.ClassificationCategory
:ivar warnings: Warnings encountered while processing document.
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
Expand Down Expand Up @@ -2604,9 +2604,9 @@ def _from_generated(cls, result):


class ClassificationCategory(DictMixin):
"""ClassificationCategory.
"""ClassificationCategory represents a classification of the input document.

:ivar str category: Required. Classification type.
:ivar str category: Classification type.
:ivar float confidence_score: Confidence score between 0 and 1 of the recognized classification.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ def begin_analyze_actions( # type: ignore
combine multiple Text Analytics actions into one call. Otherwise, we recommend you use
the action specific endpoints, for example :func:`analyze_sentiment`.

.. note:: The following actions are supported with resources created in the `westus2` and `westeurope`
regions only: RecognizeCustomEntitiesAction, SingleCategoryClassifyAction, and MultiCategoryClassifyAction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps create an issue to remove this language once the feature is widely available and inline a link to it here as a TODO?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know when the features will be available in all regions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose once it GAs. @kayousef to confirm.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deyaaeldeen Yes, confirmed. This is planned for Wave2


:param documents: The set of documents to process as part of this batch.
If you wish to specify the ID and language on a per-item basis you must
use as input a list[:class:`~azure.ai.textanalytics.TextDocumentInput`] or a list of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,9 @@ async def begin_analyze_actions( # type: ignore
combine multiple Text Analytics actions into one call. Otherwise, we recommend you use
the action specific endpoints, for example :func:`analyze_sentiment`.

.. note:: The following actions are supported with resources created in the `westus2` and `westeurope`
regions only: RecognizeCustomEntitiesAction, SingleCategoryClassifyAction, and MultiCategoryClassifyAction

:param documents: The set of documents to process as part of this batch.
If you wish to specify the ID and language on a per-item basis you must
use as input a list[:class:`~azure.ai.textanalytics.TextDocumentInput`] or a list of
Expand Down