Skip to content

Commit 2e34f02

Browse files
docs sweep for the beta (#27316)
1 parent 4c8c97a commit 2e34f02

File tree

11 files changed

+66
-27
lines changed

11 files changed

+66
-27
lines changed

sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
`NumberResolution`, `NumericRangeResolution`, `OrdinalResolution`, `SpeedResolution`, `TemperatureResolution`,
1616
`TemporalSpanResolution`, `VolumeResolution`, `WeightResolution`, `AgeUnit`, `AreaUnit`, `TemporalModifier`,
1717
`InformationUnit`, `LengthUnit`, `NumberKind`, `RangeKind`, `RelativeTo`, `SpeedUnit`, `TemperatureUnit`,
18-
`VolumeUnit`, and `WeightUnit`.
18+
`VolumeUnit`, `DateTimeSubKind`, and `WeightUnit`.
1919
- Added the Abstractive Summarization feature and related models: `AbstractSummaryAction`, `AbstractSummaryResult`, `AbstractiveSummary`,
2020
and `SummaryContext`. Access the feature through the `begin_analyze_actions` API.
2121
- Added automatic language detection to long-running operation APIs. Pass `auto` into the document `language` hint to use this feature.

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
VolumeUnit,
9999
WeightUnit,
100100
ClassificationType,
101+
DateTimeSubKind,
101102
)
102103
from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller, TextAnalysisLROPoller
103104

@@ -196,6 +197,7 @@
196197
"AbstractSummaryAction",
197198
"ClassificationType",
198199
"DynamicClassificationResult",
200+
"DateTimeSubKind",
199201
]
200202

