diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Protocol/demo/DemoApp.csproj b/sdk/textanalytics/Azure.AI.TextAnalytics.Protocol/demo/DemoApp.csproj
index 841cc5685d4d1..fa4831fd405ce 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics.Protocol/demo/DemoApp.csproj
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Protocol/demo/DemoApp.csproj
@@ -3,6 +3,7 @@
Exe
net5.0
+ false
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md b/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md
index 9047fb06d6130..8f8dfc937bc37 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md
@@ -1,7 +1,10 @@
# Release History
## 5.1.0-beta.6 (Unreleased)
-
+### New features
+- Add overloads to `ExtractKeyPhrasesBatch` and `ExtractKeyPhrasesBatchAsync` to on `TextAnalyticsClient` to accept `ExtractKeyPhrasesOptions` and hid the previous methods (non-breaking change).
+- Add overloads to `RecognizeEntitiesBatch` and `RecognizeEntitiesBatchAsync` to on `TextAnalyticsClient` to accept `RecognizeEntitiesOptions` and hid the previous methods (non-breaking change).
+- Add overloads to `RecognizeLinkedEntitiesBatch` and `RecognizeLinkedEntitiesBatch` to on `TextAnalyticsClient` to accept `RecognizeLinkedEntitiesOptions` and hid the previous methods (non-breaking change).
## 5.1.0-beta.5 (2021-03-09)
### New features
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs
index 67a512568598c..5e28b0955940c 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/api/Azure.AI.TextAnalytics.netstandard2.0.cs
@@ -720,24 +720,60 @@ public TextAnalyticsClient(System.Uri endpoint, Azure.Core.TokenCredential crede
public override bool Equals(object obj) { throw null; }
public virtual Azure.Response ExtractKeyPhrases(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesAsync(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual Azure.Response ExtractKeyPhrasesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual Azure.Response ExtractKeyPhrasesBatch(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.Response ExtractKeyPhrasesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.ExtractKeyPhrasesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response ExtractKeyPhrasesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response ExtractKeyPhrasesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.Response ExtractKeyPhrasesBatch(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.ExtractKeyPhrasesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response ExtractKeyPhrasesBatch(System.Collections.Generic.IEnumerable documents, string language, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.ExtractKeyPhrasesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.ExtractKeyPhrasesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> ExtractKeyPhrasesBatchAsync(System.Collections.Generic.IEnumerable documents, string language, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public virtual Azure.Response RecognizeEntities(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task> RecognizeEntitiesAsync(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual System.Threading.Tasks.Task> RecognizeEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual System.Threading.Tasks.Task> RecognizeEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.RecognizeEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.RecognizeEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response RecognizeEntitiesBatch(System.Collections.Generic.IEnumerable documents, string language, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> RecognizeEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.RecognizeEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> RecognizeEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> RecognizeEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> RecognizeEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.RecognizeEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> RecognizeEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, string language, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response RecognizeLinkedEntities(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesAsync(string document, string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual Azure.Response RecognizeLinkedEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual Azure.Response RecognizeLinkedEntitiesBatch(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
- public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.Response RecognizeLinkedEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.RecognizeLinkedEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response RecognizeLinkedEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response RecognizeLinkedEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual Azure.Response RecognizeLinkedEntitiesBatch(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.RecognizeLinkedEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual Azure.Response RecognizeLinkedEntitiesBatch(System.Collections.Generic.IEnumerable documents, string language, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.RecognizeLinkedEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, string language = null, Azure.AI.TextAnalytics.RecognizeLinkedEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual System.Threading.Tasks.Task> RecognizeLinkedEntitiesBatchAsync(System.Collections.Generic.IEnumerable documents, string language, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response RecognizePiiEntities(string document, string language = null, Azure.AI.TextAnalytics.RecognizePiiEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task> RecognizePiiEntitiesAsync(string document, string language = null, Azure.AI.TextAnalytics.RecognizePiiEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response RecognizePiiEntitiesBatch(System.Collections.Generic.IEnumerable documents, Azure.AI.TextAnalytics.RecognizePiiEntitiesOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample3_ExtractKeyPhrases.md b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample3_ExtractKeyPhrases.md
index 005a18f3cf223..68a93b1dfb7fc 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample3_ExtractKeyPhrases.md
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample3_ExtractKeyPhrases.md
@@ -144,7 +144,7 @@ var documents = new List
new TextDocumentInput("4", string.Empty)
};
-var options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
+var options = new ExtractKeyPhrasesOptions { IncludeStatistics = true };
Response response = client.ExtractKeyPhrasesBatch(documents, options);
ExtractKeyPhrasesResultCollection keyPhrasesInDocuments = response.Value;
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md
index 480cee4ccbcc1..c9cc487eb1741 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample4_RecognizeEntities.md
@@ -158,7 +158,7 @@ var documents = new List
new TextDocumentInput("4", string.Empty)
};
-var options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
+var options = new RecognizeEntitiesOptions { IncludeStatistics = true };
Response response = client.RecognizeEntitiesBatch(documents, options);
RecognizeEntitiesResultCollection entitiesInDocuments = response.Value;
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md
index 7782cc07c7cc0..4751f03018592 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample6_RecognizeLinkedEntities.md
@@ -155,7 +155,7 @@ var documents = new List
new TextDocumentInput("4", string.Empty)
};
-var options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
+var options = new RecognizeLinkedEntitiesOptions { IncludeStatistics = true };
Response response = client.RecognizeLinkedEntitiesBatch(documents, options);
RecognizeLinkedEntitiesResultCollection entitiesPerDocuments = response.Value;
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs
index d9df26005151b..4d19a5a199901 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs
@@ -501,6 +501,30 @@ public virtual Response RecognizeEntities(string do
}
}
+ ///
+ /// Runs a predictive model to identify a collection of named entities
+ /// in the passed-in documents, and categorize those entities into types
+ /// such as person, location, or organization.
+ /// For more information on available categories, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> RecognizeEntitiesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default) =>
+ await RecognizeEntitiesBatchAsync(documents, null, options, cancellationToken).ConfigureAwait(false);
+
///
/// Runs a predictive model to identify a collection of named entities
/// in the passed-in documents, and categorize those entities into types
@@ -528,15 +552,70 @@ public virtual Response RecognizeEntities(string do
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual async Task> RecognizeEntitiesBatchAsync(IEnumerable documents, string language = default, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> RecognizeEntitiesBatchAsync(IEnumerable documents, string language, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents, language);
return await RecognizeEntitiesBatchAsync(documentInputs, options, cancellationToken).ConfigureAwait(false);
}
+ ///
+ /// Runs a predictive model to identify a collection of named entities
+ /// in the passed-in documents, and categorize those entities into types
+ /// such as person, location, or organization.
+ /// For more information on available categories, see
+ /// .
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// The language that all the documents are
+ /// written in. If unspecified, this value will be set to the default
+ /// language in in the request
+ /// sent to the service. If set to an empty string, the service will apply a model
+ /// where the language is explicitly set to "None".
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual async Task> RecognizeEntitiesBatchAsync(IEnumerable documents, string language = default, RecognizeEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ await RecognizeEntitiesBatchAsync(documents, language, (TextAnalyticsRequestOptions)options, cancellationToken).ConfigureAwait(false);
+
+ ///
+ /// Runs a predictive model to identify a collection of named entities
+ /// in the passed-in documents, and categorize those entities into types
+ /// such as person, location, or organization.
+ /// For more information on available categories, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response RecognizeEntitiesBatch(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default) =>
+ RecognizeEntitiesBatch(documents, null, options, cancellationToken);
+
///
/// Runs a predictive model to identify a collection of named entities
/// in the passed-in documents, and categorize those entities into types
@@ -564,15 +643,46 @@ public virtual async Task> Recognize
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual Response RecognizeEntitiesBatch(IEnumerable documents, string language = default, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response RecognizeEntitiesBatch(IEnumerable documents, string language, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents, language);
return RecognizeEntitiesBatch(documentInputs, options, cancellationToken);
}
+ ///
+ /// Runs a predictive model to identify a collection of named entities
+ /// in the passed-in documents, and categorize those entities into types
+ /// such as person, location, or organization.
+ /// For more information on available categories, see
+ /// .
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// The language that all the documents are
+ /// written in. If unspecified, this value will be set to the default
+ /// language in in the request
+ /// sent to the service. If set to an empty string, the service will apply a model
+ /// where the language is explicitly set to "None".
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual Response RecognizeEntitiesBatch(IEnumerable documents, string language = default, RecognizeEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ RecognizeEntitiesBatch(documents, language, (TextAnalyticsRequestOptions)options, cancellationToken);
+
///
/// Runs a predictive model to identify a collection of named entities
/// in the passed-in documents, and categorize those entities into types
@@ -595,15 +705,41 @@ public virtual Response RecognizeEntitiesBatc
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual async Task> RecognizeEntitiesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> RecognizeEntitiesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents);
return await RecognizeEntitiesBatchAsync(documentInputs, options, cancellationToken).ConfigureAwait(false);
}
+ ///
+ /// Runs a predictive model to identify a collection of named entities
+ /// in the passed-in documents, and categorize those entities into types
+ /// such as person, location, or organization.
+ /// For more information on available categories, see
+ /// .
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual async Task> RecognizeEntitiesBatchAsync(IEnumerable documents, RecognizeEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ await RecognizeEntitiesBatchAsync(documents, (TextAnalyticsRequestOptions)options, cancellationToken).ConfigureAwait(false);
+
///
/// Runs a predictive model to identify a collection of named entities
/// in the passed-in documents, and categorize those entities into types
@@ -626,15 +762,41 @@ public virtual async Task> Recognize
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual Response RecognizeEntitiesBatch(IEnumerable documents, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response RecognizeEntitiesBatch(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents);
return RecognizeEntitiesBatch(documentInputs, options, cancellationToken);
}
+ ///
+ /// Runs a predictive model to identify a collection of named entities
+ /// in the passed-in documents, and categorize those entities into types
+ /// such as person, location, or organization.
+ /// For more information on available categories, see
+ /// .
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual Response RecognizeEntitiesBatch(IEnumerable documents, RecognizeEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ RecognizeEntitiesBatch(documents, (TextAnalyticsRequestOptions)options, cancellationToken);
+
private async Task> RecognizeEntitiesBatchAsync(MultiLanguageBatchInput batchInput, TextAnalyticsRequestOptions options, CancellationToken cancellationToken)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(TextAnalyticsClient)}.{nameof(RecognizeEntitiesBatch)}");
@@ -1600,6 +1762,29 @@ public virtual Response ExtractKeyPhrases(string document,
}
}
+ ///
+ /// Runs a model to identify a collection of significant phrases
+ /// found in the passed-in documents.
+ /// For example, for the document "The food was delicious and there
+ /// were wonderful staff", the API returns the main talking points: "food"
+ /// and "wonderful staff".
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of key phrases identified
+ /// in each of the documents.
+ /// Service returned a non-success
+ /// status code.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> ExtractKeyPhrasesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default) =>
+ await ExtractKeyPhrasesBatchAsync(documents, null, options, cancellationToken).ConfigureAwait(false);
+
///
/// Runs a model to identify a collection of significant phrases
/// found in the passed-in documents.
@@ -1626,15 +1811,68 @@ public virtual Response ExtractKeyPhrases(string document,
/// in each of the documents.
/// Service returned a non-success
/// status code.
- public virtual async Task> ExtractKeyPhrasesBatchAsync(IEnumerable documents, string language = default, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> ExtractKeyPhrasesBatchAsync(IEnumerable documents, string language, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new ExtractKeyPhrasesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents, language);
return await ExtractKeyPhrasesBatchAsync(documentInputs, options, cancellationToken).ConfigureAwait(false);
}
+ ///
+ /// Runs a model to identify a collection of significant phrases
+ /// found in the passed-in documents.
+ /// For example, for the document "The food was delicious and there
+ /// were wonderful staff", the API returns the main talking points: "food"
+ /// and "wonderful staff".
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// The language that all the documents are
+ /// written in. If unspecified, this value will be set to the default
+ /// language in in the request
+ /// sent to the service. If set to an empty string, the service will apply a model
+ /// where the language is explicitly set to "None".
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of key phrases identified
+ /// in each of the documents.
+ /// Service returned a non-success
+ /// status code.
+ public virtual async Task> ExtractKeyPhrasesBatchAsync(IEnumerable documents, string language = default, ExtractKeyPhrasesOptions options = default, CancellationToken cancellationToken = default) =>
+ await ExtractKeyPhrasesBatchAsync(documents, language, (TextAnalyticsRequestOptions)options, cancellationToken).ConfigureAwait(false);
+
+ ///
+ /// Runs a model to identify a collection of significant phrases
+ /// found in the passed-in documents.
+ /// For example, for the document "The food was delicious and there
+ /// were wonderful staff", the API returns the main talking points: "food"
+ /// and "wonderful staff".
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of key phrases identified
+ /// in each of the documents.
+ /// Service returned a non-success
+ /// status code.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response ExtractKeyPhrasesBatch(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default) =>
+ ExtractKeyPhrasesBatch(documents, null, options, cancellationToken);
+
///
/// Runs a model to identify a collection of significant phrases
/// found in the passed-in documents.
@@ -1661,15 +1899,45 @@ public virtual async Task> ExtractKe
/// in each of the documents.
/// Service returned a non-success
/// status code.
- public virtual Response ExtractKeyPhrasesBatch(IEnumerable documents, string language = default, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response ExtractKeyPhrasesBatch(IEnumerable documents, string language, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new ExtractKeyPhrasesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents, language);
return ExtractKeyPhrasesBatch(documentInputs, options, cancellationToken);
}
+ ///
+ /// Runs a model to identify a collection of significant phrases
+ /// found in the passed-in documents.
+ /// For example, for the document "The food was delicious and there
+ /// were wonderful staff", the API returns the main talking points: "food"
+ /// and "wonderful staff".
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// The language that all the documents are
+ /// written in. If unspecified, this value will be set to the default
+ /// language in in the request
+ /// sent to the service. If set to an empty string, the service will apply a model
+ /// where the language is explicitly set to "None".
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of key phrases identified
+ /// in each of the documents.
+ /// Service returned a non-success
+ /// status code.
+ public virtual Response ExtractKeyPhrasesBatch(IEnumerable documents, string language = default, ExtractKeyPhrasesOptions options = default, CancellationToken cancellationToken = default) =>
+ ExtractKeyPhrasesBatch(documents, language, (TextAnalyticsRequestOptions)options, cancellationToken);
+
///
/// Runs a model to identify a collection of significant phrases
/// found in the passed-in documents.
@@ -1691,15 +1959,40 @@ public virtual Response ExtractKeyPhrasesBatc
/// in each of the documents.
/// Service returned a non-success
/// status code.
- public virtual async Task> ExtractKeyPhrasesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> ExtractKeyPhrasesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new ExtractKeyPhrasesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents);
return await ExtractKeyPhrasesBatchAsync(documentInputs, options, cancellationToken).ConfigureAwait(false);
}
+ ///
+ /// Runs a model to identify a collection of significant phrases
+ /// found in the passed-in documents.
+ /// For example, for the document "The food was delicious and there
+ /// were wonderful staff", the API returns the main talking points: "food"
+ /// and "wonderful staff".
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of key phrases identified
+ /// in each of the documents.
+ /// Service returned a non-success
+ /// status code.
+ public virtual async Task> ExtractKeyPhrasesBatchAsync(IEnumerable documents, ExtractKeyPhrasesOptions options = default, CancellationToken cancellationToken = default) =>
+ await ExtractKeyPhrasesBatchAsync(documents, (TextAnalyticsRequestOptions)options, cancellationToken).ConfigureAwait(false);
+
///
/// Runs a model to identify a collection of significant phrases
/// found in the passed-in documents.
@@ -1721,15 +2014,40 @@ public virtual async Task> ExtractKe
/// in each of the documents.
/// Service returned a non-success
/// status code.
- public virtual Response ExtractKeyPhrasesBatch(IEnumerable documents, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response ExtractKeyPhrasesBatch(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new ExtractKeyPhrasesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents);
return ExtractKeyPhrasesBatch(documentInputs, options, cancellationToken);
}
+ ///
+ /// Runs a model to identify a collection of significant phrases
+ /// found in the passed-in documents.
+ /// For example, for the document "The food was delicious and there
+ /// were wonderful staff", the API returns the main talking points: "food"
+ /// and "wonderful staff".
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of key phrases identified
+ /// in each of the documents.
+ /// Service returned a non-success
+ /// status code.
+ public virtual Response ExtractKeyPhrasesBatch(IEnumerable documents, ExtractKeyPhrasesOptions options = default, CancellationToken cancellationToken = default) =>
+ ExtractKeyPhrasesBatch(documents, (TextAnalyticsRequestOptions)options, cancellationToken);
+
private async Task> ExtractKeyPhrasesBatchAsync(MultiLanguageBatchInput batchInput, TextAnalyticsRequestOptions options, CancellationToken cancellationToken)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(TextAnalyticsClient)}.{nameof(ExtractKeyPhrasesBatch)}");
@@ -1888,6 +2206,28 @@ public virtual Response RecognizeLinkedEntities(string d
}
}
+ ///
+ /// Runs a predictive model to identify a collection of entities
+ /// found in the passed-in documents, and include information linking the
+ /// entities to their corresponding entries in a well-known knowledge base.
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> RecognizeLinkedEntitiesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default) =>
+ await RecognizeLinkedEntitiesBatchAsync(documents, null, options, cancellationToken).ConfigureAwait(false);
+
///
/// Runs a predictive model to identify a collection of entities
/// found in the passed-in documents, and include information linking the
@@ -1913,15 +2253,66 @@ public virtual Response RecognizeLinkedEntities(string d
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual async Task> RecognizeLinkedEntitiesBatchAsync(IEnumerable documents, string language = default, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> RecognizeLinkedEntitiesBatchAsync(IEnumerable documents, string language, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeLinkedEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents, language);
return await RecognizeLinkedEntitiesBatchAsync(documentInputs, options, cancellationToken).ConfigureAwait(false);
}
+ ///
+ /// Runs a predictive model to identify a collection of entities
+ /// found in the passed-in documents, and include information linking the
+ /// entities to their corresponding entries in a well-known knowledge base.
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// The language that the documents are written in.
+ /// If unspecified, this value will be set to the default language in
+ /// in the request sent to the
+ /// service. If set to an empty string, the service will apply a model
+ /// where the language is explicitly set to "None".
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual async Task> RecognizeLinkedEntitiesBatchAsync(IEnumerable documents, string language = default, RecognizeLinkedEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ await RecognizeLinkedEntitiesBatchAsync(documents, language, (TextAnalyticsRequestOptions)options, cancellationToken).ConfigureAwait(false);
+
+ ///
+ /// Runs a predictive model to identify a collection of entities
+ /// found in the passed-in documents, and include information linking the
+ /// entities to their corresponding entries in a well-known knowledge base.
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response RecognizeLinkedEntitiesBatch(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default) =>
+ RecognizeLinkedEntitiesBatch(documents, null, options, cancellationToken);
+
///
/// Runs a predictive model to identify a collection of entities
/// found in the passed-in documents, and include information linking the
@@ -1947,15 +2338,44 @@ public virtual async Task> Rec
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual Response RecognizeLinkedEntitiesBatch(IEnumerable documents, string language = default, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response RecognizeLinkedEntitiesBatch(IEnumerable documents, string language, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeLinkedEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents, language);
return RecognizeLinkedEntitiesBatch(documentInputs, options, cancellationToken);
}
+ ///
+ /// Runs a predictive model to identify a collection of entities
+ /// found in the passed-in documents, and include information linking the
+ /// entities to their corresponding entries in a well-known knowledge base.
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// The language that the documents are written in.
+ /// If unspecified, this value will be set to the default language in
+ /// in the request sent to the
+ /// service. If set to an empty string, the service will apply a model
+ /// where the language is explicitly set to "None".
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual Response RecognizeLinkedEntitiesBatch(IEnumerable documents, string language = default, RecognizeLinkedEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ RecognizeLinkedEntitiesBatch(documents, language, (TextAnalyticsRequestOptions)options, cancellationToken);
+
///
/// Runs a predictive model to identify a collection of entities
/// found in the passed-in documents, and include information linking the
@@ -1976,15 +2396,39 @@ public virtual Response RecognizeLinked
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual async Task> RecognizeLinkedEntitiesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual async Task> RecognizeLinkedEntitiesBatchAsync(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeLinkedEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents);
return await RecognizeLinkedEntitiesBatchAsync(documentInputs, options, cancellationToken).ConfigureAwait(false);
}
+ ///
+ /// Runs a predictive model to identify a collection of entities
+ /// found in the passed-in documents, and include information linking the
+ /// entities to their corresponding entries in a well-known knowledge base.
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual async Task> RecognizeLinkedEntitiesBatchAsync(IEnumerable documents, RecognizeLinkedEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ await RecognizeLinkedEntitiesBatchAsync(documents, (TextAnalyticsRequestOptions)options, cancellationToken).ConfigureAwait(false);
+
///
/// Runs a predictive model to identify a collection of entities
/// found in the passed-in documents, and include information linking the
@@ -2005,15 +2449,39 @@ public virtual async Task> Rec
/// that a given entity correctly matches the identified substring.
/// Service returned a non-success
/// status code.
- public virtual Response RecognizeLinkedEntitiesBatch(IEnumerable documents, TextAnalyticsRequestOptions options = default, CancellationToken cancellationToken = default)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual Response RecognizeLinkedEntitiesBatch(IEnumerable documents, TextAnalyticsRequestOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(documents, nameof(documents));
- options ??= new TextAnalyticsRequestOptions();
+ options ??= new RecognizeLinkedEntitiesOptions();
MultiLanguageBatchInput documentInputs = ConvertToMultiLanguageInputs(documents);
return RecognizeLinkedEntitiesBatch(documentInputs, options, cancellationToken);
}
+ ///
+ /// Runs a predictive model to identify a collection of entities
+ /// found in the passed-in documents, and include information linking the
+ /// entities to their corresponding entries in a well-known knowledge base.
+ /// For a list of languages supported by this operation, see
+ /// .
+ /// For document length limits, maximum batch size, and supported text encoding, see
+ /// .
+ ///
+ /// The documents to analyze.
+ /// used to
+ /// select the version of the predictive model to run, and whether
+ /// statistics are returned in the response.
+ /// A
+ /// controlling the request lifetime.
+ /// A result containing the collection of entities identified
+ /// for each of the documents, as well as scores indicating the confidence
+ /// that a given entity correctly matches the identified substring.
+ /// Service returned a non-success
+ /// status code.
+ public virtual Response RecognizeLinkedEntitiesBatch(IEnumerable documents, RecognizeLinkedEntitiesOptions options = default, CancellationToken cancellationToken = default) =>
+ RecognizeLinkedEntitiesBatch(documents, (TextAnalyticsRequestOptions)options, cancellationToken);
+
private async Task> RecognizeLinkedEntitiesBatchAsync(MultiLanguageBatchInput batchInput, TextAnalyticsRequestOptions options, CancellationToken cancellationToken)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(TextAnalyticsClient)}.{nameof(RecognizeLinkedEntitiesBatch)}");
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs
index c1da10de7c4e6..27c69ecc528bc 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs
@@ -125,14 +125,39 @@ public async Task ExtractKeyPhrasesBatchConvenienceTest()
[Test]
public async Task ExtractKeyPhrasesBatchConvenienceWithStatisticsTest()
{
+ var options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
TextAnalyticsClient client = GetClient();
var documents = batchConvenienceDocuments;
- ExtractKeyPhrasesResultCollection results = await client.ExtractKeyPhrasesBatchAsync(documents, "en", new TextAnalyticsRequestOptions { IncludeStatistics = true });
+ ExtractKeyPhrasesResultCollection results = await client.ExtractKeyPhrasesBatchAsync(documents, "en", options);
ValidateBatchDocumentsResult(results, 3, includeStatistics: true);
Assert.AreEqual(documents.Count, results.Statistics.DocumentCount);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
+ }
+
+ [Test]
+ public async Task ExtractKeyPhrasesBatchConvenienceWithExtractKeyPhrasesOptionsStatisticsTest()
+ {
+ var options = new ExtractKeyPhrasesOptions { IncludeStatistics = true };
+ TextAnalyticsClient client = GetClient();
+ var documents = batchConvenienceDocuments;
+
+ ExtractKeyPhrasesResultCollection results = await client.ExtractKeyPhrasesBatchAsync(documents, "en", options);
+
+ ValidateBatchDocumentsResult(results, 3, includeStatistics: true);
+
+ Assert.AreEqual(documents.Count, results.Statistics.DocumentCount);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
}
[Test]
@@ -149,14 +174,39 @@ public async Task ExtractKeyPhrasesBatchTest()
[Test]
public async Task ExtractKeyPhrasesBatchWithSatisticsTest()
{
+ var options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
TextAnalyticsClient client = GetClient();
List documents = batchDocuments;
- ExtractKeyPhrasesResultCollection results = await client.ExtractKeyPhrasesBatchAsync(documents, new TextAnalyticsRequestOptions { IncludeStatistics = true });
+ ExtractKeyPhrasesResultCollection results = await client.ExtractKeyPhrasesBatchAsync(documents, options);
ValidateBatchDocumentsResult(results, 3, includeStatistics: true);
Assert.AreEqual(documents.Count, results.Statistics.DocumentCount);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
+ }
+
+ [Test]
+ public async Task ExtractKeyPhrasesBatchWithExtractKeyPhrasesOptionsSatisticsTest()
+ {
+ var options = new ExtractKeyPhrasesOptions { IncludeStatistics = true };
+ TextAnalyticsClient client = GetClient();
+ List documents = batchDocuments;
+
+ ExtractKeyPhrasesResultCollection results = await client.ExtractKeyPhrasesBatchAsync(documents, options);
+
+ ValidateBatchDocumentsResult(results, 3, includeStatistics: true);
+
+ Assert.AreEqual(documents.Count, results.Statistics.DocumentCount);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
}
[Test]
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs
index 655c4fb5bd78d..786bdf6a8f64a 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeEntitiesTests.cs
@@ -78,10 +78,11 @@ public async Task RecognizeEntitiesWithLanguageTest()
[Test]
public async Task RecognizeEntitiesWithSubCategoryTest()
{
+ TextAnalyticsRequestOptions options = new TextAnalyticsRequestOptions() { ModelVersion = "2020-04-01" };
TextAnalyticsClient client = GetClient();
string document = "I had a wonderful trip to Seattle last week.";
- RecognizeEntitiesResultCollection result = await client.RecognizeEntitiesBatchAsync(new List() { document }, options: new TextAnalyticsRequestOptions() { ModelVersion = "2020-04-01" } );
+ RecognizeEntitiesResultCollection result = await client.RecognizeEntitiesBatchAsync(new List() { document }, options: options );
var documentResult = result.FirstOrDefault();
Assert.IsFalse(documentResult.HasError);
@@ -93,6 +94,37 @@ public async Task RecognizeEntitiesWithSubCategoryTest()
if (entity.Text == "last week")
Assert.AreEqual("DateRange", entity.SubCategory);
}
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsFalse(options.IncludeStatistics);
+ Assert.AreEqual("2020-04-01", options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
+ }
+
+ [Test]
+ public async Task RecognizeEntitiesWithRecognizeEntitiesOptionsSubCategoryTest()
+ {
+ RecognizeEntitiesOptions options = new RecognizeEntitiesOptions() { ModelVersion = "2020-04-01" };
+ TextAnalyticsClient client = GetClient();
+ string document = "I had a wonderful trip to Seattle last week.";
+
+ RecognizeEntitiesResultCollection result = await client.RecognizeEntitiesBatchAsync(new List() { document }, options: options );
+
+ var documentResult = result.FirstOrDefault();
+ Assert.IsFalse(documentResult.HasError);
+
+ Assert.GreaterOrEqual(documentResult.Entities.Count, 3);
+
+ foreach (CategorizedEntity entity in documentResult.Entities)
+ {
+ if (entity.Text == "last week")
+ Assert.AreEqual("DateRange", entity.SubCategory);
+ }
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsFalse(options.IncludeStatistics);
+ Assert.AreEqual("2020-04-01", options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
}
[Test]
@@ -155,8 +187,30 @@ public async Task RecognizeEntitiesBatchConvenienceTest()
[Test]
public async Task RecognizeEntitiesBatchConvenienceWithStatisticsTest()
{
+ TextAnalyticsRequestOptions options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
+ TextAnalyticsClient client = GetClient();
+ RecognizeEntitiesResultCollection results = await client.RecognizeEntitiesBatchAsync(s_batchConvenienceDocuments, "en", options);
+
+ var expectedOutput = new Dictionary>()
+ {
+ { "0", s_document1ExpectedOutput },
+ { "1", s_document2ExpectedOutput },
+ };
+
+ ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
+ }
+
+ [Test]
+ public async Task RecognizeEntitiesBatchConvenienceWithRecognizeEntitiesOptionsStatisticsTest()
+ {
+ RecognizeEntitiesOptions options = new RecognizeEntitiesOptions { IncludeStatistics = true };
TextAnalyticsClient client = GetClient();
- RecognizeEntitiesResultCollection results = await client.RecognizeEntitiesBatchAsync(s_batchConvenienceDocuments, "en", new TextAnalyticsRequestOptions { IncludeStatistics = true });
+ RecognizeEntitiesResultCollection results = await client.RecognizeEntitiesBatchAsync(s_batchConvenienceDocuments, "en", options);
var expectedOutput = new Dictionary>()
{
@@ -165,6 +219,11 @@ public async Task RecognizeEntitiesBatchConvenienceWithStatisticsTest()
};
ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
}
[Test]
@@ -185,8 +244,9 @@ public async Task RecognizeEntitiesBatchTest()
[Test]
public async Task RecognizeEntitiesBatchWithStatisticsTest()
{
+ TextAnalyticsRequestOptions options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
TextAnalyticsClient client = GetClient();
- RecognizeEntitiesResultCollection results = await client.RecognizeEntitiesBatchAsync(s_batchDocuments, new TextAnalyticsRequestOptions { IncludeStatistics = true });
+ RecognizeEntitiesResultCollection results = await client.RecognizeEntitiesBatchAsync(s_batchDocuments, options);
var expectedOutput = new Dictionary>()
{
@@ -195,6 +255,32 @@ public async Task RecognizeEntitiesBatchWithStatisticsTest()
};
ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
+ }
+
+ [Test]
+ public async Task RecognizeEntitiesBatchWithRecognizeEntitiesOptionsStatisticsTest()
+ {
+ RecognizeEntitiesOptions options = new RecognizeEntitiesOptions { IncludeStatistics = true };
+ TextAnalyticsClient client = GetClient();
+ RecognizeEntitiesResultCollection results = await client.RecognizeEntitiesBatchAsync(s_batchDocuments, options);
+
+ var expectedOutput = new Dictionary>()
+ {
+ { "1", s_document1ExpectedOutput },
+ { "2", s_document1ExpectedOutput },
+ };
+
+ ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
}
[Test]
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs
index 06b8a77f58071..a2b7f8d5a9445 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeLinkedEntitiesTests.cs
@@ -136,8 +136,9 @@ public async Task RecognizeLinkedEntitiesBatchConvenienceTest()
[Test]
public async Task RecognizeLinkedEntitiesBatchConvenienceWithStatisticsTest()
{
+ TextAnalyticsRequestOptions options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
TextAnalyticsClient client = GetClient();
- RecognizeLinkedEntitiesResultCollection results = await client.RecognizeLinkedEntitiesBatchAsync(s_batchConvenienceDocuments, "en", new TextAnalyticsRequestOptions { IncludeStatistics = true });
+ RecognizeLinkedEntitiesResultCollection results = await client.RecognizeLinkedEntitiesBatchAsync(s_batchConvenienceDocuments, "en", options);
var expectedOutput = new Dictionary>()
{
@@ -146,6 +147,32 @@ public async Task RecognizeLinkedEntitiesBatchConvenienceWithStatisticsTest()
};
ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeLinkedEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
+ }
+
+ [Test]
+ public async Task RecognizeLinkedEntitiesBatchConvenienceWithRecognizeLinkedEntitiesOptionsStatisticsTest()
+ {
+ RecognizeLinkedEntitiesOptions options = new RecognizeLinkedEntitiesOptions { IncludeStatistics = true };
+ TextAnalyticsClient client = GetClient();
+ RecognizeLinkedEntitiesResultCollection results = await client.RecognizeLinkedEntitiesBatchAsync(s_batchConvenienceDocuments, "en", options);
+
+ var expectedOutput = new Dictionary>()
+ {
+ { "0", s_document1ExpectedOutput },
+ { "1", s_document2ExpectedOutput },
+ };
+
+ ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeLinkedEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
}
[Test]
@@ -166,8 +193,9 @@ public async Task RecognizeLinkedEntitiesBatchTest()
[Test]
public async Task RecognizeLinkedEntitiesBatchWithStatisticsTest()
{
+ TextAnalyticsRequestOptions options = new TextAnalyticsRequestOptions { IncludeStatistics = true };
TextAnalyticsClient client = GetClient();
- RecognizeLinkedEntitiesResultCollection results = await client.RecognizeLinkedEntitiesBatchAsync(s_batchDocuments, new TextAnalyticsRequestOptions { IncludeStatistics = true });
+ RecognizeLinkedEntitiesResultCollection results = await client.RecognizeLinkedEntitiesBatchAsync(s_batchDocuments, options);
var expectedOutput = new Dictionary>()
{
@@ -176,6 +204,32 @@ public async Task RecognizeLinkedEntitiesBatchWithStatisticsTest()
};
ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeLinkedEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
+ }
+
+ [Test]
+ public async Task RecognizeLinkedEntitiesBatchWithRecognizeLinkedEntitiesOptionsStatisticsTest()
+ {
+ RecognizeLinkedEntitiesOptions options = new RecognizeLinkedEntitiesOptions { IncludeStatistics = true };
+ TextAnalyticsClient client = GetClient();
+ RecognizeLinkedEntitiesResultCollection results = await client.RecognizeLinkedEntitiesBatchAsync(s_batchDocuments, options);
+
+ var expectedOutput = new Dictionary>()
+ {
+ { "1", s_document1ExpectedOutput },
+ { "3", s_document1ExpectedOutput },
+ };
+
+ ValidateBatchDocumentsResult(results, expectedOutput, includeStatistics: true);
+
+ // Assert the options classes since overloads were added and the original now instantiates a RecognizeLinkedEntitiesOptions.
+ Assert.IsTrue(options.IncludeStatistics);
+ Assert.IsNull(options.ModelVersion);
+ Assert.AreEqual(StringIndexType.Utf16CodeUnit, options.StringIndexType);
}
[Test]
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchConvenienceWithExtractKeyPhrasesOptionsStatisticsTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchConvenienceWithExtractKeyPhrasesOptionsStatisticsTest.json
new file mode 100644
index 0000000000000..3795cfc2917f2
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchConvenienceWithExtractKeyPhrasesOptionsStatisticsTest.json
@@ -0,0 +1,86 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/keyPhrases?showStats=true",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "191",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-776c462d9fabba488ba3d848c0b96a58-a65ef4deba6ec746-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "4dfa2958a1568d79bc14e1b570d63d15",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "1",
+ "text": "My cat and my dog might need to see a veterinarian.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "86f0c43c-2df3-4cb5-84b4-056e75ca9832",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:55:56 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "10"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "0",
+ "keyPhrases": [
+ "Bill Gates",
+ "Paul Allen",
+ "Microsoft"
+ ],
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ },
+ {
+ "id": "1",
+ "keyPhrases": [
+ "dog",
+ "cat",
+ "veterinarian"
+ ],
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-07-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1074286074",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchConvenienceWithExtractKeyPhrasesOptionsStatisticsTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchConvenienceWithExtractKeyPhrasesOptionsStatisticsTestAsync.json
new file mode 100644
index 0000000000000..a03a48d08e13e
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchConvenienceWithExtractKeyPhrasesOptionsStatisticsTestAsync.json
@@ -0,0 +1,86 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/keyPhrases?showStats=true",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "191",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-e03f04c293702f47a356cf6f3a33ba73-0386ee1681c14d43-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "f8f1e114d697e804255315d1c7e9b6ab",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "1",
+ "text": "My cat and my dog might need to see a veterinarian.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "f96e3341-709c-4d67-8f49-24250f38a4ae",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:56:00 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "11"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "0",
+ "keyPhrases": [
+ "Bill Gates",
+ "Paul Allen",
+ "Microsoft"
+ ],
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ },
+ {
+ "id": "1",
+ "keyPhrases": [
+ "dog",
+ "cat",
+ "veterinarian"
+ ],
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-07-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1602869274",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchWithExtractKeyPhrasesOptionsSatisticsTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchWithExtractKeyPhrasesOptionsSatisticsTest.json
new file mode 100644
index 0000000000000..7e8488a3ae158
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchWithExtractKeyPhrasesOptionsSatisticsTest.json
@@ -0,0 +1,86 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/keyPhrases?showStats=true",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "188",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-c263251feefbf04c9bbdf49cd848fea8-71f185a51513454b-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "481340828d769a0d6f19ecfe6b0d9666",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "1",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "2",
+ "text": "Mi perro y mi gato tienen que ir al veterinario.",
+ "language": "es"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "8d25e21c-b163-447a-a3b3-2f8e4ab55be5",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:55:58 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "13"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "1",
+ "keyPhrases": [
+ "Bill Gates",
+ "Paul Allen",
+ "Microsoft"
+ ],
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ },
+ {
+ "id": "2",
+ "keyPhrases": [
+ "gato",
+ "perro",
+ "veterinario"
+ ],
+ "statistics": {
+ "charactersCount": 48,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-07-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1134123605",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchWithExtractKeyPhrasesOptionsSatisticsTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchWithExtractKeyPhrasesOptionsSatisticsTestAsync.json
new file mode 100644
index 0000000000000..082f5bf995bbc
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesBatchWithExtractKeyPhrasesOptionsSatisticsTestAsync.json
@@ -0,0 +1,86 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/keyPhrases?showStats=true",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "188",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-705a22de84b8c84eb9cb31cfd2e5c3c0-6e97e52a610c3c48-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "fcabdefd3d51a89852601fc0d61f3468",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "1",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "2",
+ "text": "Mi perro y mi gato tienen que ir al veterinario.",
+ "language": "es"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "3e818865-6477-4741-b7f2-ffe3ac5f3533",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:56:02 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "10"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "1",
+ "keyPhrases": [
+ "Bill Gates",
+ "Paul Allen",
+ "Microsoft"
+ ],
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ },
+ {
+ "id": "2",
+ "keyPhrases": [
+ "gato",
+ "perro",
+ "veterinario"
+ ],
+ "statistics": {
+ "charactersCount": 48,
+ "transactionsCount": 1
+ },
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-07-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1658669752",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchConvenienceWithRecognizeEntitiesOptionsStatisticsTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchConvenienceWithRecognizeEntitiesOptionsStatisticsTest.json
new file mode 100644
index 0000000000000..434a1ed936d5d
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchConvenienceWithRecognizeEntitiesOptionsStatisticsTest.json
@@ -0,0 +1,108 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/recognition/general?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "191",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-f0e71c428611b54e877a60210ddb5074-559b26c13de00043-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "67616e684f8b043d1e0c71e939770f42",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "1",
+ "text": "My cat and my dog might need to see a veterinarian.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "7503b799-ace4-47bb-8340-ce348670d3aa",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:56:04 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "59"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "0",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "Microsoft",
+ "category": "Organization",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.97
+ },
+ {
+ "text": "Bill Gates",
+ "category": "Person",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 1.0
+ },
+ {
+ "text": "Paul Allen",
+ "category": "Person",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.99
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "veterinarian",
+ "category": "PersonType",
+ "offset": 38,
+ "length": 12,
+ "confidenceScore": 0.98
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2021-01-15"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "706252555",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchConvenienceWithRecognizeEntitiesOptionsStatisticsTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchConvenienceWithRecognizeEntitiesOptionsStatisticsTestAsync.json
new file mode 100644
index 0000000000000..39c9af3c1ca46
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchConvenienceWithRecognizeEntitiesOptionsStatisticsTestAsync.json
@@ -0,0 +1,108 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/recognition/general?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "191",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-b09dab00c205ac4383497ec2db2bb12a-a4d9be2d8c8ebf41-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "3d6191fdfe339ad3e9a9a23dfab389e2",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "1",
+ "text": "My cat and my dog might need to see a veterinarian.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "eaa59371-2f65-4432-a23b-b3a9b2513b11",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:56:09 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "53"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "0",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "Microsoft",
+ "category": "Organization",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.97
+ },
+ {
+ "text": "Bill Gates",
+ "category": "Person",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 1.0
+ },
+ {
+ "text": "Paul Allen",
+ "category": "Person",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.99
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "veterinarian",
+ "category": "PersonType",
+ "offset": 38,
+ "length": 12,
+ "confidenceScore": 0.98
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2021-01-15"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "915085791",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchWithRecognizeEntitiesOptionsStatisticsTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchWithRecognizeEntitiesOptionsStatisticsTest.json
new file mode 100644
index 0000000000000..5daf0c1b5cbfc
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchWithRecognizeEntitiesOptionsStatisticsTest.json
@@ -0,0 +1,122 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/recognition/general?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "190",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-3d8b12b3fc06514789ba36c53927c471-e2b196df0186df4c-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "3c7b09ea57a0a9f84c938c05ff06e377",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "1",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "2",
+ "text": "Microsoft fue fundado por Bill Gates y Paul Allen.",
+ "language": "es"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "4f026eb4-9949-4e33-8abe-771259c42cf4",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:56:06 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "47"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "Microsoft",
+ "category": "Organization",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.97
+ },
+ {
+ "text": "Bill Gates",
+ "category": "Person",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 1.0
+ },
+ {
+ "text": "Paul Allen",
+ "category": "Person",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.99
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "2",
+ "statistics": {
+ "charactersCount": 50,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "Microsoft",
+ "category": "Organization",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.97
+ },
+ {
+ "text": "Bill Gates",
+ "category": "Person",
+ "offset": 26,
+ "length": 10,
+ "confidenceScore": 0.99
+ },
+ {
+ "text": "Paul Allen",
+ "category": "Person",
+ "offset": 39,
+ "length": 10,
+ "confidenceScore": 0.99
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2021-01-15"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "541291504",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchWithRecognizeEntitiesOptionsStatisticsTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchWithRecognizeEntitiesOptionsStatisticsTestAsync.json
new file mode 100644
index 0000000000000..95b28c7747485
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesBatchWithRecognizeEntitiesOptionsStatisticsTestAsync.json
@@ -0,0 +1,122 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/recognition/general?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "190",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-2f4c21569212df478ffe72e0efe85ea0-ce3b8f624c196947-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "c386dc48f454868243af3522ce69cb86",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "1",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "2",
+ "text": "Microsoft fue fundado por Bill Gates y Paul Allen.",
+ "language": "es"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "d81b2d0f-8652-426a-b7f0-0b09ba35f9be",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:56:11 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "57"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "Microsoft",
+ "category": "Organization",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.97
+ },
+ {
+ "text": "Bill Gates",
+ "category": "Person",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 1.0
+ },
+ {
+ "text": "Paul Allen",
+ "category": "Person",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.99
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "2",
+ "statistics": {
+ "charactersCount": 50,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "text": "Microsoft",
+ "category": "Organization",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.97
+ },
+ {
+ "text": "Bill Gates",
+ "category": "Person",
+ "offset": 26,
+ "length": 10,
+ "confidenceScore": 0.99
+ },
+ {
+ "text": "Paul Allen",
+ "category": "Person",
+ "offset": 39,
+ "length": 10,
+ "confidenceScore": 0.99
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2021-01-15"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "438437791",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesWithRecognizeEntitiesOptionsSubCategoryTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesWithRecognizeEntitiesOptionsSubCategoryTest.json
new file mode 100644
index 0000000000000..e496e46bb741f
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesWithRecognizeEntitiesOptionsSubCategoryTest.json
@@ -0,0 +1,78 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/recognition/general?model-version=2020-04-01\u0026showStats=false\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "96",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-02fbc8d6886b934493af61cbf8f49ac7-efaa7b935f434841-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "c580665e455e125e80a821d61e9c3c18",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "I had a wonderful trip to Seattle last week.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "cc614fa9-f47c-4969-9191-0c02c5b8369a",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1",
+ "Date": "Wed, 24 Feb 2021 16:56:08 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "73"
+ },
+ "ResponseBody": {
+ "documents": [
+ {
+ "id": "0",
+ "entities": [
+ {
+ "text": "trip",
+ "category": "Event",
+ "offset": 18,
+ "length": 4,
+ "confidenceScore": 0.61
+ },
+ {
+ "text": "Seattle",
+ "category": "Location",
+ "subcategory": "GPE",
+ "offset": 26,
+ "length": 7,
+ "confidenceScore": 0.82
+ },
+ {
+ "text": "last week",
+ "category": "DateTime",
+ "subcategory": "DateRange",
+ "offset": 34,
+ "length": 9,
+ "confidenceScore": 0.8
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-04-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1531566714",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesWithRecognizeEntitiesOptionsSubCategoryTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesWithRecognizeEntitiesOptionsSubCategoryTestAsync.json
new file mode 100644
index 0000000000000..b31ef04c328f2
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeEntitiesTests/RecognizeEntitiesWithRecognizeEntitiesOptionsSubCategoryTestAsync.json
@@ -0,0 +1,78 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/recognition/general?model-version=2020-04-01\u0026showStats=false\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "96",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-a53c2f7d23cad442813d9d1dbb8fcff5-b005f09a1e73b740-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "3b4b745166e69035ddd947884a09aa87",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "I had a wonderful trip to Seattle last week.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "85c03987-f1ff-42bc-945c-aa737ff68691",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1",
+ "Date": "Wed, 24 Feb 2021 16:56:13 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "93"
+ },
+ "ResponseBody": {
+ "documents": [
+ {
+ "id": "0",
+ "entities": [
+ {
+ "text": "trip",
+ "category": "Event",
+ "offset": 18,
+ "length": 4,
+ "confidenceScore": 0.61
+ },
+ {
+ "text": "Seattle",
+ "category": "Location",
+ "subcategory": "GPE",
+ "offset": 26,
+ "length": 7,
+ "confidenceScore": 0.82
+ },
+ {
+ "text": "last week",
+ "category": "DateTime",
+ "subcategory": "DateRange",
+ "offset": 34,
+ "length": 9,
+ "confidenceScore": 0.8
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-04-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1094081853",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchConvenienceWithRecognizeLinkedEntitiesOptionsStatisticsTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchConvenienceWithRecognizeLinkedEntitiesOptionsStatisticsTest.json
new file mode 100644
index 0000000000000..e361105cdbcbf
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchConvenienceWithRecognizeLinkedEntitiesOptionsStatisticsTest.json
@@ -0,0 +1,160 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/linking?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "192",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-9165a72541277f4b8bbd51e3f7a19cab-5bd73057ee2b8744-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "297e980ed9e8189820ebd45ff129bc5c",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "1",
+ "text": "Pike place market is my favorite Seattle attraction.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "644a2848-9fc6-4c4f-bdfc-135300d8a638",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:57:32 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "23"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "0",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "a093e9b9-90f5-a3d5-c4b8-5855e1b01f85",
+ "name": "Microsoft",
+ "matches": [
+ {
+ "text": "Microsoft",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.49
+ }
+ ],
+ "language": "en",
+ "id": "Microsoft",
+ "url": "https://en.wikipedia.org/wiki/Microsoft",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "0d47c987-0042-5576-15e8-97af601614fa",
+ "name": "Bill Gates",
+ "matches": [
+ {
+ "text": "Bill Gates",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 0.52
+ }
+ ],
+ "language": "en",
+ "id": "Bill Gates",
+ "url": "https://en.wikipedia.org/wiki/Bill_Gates",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "df2c4376-9923-6a54-893f-2ee5a5badbc7",
+ "name": "Paul Allen",
+ "matches": [
+ {
+ "text": "Paul Allen",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.54
+ }
+ ],
+ "language": "en",
+ "id": "Paul Allen",
+ "url": "https://en.wikipedia.org/wiki/Paul_Allen",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 52,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "38b9431e-cf91-93be-0584-c42a3ecbfdc7",
+ "name": "Pike Place Market",
+ "matches": [
+ {
+ "text": "Pike place market",
+ "offset": 0,
+ "length": 17,
+ "confidenceScore": 0.86
+ }
+ ],
+ "language": "en",
+ "id": "Pike Place Market",
+ "url": "https://en.wikipedia.org/wiki/Pike_Place_Market",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "5fbba6b8-85e1-4d41-9444-d9055436e473",
+ "name": "Seattle",
+ "matches": [
+ {
+ "text": "Seattle",
+ "offset": 33,
+ "length": 7,
+ "confidenceScore": 0.27
+ }
+ ],
+ "language": "en",
+ "id": "Seattle",
+ "url": "https://en.wikipedia.org/wiki/Seattle",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-02-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "966684010",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchConvenienceWithRecognizeLinkedEntitiesOptionsStatisticsTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchConvenienceWithRecognizeLinkedEntitiesOptionsStatisticsTestAsync.json
new file mode 100644
index 0000000000000..c278b8a7f2119
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchConvenienceWithRecognizeLinkedEntitiesOptionsStatisticsTestAsync.json
@@ -0,0 +1,160 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/linking?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "192",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-f1ed184f8511cc4bab3f25735f13e8f6-b4d9214567a59042-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "efbfe45b25f6d2a2775e1edd2fe4e7aa",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "0",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "1",
+ "text": "Pike place market is my favorite Seattle attraction.",
+ "language": "en"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "52061967-7dc4-4260-a497-677f09b5deb0",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:57:36 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "26"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "0",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "a093e9b9-90f5-a3d5-c4b8-5855e1b01f85",
+ "name": "Microsoft",
+ "matches": [
+ {
+ "text": "Microsoft",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.49
+ }
+ ],
+ "language": "en",
+ "id": "Microsoft",
+ "url": "https://en.wikipedia.org/wiki/Microsoft",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "0d47c987-0042-5576-15e8-97af601614fa",
+ "name": "Bill Gates",
+ "matches": [
+ {
+ "text": "Bill Gates",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 0.52
+ }
+ ],
+ "language": "en",
+ "id": "Bill Gates",
+ "url": "https://en.wikipedia.org/wiki/Bill_Gates",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "df2c4376-9923-6a54-893f-2ee5a5badbc7",
+ "name": "Paul Allen",
+ "matches": [
+ {
+ "text": "Paul Allen",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.54
+ }
+ ],
+ "language": "en",
+ "id": "Paul Allen",
+ "url": "https://en.wikipedia.org/wiki/Paul_Allen",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 52,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "38b9431e-cf91-93be-0584-c42a3ecbfdc7",
+ "name": "Pike Place Market",
+ "matches": [
+ {
+ "text": "Pike place market",
+ "offset": 0,
+ "length": 17,
+ "confidenceScore": 0.86
+ }
+ ],
+ "language": "en",
+ "id": "Pike Place Market",
+ "url": "https://en.wikipedia.org/wiki/Pike_Place_Market",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "5fbba6b8-85e1-4d41-9444-d9055436e473",
+ "name": "Seattle",
+ "matches": [
+ {
+ "text": "Seattle",
+ "offset": 33,
+ "length": 7,
+ "confidenceScore": 0.27
+ }
+ ],
+ "language": "en",
+ "id": "Seattle",
+ "url": "https://en.wikipedia.org/wiki/Seattle",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-02-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1003575897",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchWithRecognizeLinkedEntitiesOptionsStatisticsTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchWithRecognizeLinkedEntitiesOptionsStatisticsTest.json
new file mode 100644
index 0000000000000..2639fd2255d76
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchWithRecognizeLinkedEntitiesOptionsStatisticsTest.json
@@ -0,0 +1,176 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/linking?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "190",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-6b7f7d13b53e324f97a4104b74b04c49-6d01eec9ad3f4a4d-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "07178a1f00e9eae492911a1486f7f75f",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "1",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "3",
+ "text": "Microsoft fue fundado por Bill Gates y Paul Allen.",
+ "language": "es"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "7675f493-d24c-46e2-a984-f1e5b6a13f11",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:57:34 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "32"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "a093e9b9-90f5-a3d5-c4b8-5855e1b01f85",
+ "name": "Microsoft",
+ "matches": [
+ {
+ "text": "Microsoft",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.49
+ }
+ ],
+ "language": "en",
+ "id": "Microsoft",
+ "url": "https://en.wikipedia.org/wiki/Microsoft",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "0d47c987-0042-5576-15e8-97af601614fa",
+ "name": "Bill Gates",
+ "matches": [
+ {
+ "text": "Bill Gates",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 0.52
+ }
+ ],
+ "language": "en",
+ "id": "Bill Gates",
+ "url": "https://en.wikipedia.org/wiki/Bill_Gates",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "df2c4376-9923-6a54-893f-2ee5a5badbc7",
+ "name": "Paul Allen",
+ "matches": [
+ {
+ "text": "Paul Allen",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.54
+ }
+ ],
+ "language": "en",
+ "id": "Paul Allen",
+ "url": "https://en.wikipedia.org/wiki/Paul_Allen",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "3",
+ "statistics": {
+ "charactersCount": 50,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "a093e9b9-90f5-a3d5-c4b8-5855e1b01f85",
+ "name": "Microsoft",
+ "matches": [
+ {
+ "text": "Microsoft",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.38
+ }
+ ],
+ "language": "es",
+ "id": "Microsoft",
+ "url": "https://es.wikipedia.org/wiki/Microsoft",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "0d47c987-0042-5576-15e8-97af601614fa",
+ "name": "Bill Gates",
+ "matches": [
+ {
+ "text": "Bill Gates",
+ "offset": 26,
+ "length": 10,
+ "confidenceScore": 0.37
+ }
+ ],
+ "language": "es",
+ "id": "Bill Gates",
+ "url": "https://es.wikipedia.org/wiki/Bill_Gates",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "df2c4376-9923-6a54-893f-2ee5a5badbc7",
+ "name": "Paul Allen",
+ "matches": [
+ {
+ "text": "Paul Allen",
+ "offset": 39,
+ "length": 10,
+ "confidenceScore": 0.9
+ }
+ ],
+ "language": "es",
+ "id": "Paul Allen",
+ "url": "https://es.wikipedia.org/wiki/Paul_Allen",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-02-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "775198464",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchWithRecognizeLinkedEntitiesOptionsStatisticsTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchWithRecognizeLinkedEntitiesOptionsStatisticsTestAsync.json
new file mode 100644
index 0000000000000..06149fdeb7257
--- /dev/null
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/RecognizeLinkedEntitiesTests/RecognizeLinkedEntitiesBatchWithRecognizeLinkedEntitiesOptionsStatisticsTestAsync.json
@@ -0,0 +1,176 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://ta-s-westeurope.cognitiveservices.azure.com/text/analytics/v3.1-preview.4/entities/linking?showStats=true\u0026stringIndexType=Utf16CodeUnit",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Accept": "application/json, text/json",
+ "Content-Length": "190",
+ "Content-Type": "application/json",
+ "Ocp-Apim-Subscription-Key": "Sanitized",
+ "traceparent": "00-95f67674ad4fb44081d09f1041236c3b-9fa5ef699193254a-00",
+ "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210224.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )",
+ "x-ms-client-request-id": "c81f2c7c8424b466b144609b6251448a",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "documents": [
+ {
+ "id": "1",
+ "text": "Microsoft was founded by Bill Gates and Paul Allen.",
+ "language": "en"
+ },
+ {
+ "id": "3",
+ "text": "Microsoft fue fundado por Bill Gates y Paul Allen.",
+ "language": "es"
+ }
+ ]
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "apim-request-id": "d5449c39-e433-4454-bffe-390bc877401c",
+ "Content-Type": "application/json; charset=utf-8",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=2",
+ "Date": "Wed, 24 Feb 2021 16:57:38 GMT",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
+ "Transfer-Encoding": "chunked",
+ "x-content-type-options": "nosniff",
+ "x-envoy-upstream-service-time": "24"
+ },
+ "ResponseBody": {
+ "statistics": {
+ "documentsCount": 2,
+ "validDocumentsCount": 2,
+ "erroneousDocumentsCount": 0,
+ "transactionsCount": 2
+ },
+ "documents": [
+ {
+ "id": "1",
+ "statistics": {
+ "charactersCount": 51,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "a093e9b9-90f5-a3d5-c4b8-5855e1b01f85",
+ "name": "Microsoft",
+ "matches": [
+ {
+ "text": "Microsoft",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.49
+ }
+ ],
+ "language": "en",
+ "id": "Microsoft",
+ "url": "https://en.wikipedia.org/wiki/Microsoft",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "0d47c987-0042-5576-15e8-97af601614fa",
+ "name": "Bill Gates",
+ "matches": [
+ {
+ "text": "Bill Gates",
+ "offset": 25,
+ "length": 10,
+ "confidenceScore": 0.52
+ }
+ ],
+ "language": "en",
+ "id": "Bill Gates",
+ "url": "https://en.wikipedia.org/wiki/Bill_Gates",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "df2c4376-9923-6a54-893f-2ee5a5badbc7",
+ "name": "Paul Allen",
+ "matches": [
+ {
+ "text": "Paul Allen",
+ "offset": 40,
+ "length": 10,
+ "confidenceScore": 0.54
+ }
+ ],
+ "language": "en",
+ "id": "Paul Allen",
+ "url": "https://en.wikipedia.org/wiki/Paul_Allen",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ },
+ {
+ "id": "3",
+ "statistics": {
+ "charactersCount": 50,
+ "transactionsCount": 1
+ },
+ "entities": [
+ {
+ "bingId": "a093e9b9-90f5-a3d5-c4b8-5855e1b01f85",
+ "name": "Microsoft",
+ "matches": [
+ {
+ "text": "Microsoft",
+ "offset": 0,
+ "length": 9,
+ "confidenceScore": 0.38
+ }
+ ],
+ "language": "es",
+ "id": "Microsoft",
+ "url": "https://es.wikipedia.org/wiki/Microsoft",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "0d47c987-0042-5576-15e8-97af601614fa",
+ "name": "Bill Gates",
+ "matches": [
+ {
+ "text": "Bill Gates",
+ "offset": 26,
+ "length": 10,
+ "confidenceScore": 0.37
+ }
+ ],
+ "language": "es",
+ "id": "Bill Gates",
+ "url": "https://es.wikipedia.org/wiki/Bill_Gates",
+ "dataSource": "Wikipedia"
+ },
+ {
+ "bingId": "df2c4376-9923-6a54-893f-2ee5a5badbc7",
+ "name": "Paul Allen",
+ "matches": [
+ {
+ "text": "Paul Allen",
+ "offset": 39,
+ "length": 10,
+ "confidenceScore": 0.9
+ }
+ ],
+ "language": "es",
+ "id": "Paul Allen",
+ "url": "https://es.wikipedia.org/wiki/Paul_Allen",
+ "dataSource": "Wikipedia"
+ }
+ ],
+ "warnings": []
+ }
+ ],
+ "errors": [],
+ "modelVersion": "2020-02-01"
+ }
+ }
+ ],
+ "Variables": {
+ "RandomSeed": "1369620328",
+ "TEXT_ANALYTICS_API_KEY": "Sanitized",
+ "TEXT_ANALYTICS_ENDPOINT": "https://ta-s-westeurope.cognitiveservices.azure.com"
+ }
+}
\ No newline at end of file
diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientTests.cs
index 84c5a1ce94bb0..b9001a3c63f5e 100644
--- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientTests.cs
+++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/TextAnalyticsClientTests.cs
@@ -38,67 +38,111 @@ public void CreateClientArgumentValidation()
[Test]
public void DetectLanguageArgumentValidation()
{
- var documents = new List();
Assert.ThrowsAsync(() => Client.DetectLanguageAsync(""));
- Assert.ThrowsAsync(() => Client.DetectLanguageAsync((string)null));
- Assert.ThrowsAsync(() => Client.DetectLanguageBatchAsync((List)null));
- Assert.ThrowsAsync(() => Client.DetectLanguageBatchAsync(documents));
+ Assert.ThrowsAsync(() => Client.DetectLanguageAsync(null));
+ Assert.ThrowsAsync(() => Client.DetectLanguageBatchAsync((string[])null));
+ Assert.ThrowsAsync(() => Client.DetectLanguageBatchAsync((DetectLanguageInput[])null));
+ Assert.ThrowsAsync(() => Client.DetectLanguageBatchAsync(Array.Empty()));
+ Assert.ThrowsAsync(() => Client.DetectLanguageBatchAsync(Array.Empty()));
Assert.ThrowsAsync(() => Client.DetectLanguageBatchAsync(null, new TextAnalyticsRequestOptions()));
}
[Test]
public void RecognizeEntitiesArgumentValidation()
{
- var documents = new List();
Assert.ThrowsAsync(() => Client.RecognizeEntitiesAsync(""));
- Assert.ThrowsAsync(() => Client.RecognizeEntitiesAsync((string)null));
- Assert.ThrowsAsync(() => Client.RecognizeEntitiesBatchAsync((List)null));
- Assert.ThrowsAsync(() => Client.RecognizeEntitiesBatchAsync(documents));
- Assert.ThrowsAsync(() => Client.RecognizeEntitiesBatchAsync(null, new TextAnalyticsRequestOptions()));
+ Assert.ThrowsAsync(() => Client.RecognizeEntitiesAsync(null));
+ Assert.ThrowsAsync(() => Client.RecognizeEntitiesBatchAsync((string[])null));
+ Assert.ThrowsAsync(() => Client.RecognizeEntitiesBatchAsync((TextDocumentInput[])null));
+ Assert.ThrowsAsync(() => Client.RecognizeEntitiesBatchAsync(Array.Empty()));
+ Assert.ThrowsAsync