diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md index c04bd5f503ad..52512a4934e8 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md +++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 5.1.0 (Unreleased) +## 5.1.0 (2021-07-08) This version of the SDK defaults to the latest supported API version, which currently is `v3.1`. Includes all changes from `5.1.0b1` to `5.1.0b7`. diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md index 365978aae10d..ae7dbe17512e 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/README.md @@ -700,7 +700,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [extract_key_phrases]: https://aka.ms/azsdk-python-textanalytics-extractkeyphrases [detect_language]: https://aka.ms/azsdk-python-textanalytics-detectlanguage [language_detection]: https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/how-tos/text-analytics-how-to-language-detection -[language_and_regional_support]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support +[language_and_regional_support]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support?tabs=language-detection [sentiment_analysis]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis [key_phrase_extraction]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-keyword-extraction [linked_entities_categories]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/named-entity-types?tabs=general diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py index 62d2833b19d5..d3faf84e3c85 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py @@ -782,7 +782,7 @@ class HealthcareEntity(DictMixin): :ivar str text: Entity text as appears in the document. :ivar str normalized_text: Optional. Normalized version of the raw `text` we extract - from the document. Not all `text`s have a normalized version. + from the document. Not all `text` will have a normalized version. :ivar str category: Entity category, see the :class:`~azure.ai.textanalytics.HealthcareEntityCategory` type for possible healthcare entity categories. :ivar str subcategory: Entity subcategory. @@ -1786,7 +1786,7 @@ def __repr__(self, **kwargs): :1024 ] - def to_generated(self): + def _to_generated(self): return _v3_1_models.EntitiesTask( parameters=_v3_1_models.EntitiesTaskParameters( model_version=self.model_version, @@ -1859,7 +1859,7 @@ def __repr__(self, **kwargs): )[:1024] ) - def to_generated(self): + def _to_generated(self): return _v3_1_models.SentimentAnalysisTask( parameters=_v3_1_models.SentimentAnalysisTaskParameters( model_version=self.model_version, @@ -1937,7 +1937,7 @@ def __repr__(self, **kwargs): )[:1024] ) - def to_generated(self): + def _to_generated(self): return _v3_1_models.PiiTask( parameters=_v3_1_models.PiiTaskParameters( model_version=self.model_version, @@ -1988,7 +1988,7 @@ def __repr__(self, **kwargs): )[:1024] ) - def to_generated(self): + def _to_generated(self): return _v3_1_models.KeyPhrasesTask( parameters=_v3_1_models.KeyPhrasesTaskParameters( model_version=self.model_version, @@ -2046,7 +2046,7 @@ def __repr__(self, **kwargs): )[:1024] ) - def to_generated(self): + def _to_generated(self): return _v3_1_models.EntityLinkingTask( parameters=_v3_1_models.EntityLinkingTaskParameters( model_version=self.model_version, diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py index e4fad9bf1677..ad5338c3cf96 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py @@ -68,9 +68,9 @@ class TextAnalyticsClient(TextAnalyticsClientBase): """The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for - tasks such as sentiment analysis, key phrase extraction, and language detection. No training data - is needed to use this API - just bring your text data. This API uses advanced natural language - processing techniques to deliver best in class predictions. + tasks such as sentiment analysis, key phrase extraction, entities recognition, + and language detection. No training data is needed to use this API - just bring your text data. + This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview @@ -340,7 +340,7 @@ def recognize_pii_entities( # type: ignore the specific PII entity categories you want to filter out. For example, if you only want to filter out U.S. social security numbers in a document, you can pass in `[PiiEntityCategory.US_SOCIAL_SECURITY_NUMBER]` for this kwarg. - :paramtype categories_filter: list[~azure.ai.textanalytics.PiiEntityCategory] + :paramtype categories_filter: list[str] or list[~azure.ai.textanalytics.PiiEntityCategory] :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 @@ -858,7 +858,7 @@ def begin_analyze_actions( # type: ignore We recommend you use this function if you're looking to analyze larger documents, and / or combine multiple Text Analytics actions into one call. Otherwise, we recommend you use - the action specific endpoints, for example :func:`analyze_sentiment`: + the action specific endpoints, for example :func:`analyze_sentiment`. :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 @@ -933,7 +933,7 @@ def begin_analyze_actions( # type: ignore try: analyze_tasks = self._client.models(api_version="v3.1").JobManifestTasks( entity_recognition_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -942,7 +942,7 @@ def begin_analyze_actions( # type: ignore ] ], entity_recognition_pii_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -951,7 +951,7 @@ def begin_analyze_actions( # type: ignore ] ], key_phrase_extraction_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -960,7 +960,7 @@ def begin_analyze_actions( # type: ignore ] ], entity_linking_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -969,7 +969,7 @@ def begin_analyze_actions( # type: ignore ] ], sentiment_analysis_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions diff --git a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py index 3874296b03bb..478c6e39f669 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py +++ b/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py @@ -62,9 +62,9 @@ class TextAnalyticsClient(AsyncTextAnalyticsClientBase): """The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for - tasks such as sentiment analysis, key phrase extraction, and language detection. No training data - is needed to use this API - just bring your text data. This API uses advanced natural language - processing techniques to deliver best in class predictions. + tasks such as sentiment analysis, key phrase extraction, entities recognition, + and language detection. No training data is needed to use this API - just bring your text data. + This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview @@ -336,7 +336,7 @@ async def recognize_pii_entities( # type: ignore the specific PII entity categories you want to filter out. For example, if you only want to filter out U.S. social security numbers in a document, you can pass in `[PiiEntityCategory.US_SOCIAL_SECURITY_NUMBER]` for this kwarg. - :paramtype categories_filter: list[~azure.ai.textanalytics.PiiEntityCategory] + :paramtype categories_filter: list[str] or list[~azure.ai.textanalytics.PiiEntityCategory] :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 @@ -868,7 +868,7 @@ async def begin_analyze_actions( # type: ignore We recommend you use this function if you're looking to analyze larger documents, and / or combine multiple Text Analytics actions into one call. Otherwise, we recommend you use - the action specific endpoints, for example :func:`analyze_sentiment`: + the action specific endpoints, for example :func:`analyze_sentiment`. :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 @@ -940,7 +940,7 @@ async def begin_analyze_actions( # type: ignore try: analyze_tasks = self._client.models(api_version="v3.1").JobManifestTasks( entity_recognition_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -949,7 +949,7 @@ async def begin_analyze_actions( # type: ignore ] ], entity_recognition_pii_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -958,7 +958,7 @@ async def begin_analyze_actions( # type: ignore ] ], key_phrase_extraction_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -967,7 +967,7 @@ async def begin_analyze_actions( # type: ignore ] ], entity_linking_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions @@ -976,7 +976,7 @@ async def begin_analyze_actions( # type: ignore ] ], sentiment_analysis_tasks=[ - t.to_generated() + t._to_generated() # pylint: disable=protected-access for t in [ a for a in actions