Skip to content

Commit

Permalink
[text analytics] Fix some issues i've found (#19081)
Browse files Browse the repository at this point in the history
iscai-msft authored Jun 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent cddf384 commit 0282a23
Showing 24 changed files with 445 additions and 362 deletions.
3 changes: 3 additions & 0 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,9 @@
- Renamed `AnalyzeBatchActionsType` to `AnalyzeActionsType`.
- Renamed `AnalyzeBatchActionsResult` to `AnalyzeActionsResult`.
- Renamed `AnalyzeBatchActionsError` to `AnalyzeActionsError`.
- Renamed `AnalyzeHealthcareEntitiesResultItem` to `AnalyzeHealthcareEntitiesResult`.
- Fixed `AnalyzeHealthcareEntitiesResult`'s `statistics` to be the correct type, `TextDocumentStatistics`
- Remove `RequestStatistics`, use `TextDocumentBatchStatistics` instead

**New Features**
- Added enums `EntityConditionality`, `EntityCertainty`, and `EntityAssociation`.
Original file line number Diff line number Diff line change
@@ -32,15 +32,14 @@
RecognizePiiEntitiesResult,
PiiEntity,
PiiEntityDomainType,
AnalyzeHealthcareEntitiesResultItem,
AnalyzeHealthcareEntitiesResult,
HealthcareEntity,
HealthcareEntityDataSource,
RecognizeEntitiesAction,
RecognizeLinkedEntitiesAction,
RecognizePiiEntitiesAction,
ExtractKeyPhrasesAction,
AnalyzeActionsResult,
RequestStatistics,
AnalyzeActionsType,
AnalyzeActionsError,
HealthcareEntityRelationRoleType,
@@ -49,14 +48,14 @@
HealthcareEntityAssertion,
AnalyzeSentimentAction
)
from ._paging import AnalyzeHealthcareEntitiesResult
from ._generated.v3_1_preview_5.models import (
PiiCategory as PiiEntityCategoryType,
RelationType as HealthcareEntityRelationType,
Conditionality as EntityConditionality,
Certainty as EntityCertainty,
Association as EntityAssociation
)
from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller

__all__ = [
'TextAnalyticsApiVersion',
@@ -85,7 +84,6 @@
'RecognizePiiEntitiesResult',
'PiiEntity',
'PiiEntityDomainType',
'AnalyzeHealthcareEntitiesResultItem',
'AnalyzeHealthcareEntitiesResult',
'HealthcareEntity',
'HealthcareEntityDataSource',
@@ -94,7 +92,6 @@
'RecognizePiiEntitiesAction',
'ExtractKeyPhrasesAction',
'AnalyzeActionsResult',
'RequestStatistics',
'AnalyzeActionsType',
"AnalyzeActionsError",
"PiiEntityCategoryType",
@@ -106,7 +103,9 @@
"EntityConditionality",
"EntityCertainty",
"EntityAssociation",
"AnalyzeSentimentAction"
"AnalyzeSentimentAction",
"AnalyzeHealthcareEntitiesLROPoller",
"AnalyzeActionsLROPoller",
]

__version__ = VERSION

This file was deleted.

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
import warnings

# FIXME: have to manually reconfigure import path for multiapi operation mixin
from .._lro import AnalyzeBatchActionsLROPoller, AnalyzeBatchActionsLROPollingMethod, AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
from .._lro import AnalyzeActionsLROPoller, AnalyzeActionsLROPollingMethod, AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
@@ -84,12 +84,12 @@ def begin_analyze(
:type body: ~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeBatchInput
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AnalyzeBatchActionsLROPollingMethod.
:keyword polling: By default, your polling method will be AnalyzeActionsLROPollingMethod.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~...._lro.AnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:return: An instance of AnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:raises ~azure.core.exceptions.HttpResponseError:
"""
api_version = self._get_api_version('begin_analyze')
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
import warnings

# FIXME: have to manually reconfigure import path for multiapi operation mixin
from ..._async_lro import AnalyzeHealthcareEntitiesAsyncLROPoller, AnalyzeHealthcareEntitiesAsyncLROPollingMethod, AsyncAnalyzeBatchActionsLROPoller, AsyncAnalyzeBatchActionsLROPollingMethod
from ...aio._lro_async import AsyncAnalyzeHealthcareEntitiesLROPoller, AsyncAnalyzeHealthcareEntitiesLROPollingMethod, AsyncAnalyzeActionsLROPoller, AsyncAnalyzeActionsLROPollingMethod
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
@@ -70,7 +70,7 @@ async def begin_analyze(
self,
body: Optional["_models.AnalyzeBatchInput"] = None,
**kwargs
) -> AsyncAnalyzeBatchActionsLROPoller["_models.AnalyzeJobState"]:
) -> AsyncAnalyzeActionsLROPoller["_models.AnalyzeJobState"]:
"""Submit analysis job.
Submit a collection of text documents for analysis. Specify one or more unique tasks to be
@@ -80,12 +80,12 @@ async def begin_analyze(
:type body: ~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeBatchInput
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncAnalyzeBatchActionsLROPollingMethod.
:keyword polling: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncAnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~....._async_lro.AsyncAnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~....._async_lro.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:raises ~azure.core.exceptions.HttpResponseError:
"""
api_version = self._get_api_version('begin_analyze')
@@ -142,7 +142,7 @@ async def begin_health(
string_index_type: Optional[Union[str, "_models.StringIndexType"]] = None,
logging_opt_out: Optional[bool] = None,
**kwargs
) -> AnalyzeHealthcareEntitiesAsyncLROPoller["_models.HealthcareJobState"]:
) -> AsyncAnalyzeHealthcareEntitiesLROPoller["_models.HealthcareJobState"]:
"""Submit healthcare analysis job.
Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions,
@@ -167,12 +167,12 @@ async def begin_health(
:type logging_opt_out: bool
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AnalyzeHealthcareEntitiesAsyncLROPollingMethod.
:keyword polling: By default, your polling method will be AsyncAnalyzeHealthcareEntitiesLROPollingMethod.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AnalyzeHealthcareEntitiesAsyncLROPoller that returns either HealthcareJobState or the result of cls(response)
:rtype: ~....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.HealthcareJobState]
:return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response)
:rtype: ~....._async_lro.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.HealthcareJobState]
:raises ~azure.core.exceptions.HttpResponseError:
"""
api_version = self._get_api_version('begin_health')
Loading

0 comments on commit 0282a23

Please sign in to comment.