201203
__version__ = VERSION

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ def __init__(
5858
"x-envoy-upstream-service-time",
5959
"Strict-Transport-Security",
6060
"x-content-type-options",
61+
"warn-code",
62+
"warn-agent",
63+
"warn-text",
6164
}
6265
)
6366
http_logging_policy.allowed_query_params.update(

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ class RecognizeEntitiesResult(DictMixin):
375375
field will contain information about the document payload.
376376
:vartype statistics:
377377
Optional[~azure.ai.textanalytics.TextDocumentStatistics]
378-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
379-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
378+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
379+
field will contain the DetectedLanguage for the document.
380380
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
381381
:ivar bool is_error: Boolean check for error item when iterating over list of
382382
results. Always False for an instance of a RecognizeEntitiesResult.
@@ -429,8 +429,8 @@ class RecognizePiiEntitiesResult(DictMixin):
429429
field will contain information about the document payload.
430430
:vartype statistics:
431431
Optional[~azure.ai.textanalytics.TextDocumentStatistics]
432-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
433-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
432+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
433+
field will contain the DetectedLanguage for the document.
434434
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
435435
:ivar bool is_error: Boolean check for error item when iterating over list of
436436
results. Always False for an instance of a RecognizePiiEntitiesResult.
@@ -493,8 +493,8 @@ class AnalyzeHealthcareEntitiesResult(DictMixin):
493493
FHIR compatible object for consumption in other Healthcare tools. For additional
494494
information see https://www.hl7.org/fhir/overview.html.
495495
:vartype fhir_bundle: Optional[dict[str, any]]
496-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
497-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
496+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
497+
field will contain the DetectedLanguage for the document.
498498
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
499499
:ivar bool is_error: Boolean check for error item when iterating over list of
500500
results. Always False for an instance of a AnalyzeHealthcareEntitiesResult.
@@ -1052,8 +1052,8 @@ class ExtractKeyPhrasesResult(DictMixin):
10521052
field will contain information about the document payload.
10531053
:vartype statistics:
10541054
Optional[~azure.ai.textanalytics.TextDocumentStatistics]
1055-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
1056-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
1055+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
1056+
field will contain the DetectedLanguage for the document.
10571057
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
10581058
:ivar bool is_error: Boolean check for error item when iterating over list of
10591059
results. Always False for an instance of a ExtractKeyPhrasesResult.
@@ -1104,8 +1104,8 @@ class RecognizeLinkedEntitiesResult(DictMixin):
11041104
field will contain information about the document payload.
11051105
:vartype statistics:
11061106
Optional[~azure.ai.textanalytics.TextDocumentStatistics]
1107-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
1108-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
1107+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
1108+
field will contain the DetectedLanguage for the document.
11091109
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
11101110
:ivar bool is_error: Boolean check for error item when iterating over list of
11111111
results. Always False for an instance of a RecognizeLinkedEntitiesResult.
@@ -1165,8 +1165,8 @@ class AnalyzeSentimentResult(DictMixin):
11651165
:ivar sentences: Sentence level sentiment analysis.
11661166
:vartype sentences:
11671167
list[~azure.ai.textanalytics.SentenceSentiment]
1168-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
1169-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
1168+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
1169+
field will contain the DetectedLanguage for the document.
11701170
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
11711171
:ivar bool is_error: Boolean check for error item when iterating over list of
11721172
results. Always False for an instance of a AnalyzeSentimentResult.
@@ -1473,6 +1473,9 @@ class TextDocumentInput(DictMixin, MultiLanguageInput):
14731473
operation APIs with API version 2022-10-01-preview or newer). If
14741474
not set, uses "en" for English as default.
14751475
:vartype language: Optional[str]
1476+
1477+
.. versionadded:: 2022-10-01-preview
1478+
The 'auto' option for language.
14761479
"""
14771480

14781481
def __init__(self, **kwargs):
@@ -2306,8 +2309,8 @@ class RecognizeCustomEntitiesResult(DictMixin):
23062309
:ivar statistics: If `show_stats=True` was specified in the request this
23072310
field will contain information about the document payload.
23082311
:vartype statistics: Optional[~azure.ai.textanalytics.TextDocumentStatistics]
2309-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
2310-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
2312+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
2313+
field will contain the DetectedLanguage for the document.
23112314
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
23122315
:ivar bool is_error: Boolean check for error item when iterating over list of
23132316
results. Always False for an instance of a RecognizeCustomEntitiesResult.
@@ -2433,8 +2436,8 @@ class ClassifyDocumentResult(DictMixin):
24332436
:ivar statistics: If `show_stats=True` was specified in the request this
24342437
field will contain information about the document payload.
24352438
:vartype statistics: Optional[~azure.ai.textanalytics.TextDocumentStatistics]
2436-
:ivar detected_language: If 'language' was set to 'auto' for the document in the request this
2437-
field will contain a 2 letter ISO 639-1 representation of the language detected for this document.
2439+
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
2440+
field will contain the DetectedLanguage for the document.
24382441
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
24392442
:ivar bool is_error: Boolean check for error item when iterating over list of
24402443
results. Always False for an instance of a ClassifyDocumentResult.
@@ -2630,10 +2633,11 @@ class AnalyzeHealthcareEntitiesAction(DictMixin):
26302633
:ivar Optional[str] fhir_version: The FHIR Spec version that the result will use to format the fhir_bundle
26312634
on the result object. For additional information see https://www.hl7.org/fhir/overview.html.
26322635
The only acceptable values to pass in are None and "4.0.1". The default value is None.
2633-
:ivar Optional[str] document_type: Document type that can be provided as input for Fhir Documents. Expect to
2636+
:ivar document_type: Document type that can be provided as input for Fhir Documents. Expect to
26342637
have fhir_version provided when used. Behavior of using None enum is the same as not using the
26352638
document_type parameter. Known values are: "None", "ClinicalTrial", "DischargeSummary",
26362639
"ProgressNote", "HistoryAndPhysical", "Consult", "Imaging", "Pathology", and "ProcedureNote".
2640+
:vartype document_type: Optional[str or ~azure.ai.textanalytics.HealthcareDocumentType]
26372641
26382642
.. versionadded:: 2022-05-01
26392643
The *AnalyzeHealthcareEntitiesAction* model.
@@ -2676,7 +2680,7 @@ def _to_generated(self, api_version, task_id): # pylint: disable=unused-argumen
26762680
class ExtractSummaryAction(DictMixin):
26772681
"""ExtractSummaryAction encapsulates the parameters for starting a long-running Extractive Text
26782682
Summarization operation. For a conceptual discussion of extractive summarization, see the service documentation:
2679-
https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/extractive-summarization
2683+
https://learn.microsoft.com/azure/cognitive-services/language-service/summarization/overview
26802684
26812685
:keyword Optional[str] model_version: The model version to use for the analysis.
26822686
:keyword Optional[str] string_index_type: Specifies the method used to interpret string offsets.
@@ -2758,8 +2762,7 @@ class ExtractSummaryResult(DictMixin):
27582762
field will contain information about the document payload.
27592763
:vartype statistics: Optional[~azure.ai.textanalytics.TextDocumentStatistics]
27602764
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
2761-
field will contain a 2 letter ISO 639-1 representation of the language detected for this
2762-
document.
2765+
field will contain the DetectedLanguage for the document.
27632766
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
27642767
:ivar bool is_error: Boolean check for error item when iterating over list of
27652768
results. Always False for an instance of an ExtractSummaryResult.
@@ -2860,13 +2863,12 @@ def _from_generated(cls, sentence):
28602863
class AbstractSummaryResult(DictMixin):
28612864
"""AbstractSummaryResult is a result object which contains
28622865
the summary generated for a particular document.
2863-
.
2866+
28642867
:ivar id: Unique, non-empty document identifier. Required.
28652868
:vartype id: str
28662869
:ivar detected_language: If 'language' is set to 'auto' for the document in the request this
2867-
field will contain a 2 letter ISO 639-1 representation of the language detected for this
2868-
document.
2869-
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage}
2870+
field will contain the DetectedLanguage for the document.
2871+
:vartype detected_language: Optional[~azure.ai.textanalytics.DetectedLanguage]
28702872
:ivar warnings: Warnings encountered while processing document. Results will still be returned
28712873
if there are warnings, but they may not be fully accurate.
28722874
:vartype warnings: list[~azure.ai.textanalytics.TextAnalyticsWarning]
@@ -3000,13 +3002,18 @@ def _from_generated(cls, summary):
30003002

30013003
class AbstractSummaryAction(DictMixin):
30023004
"""AbstractSummaryAction encapsulates the parameters for starting a long-running
3003-
abstractive summarization operation.
3005+
abstractive summarization operation. For a conceptual discussion of extractive summarization,
3006+
see the service documentation:
3007+
https://learn.microsoft.com/azure/cognitive-services/language-service/summarization/overview
30043008
30053009
Abstractive summarization generates a summary for the input documents. Abstractive summarization
30063010
is different from extractive summarization in that extractive summarization is the strategy of
30073011
concatenating extracted sentences from the input document into a summary, while abstractive
30083012
summarization involves paraphrasing the document using novel sentences.
30093013
3014+
.. note:: The abstractive summarization feature is part of a gated preview. Request access here:
3015+
https://aka.ms/applyforgatedsummarizationfeatures
3016+
30103017
:keyword Optional[int] sentence_count: It controls the approximate number of sentences in the output summaries.
30113018
:keyword Optional[str] model_version: The model version to use for the analysis.
30123019
:keyword Optional[str] string_index_type: Specifies the method used to interpret string offsets.
@@ -3021,6 +3028,7 @@ class AbstractSummaryAction(DictMixin):
30213028
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
30223029
additional details, and Microsoft Responsible AI principles at
30233030
https://www.microsoft.com/ai/responsible-ai.
3031+
:ivar Optional[int] sentence_count: It controls the approximate number of sentences in the output summaries.
30243032
:ivar Optional[str] model_version: The model version to use for the analysis.
30253033
:ivar Optional[str] string_index_type: Specifies the method used to interpret string offsets.
30263034
`UnicodeCodePoint`, the Python encoding, is the default. To override the Python default,
@@ -3034,7 +3042,6 @@ class AbstractSummaryAction(DictMixin):
30343042
Cognitive Services Compliance and Privacy notes at https://aka.ms/cs-compliance for
30353043
additional details, and Microsoft Responsible AI principles at
30363044
https://www.microsoft.com/ai/responsible-ai.
3037-
:ivar Optional[int] sentence_count: It controls the approximate number of sentences in the output summaries.
30383045
30393046
.. versionadded:: 2022-10-01-preview
30403047
The *AbstractSummaryAction* model.

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_text_analytics_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,9 @@ def begin_analyze_actions(
11191119
combine multiple text analysis actions into one call. Otherwise, we recommend you use
11201120
the action specific endpoints, for example :func:`analyze_sentiment`.
11211121
1122+
.. note:: The abstractive summarization feature is part of a gated preview. Request access here:
1123+
https://aka.ms/applyforgatedsummarizationfeatures
1124+
11221125
.. note:: See the service documentation for regional support of custom action features:
11231126
https://aka.ms/azsdk/textanalytics/customfunctionalities
11241127
@@ -1714,6 +1717,9 @@ def dynamic_classification(
17141717
Assigns either one or multiple categories per document. This type of classification
17151718
doesn't require model training.
17161719
1720+
.. note:: The dynamic classification feature is part of a gated preview. Request access here:
1721+
https://aka.ms/applyforgatedlanguagefeature
1722+
17171723
See https://aka.ms/azsdk/textanalytics/data-limits for service data limits.
17181724
17191725
:param documents: The set of documents to process as part of this batch.

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def __init__(
4343
"x-envoy-upstream-service-time",
4444
"Strict-Transport-Security",
4545
"x-content-type-options",
46+
"warn-code",
47+
"warn-agent",
48+
"warn-text",
4649
}
4750
)
4851
http_logging_policy.allowed_query_params.update(

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,9 @@ async def begin_analyze_actions(
11151115
combine multiple text analysis actions into one call. Otherwise, we recommend you use
11161116
the action specific endpoints, for example :func:`analyze_sentiment`.
11171117
1118+
.. note:: The abstractive summarization feature is part of a gated preview. Request access here:
1119+
https://aka.ms/applyforgatedsummarizationfeatures
1120+
11181121
.. note:: See the service documentation for regional support of custom action features:
11191122
https://aka.ms/azsdk/textanalytics/customfunctionalities
11201123
@@ -1712,6 +1715,9 @@ async def dynamic_classification(
17121715
Assigns either one or multiple categories per document. This type of classification
17131716
doesn't require model training.
17141717
1718+
.. note:: The dynamic classification feature is part of a gated preview. Request access here:
1719+
https://aka.ms/applyforgatedlanguagefeature
1720+
17151721
See https://aka.ms/azsdk/textanalytics/data-limits for service data limits.
17161722
17171723
:param documents: The set of documents to process as part of this batch.

sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_abstract_summary_async.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
Abstractive summarization generates a summary that may not use the same words as those in
1515
the document, but captures the main idea.
1616
17+
The abstractive summarization feature is part of a gated preview. Request access here:
18+
https://aka.ms/applyforgatedsummarizationfeatures
19+
1720
USAGE:
1821
python sample_abstract_summary_async.py
1922

sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_dynamic_classification_async.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
This sample demonstrates how to dynamically classify documents into one or multiple categories.
1212
No model training is required to use dynamic classification.
1313
14+
The dynamic classification feature is part of a gated preview. Request access here:
15+
https://aka.ms/applyforgatedlanguagefeature
16+
1417
USAGE:
1518
python sample_dynamic_classification_async.py
1619

sdk/textanalytics/azure-ai-textanalytics/samples/sample_abstract_summary.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
Abstractive summarization generates a summary that may not use the same words as those in
1515
the document, but captures the main idea.
1616
17+
The abstractive summarization feature is part of a gated preview. Request access here:
18+
https://aka.ms/applyforgatedsummarizationfeatures
19+
1720
USAGE:
1821
python sample_abstract_summary.py
1922

0 commit comments

Comments
 (0)