Skip to content

Commit

Permalink
[TA] Add action types (#21197)
Browse files Browse the repository at this point in the history
* add action types

* add ,
  • Loading branch information
maririos authored May 19, 2021
1 parent 0f765b9 commit 9322654
Show file tree
Hide file tree
Showing 25 changed files with 293 additions and 149 deletions.
6 changes: 6 additions & 0 deletions sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
- Renamed `AnalyzeBatchActionsOperation` to `AnalyzeActionsOperation`.
- Renamed `AnalyzeBatchActionsResult` to `AnalyzeActionsResult`.
- Renamed `AnalyzeBatchActionsOptions` to `AnalyzeActionsOptions`.
- `TextAnalyticsActions` now takes `xxAction` types, instead of `xxOptions` types. Renames and types are as follow:
- `ExtractKeyPhrasesOptions` changed to new type `ExtractKeyPhrasesActions`.
- `RecognizeEntitiesOptions` changed to new type `RecognizeEntitiesActions`.
- `RecognizePiiEntitiesOptions` changed to new type `RecognizePiiEntitiesActions`.
- `RecognizeLinkedEntitiesOptions` changed to new type `RecognizeLinkedEntitiesActions`.
- `AnalyzeSentimentOptions` changed to new type `AnalyzeSentimentActions`.

## 5.1.0-beta.7 (2021-05-18)
### New features
Expand Down
10 changes: 5 additions & 5 deletions sdk/textanalytics/Azure.AI.TextAnalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,11 @@ This functionality allows running multiple actions in one or more documents. Act

TextAnalyticsActions actions = new TextAnalyticsActions()
{
ExtractKeyPhrasesOptions = new List<ExtractKeyPhrasesOptions>() { new ExtractKeyPhrasesOptions() },
RecognizeEntitiesOptions = new List<RecognizeEntitiesOptions>() { new RecognizeEntitiesOptions() },
RecognizePiiEntitiesOptions = new List<RecognizePiiEntitiesOptions>() { new RecognizePiiEntitiesOptions() },
RecognizeLinkedEntitiesOptions = new List<RecognizeLinkedEntitiesOptions>() { new RecognizeLinkedEntitiesOptions() },
AnalyzeSentimentOptions = new List<AnalyzeSentimentOptions>() { new AnalyzeSentimentOptions() },
ExtractKeyPhrasesActions = new List<ExtractKeyPhrasesAction>() { new ExtractKeyPhrasesAction() },
RecognizeEntitiesActions = new List<RecognizeEntitiesAction>() { new RecognizeEntitiesAction() },
RecognizePiiEntitiesActions = new List<RecognizePiiEntitiesAction>() { new RecognizePiiEntitiesAction() },
RecognizeLinkedEntitiesActions = new List<RecognizeLinkedEntitiesAction>() { new RecognizeLinkedEntitiesAction() },
AnalyzeSentimentActions = new List<AnalyzeSentimentAction>() { new AnalyzeSentimentAction() },
DisplayName = "AnalyzeOperationSample"
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ internal AnalyzeHealthcareEntitiesResultCollection() : base (default(System.Coll
public string ModelVersion { get { throw null; } }
public Azure.AI.TextAnalytics.TextDocumentBatchStatistics Statistics { get { throw null; } }
}
public partial class AnalyzeSentimentAction : Azure.AI.TextAnalytics.AnalyzeSentimentOptions
{
public AnalyzeSentimentAction() { }
}
public partial class AnalyzeSentimentActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionDetails
{
internal AnalyzeSentimentActionResult() { }
Expand Down Expand Up @@ -218,6 +222,10 @@ internal EntityDataSource() { }
public string EntityId { get { throw null; } }
public string Name { get { throw null; } }
}
public partial class ExtractKeyPhrasesAction : Azure.AI.TextAnalytics.ExtractKeyPhrasesOptions
{
public ExtractKeyPhrasesAction() { }
}
public partial class ExtractKeyPhrasesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionDetails
{
internal ExtractKeyPhrasesActionResult() { }
Expand Down Expand Up @@ -558,6 +566,10 @@ public enum PiiEntityDomainType
{
ProtectedHealthInformation = 0,
}
public partial class RecognizeEntitiesAction : Azure.AI.TextAnalytics.RecognizeEntitiesOptions
{
public RecognizeEntitiesAction() { }
}
public partial class RecognizeEntitiesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionDetails
{
internal RecognizeEntitiesActionResult() { }
Expand All @@ -578,6 +590,10 @@ internal RecognizeEntitiesResultCollection() : base (default(System.Collections.
public string ModelVersion { get { throw null; } }
public Azure.AI.TextAnalytics.TextDocumentBatchStatistics Statistics { get { throw null; } }
}
public partial class RecognizeLinkedEntitiesAction : Azure.AI.TextAnalytics.RecognizeLinkedEntitiesOptions
{
public RecognizeLinkedEntitiesAction() { }
}
public partial class RecognizeLinkedEntitiesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionDetails
{
internal RecognizeLinkedEntitiesActionResult() { }
Expand All @@ -598,6 +614,10 @@ internal RecognizeLinkedEntitiesResultCollection() : base (default(System.Collec
public string ModelVersion { get { throw null; } }
public Azure.AI.TextAnalytics.TextDocumentBatchStatistics Statistics { get { throw null; } }
}
public partial class RecognizePiiEntitiesAction : Azure.AI.TextAnalytics.RecognizePiiEntitiesOptions
{
public RecognizePiiEntitiesAction() { }
}
public partial class RecognizePiiEntitiesActionResult : Azure.AI.TextAnalytics.TextAnalyticsActionDetails
{
internal RecognizePiiEntitiesActionResult() { }
Expand Down Expand Up @@ -687,12 +707,12 @@ internal TextAnalyticsActionDetails() { }
public partial class TextAnalyticsActions
{
public TextAnalyticsActions() { }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.AnalyzeSentimentOptions> AnalyzeSentimentOptions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.AnalyzeSentimentAction> AnalyzeSentimentActions { get { throw null; } set { } }
public string DisplayName { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.ExtractKeyPhrasesOptions> ExtractKeyPhrasesOptions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.RecognizeEntitiesOptions> RecognizeEntitiesOptions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.RecognizeLinkedEntitiesOptions> RecognizeLinkedEntitiesOptions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.RecognizePiiEntitiesOptions> RecognizePiiEntitiesOptions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.ExtractKeyPhrasesAction> ExtractKeyPhrasesActions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.RecognizeEntitiesAction> RecognizeEntitiesActions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.RecognizeLinkedEntitiesAction> RecognizeLinkedEntitiesActions { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyCollection<Azure.AI.TextAnalytics.RecognizePiiEntitiesAction> RecognizePiiEntitiesActions { get { throw null; } set { } }
}
public partial class TextAnalyticsClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ To run multiple actions in multiple documents, call `StartAnalyzeActionsAsync` o

TextAnalyticsActions actions = new TextAnalyticsActions()
{
ExtractKeyPhrasesOptions = new List<ExtractKeyPhrasesOptions>() { new ExtractKeyPhrasesOptions() },
RecognizeEntitiesOptions = new List<RecognizeEntitiesOptions>() { new RecognizeEntitiesOptions() },
RecognizePiiEntitiesOptions = new List<RecognizePiiEntitiesOptions>() { new RecognizePiiEntitiesOptions() },
RecognizeLinkedEntitiesOptions = new List<RecognizeLinkedEntitiesOptions>() { new RecognizeLinkedEntitiesOptions() },
AnalyzeSentimentOptions = new List<AnalyzeSentimentOptions>() { new AnalyzeSentimentOptions() },
ExtractKeyPhrasesActions = new List<ExtractKeyPhrasesAction>() { new ExtractKeyPhrasesAction() },
RecognizeEntitiesActions = new List<RecognizeEntitiesAction>() { new RecognizeEntitiesAction() },
RecognizePiiEntitiesActions = new List<RecognizePiiEntitiesAction>() { new RecognizePiiEntitiesAction() },
RecognizeLinkedEntitiesActions = new List<RecognizeLinkedEntitiesAction>() { new RecognizeLinkedEntitiesAction() },
AnalyzeSentimentActions = new List<AnalyzeSentimentAction>() { new AnalyzeSentimentAction() },
DisplayName = "AnalyzeOperationSample"
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Azure.AI.TextAnalytics
/// <summary>
/// Options that allow callers to specify details about how the operation
/// is run and what information is returned from it by the service.
/// <para>For example whether to include statistics.</para>
/// <para>For example, whether to include statistics.</para>
/// </summary>
public class AnalyzeActionsOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Configurations that allow callers to specify details about how to execute
/// an Analyze Sentiment action in a set of documents.
/// For example, execute opinion mining, set model version, and more.
/// </summary>
public class AnalyzeSentimentAction : AnalyzeSentimentOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="AnalyzeSentimentAction"/>
/// class which allows callers to specify details about how to execute
/// an Analyze Sentiment action in a set of documents.
/// For example, execute opinion mining, set model version, and more.
/// </summary>
public AnalyzeSentimentAction()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Options that allow callers to specify details about how the operation
/// is run. For example execute opinion mining, set model version, and whether to include statistics.
/// is run. For example, execute opinion mining, set model version,
/// whether to include statistics, and more.
/// </summary>
public class AnalyzeSentimentOptions : TextAnalyticsRequestOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="AnalyzeSentimentOptions"/>
/// class which allows callers to specify details about how the operation
/// is run. For example execute opinion mining, set model version, and whether to include statistics.
/// is run. For example, execute opinion mining, set model version,
/// whether to include statistics, and more.
/// </summary>
public AnalyzeSentimentOptions()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Configurations that allow callers to specify details about how to execute
/// an Extract KeyPhrases action in a set of documents.
/// For example, set model version, disable service logging, and more.
/// </summary>
public class ExtractKeyPhrasesAction : ExtractKeyPhrasesOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="ExtractKeyPhrasesAction"/>
/// class which allows callers to specify details about how to execute
/// an Extract KeyPhrases action in a set of documents.
/// For example, set model version, disable service logging, and more.
/// </summary>
public ExtractKeyPhrasesAction()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Options that allow callers to specify details about how the operation
/// is run. For example set model version and whether to include statistics.
/// is run. For example, set model version, whether to include statistics, and more.
/// </summary>
public class ExtractKeyPhrasesOptions : TextAnalyticsRequestOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="ExtractKeyPhrasesOptions"/>
/// class which allows callers to specify details about how the operation
/// is run. For example set model version, whether to include statistics.
/// is run. For example, set model version, whether to include statistics, and more.
/// </summary>
public ExtractKeyPhrasesOptions()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Configurations that allow callers to specify details about how to execute
/// a Recognize Entities action in a set of documents.
/// For example, set model version, disable service logging, and more.
/// </summary>
public class RecognizeEntitiesAction : RecognizeEntitiesOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeEntitiesAction"/>
/// class which allows callers to specify details about how to execute
/// a Recognize Entities action in a set of documents.
/// For example, set model version, disable service logging, and more.
/// </summary>
public RecognizeEntitiesAction()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Options that allow callers to specify details about how the operation
/// is run. For example set model version, whether to include statistics.
/// is run. For example, set model version, whether to include statistics, and more.
/// </summary>
public class RecognizeEntitiesOptions : TextAnalyticsRequestOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeEntitiesOptions"/>
/// class which allows callers to specify details about how the operation
/// is run. For example set model version, whether to include statistics.
/// is run. For example, set model version, whether to include statistics, and more.
/// </summary>
public RecognizeEntitiesOptions()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Configurations that allow callers to specify details about how to execute
/// a Recognize Linked Entities action in a set of documents.
/// For example, set model version, disable service logging, and more.
/// </summary>
public class RecognizeLinkedEntitiesAction : RecognizeLinkedEntitiesOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeLinkedEntitiesAction"/>
/// class which allows callers to specify details about how to execute
/// a Recognize Linked Entities action in a set of documents.
/// For example, set model version, disable service logging, and more.
/// </summary>
public RecognizeLinkedEntitiesAction()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;

namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Options that allow callers to specify details about how the operation
/// is run. For example set model version or whether to include statistics.
/// is run. For example, set model version, whether to include statistics, and more.
/// </summary>
public class RecognizeLinkedEntitiesOptions : TextAnalyticsRequestOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeLinkedEntitiesOptions"/>
/// class which allows callers to specify details about how the operation
/// is run. For example set model version or whether to include statistics.
/// is run. For example, set model version, whether to include statistics, and more.
/// </summary>
public RecognizeLinkedEntitiesOptions()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Configurations that allow callers to specify details about how to execute
/// a Recognize PII Entities action in a set of documents.
/// For example, set model version, filter the response entities by a given
/// domain filter, and more.
/// </summary>
public class RecognizePiiEntitiesAction : RecognizePiiEntitiesOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizePiiEntitiesAction"/>
/// class which allows callers to specify details about how to execute
/// a Recognize PII Entities action in a set of documents.
/// For example, set model version, filter the response entities by a given
/// domain filter, and more.
/// </summary>
public RecognizePiiEntitiesAction()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ namespace Azure.AI.TextAnalytics
{
/// <summary>
/// Options that allow callers to specify details about how the operation
/// is run. For example set model version, whether to include statistics,
/// and filter the response entities by a given domain filter.
/// is run. For example, set model version, whether to include statistics,
/// filter the response entities by a given domain filter, and more.
/// </summary>
public class RecognizePiiEntitiesOptions : TextAnalyticsRequestOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizePiiEntitiesOptions"/>
/// class which allows callers to specify details about how the operation
/// is run. For example set model version, whether to include statistics,
/// and filter the response entities by a given domain filter.
/// is run. For example, set model version, whether to include statistics,
/// filter the response entities by a given domain filter, and more.
/// </summary>
public RecognizePiiEntitiesOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@ namespace Azure.AI.TextAnalytics
public class TextAnalyticsActions
{
/// <summary>
/// Optional display name for the analysis operation.
/// Optional display name for the operation.
/// </summary>
public string DisplayName { get; set; }

/// <summary>
/// Extract KeyPhrases actions configurations.
/// Extract KeyPhrases actions.
/// </summary>
public IReadOnlyCollection<ExtractKeyPhrasesOptions> ExtractKeyPhrasesOptions { get; set; }
public IReadOnlyCollection<ExtractKeyPhrasesAction> ExtractKeyPhrasesActions { get; set; }

/// <summary>
/// Recognize Entities actions configurations.
/// Recognize Entities actions.
/// </summary>
public IReadOnlyCollection<RecognizeEntitiesOptions> RecognizeEntitiesOptions { get; set; }
public IReadOnlyCollection<RecognizeEntitiesAction> RecognizeEntitiesActions { get; set; }

/// <summary>
/// Recognize PII Entities actions configurations.
/// Recognize PII Entities actions.
/// </summary>
public IReadOnlyCollection<RecognizePiiEntitiesOptions> RecognizePiiEntitiesOptions { get; set; }
public IReadOnlyCollection<RecognizePiiEntitiesAction> RecognizePiiEntitiesActions { get; set; }

/// <summary>
/// Recognize Linked Entities actions configurations.
/// Recognize Linked Entities actions.
/// </summary>
public IReadOnlyCollection<RecognizeLinkedEntitiesOptions> RecognizeLinkedEntitiesOptions { get; set; }
public IReadOnlyCollection<RecognizeLinkedEntitiesAction> RecognizeLinkedEntitiesActions { get; set; }

/// <summary>
/// Analyze Sentiment actions configurations.
/// Analyze Sentiment actions.
/// </summary>
public IReadOnlyCollection<AnalyzeSentimentOptions> AnalyzeSentimentOptions { get; set; }
public IReadOnlyCollection<AnalyzeSentimentAction> AnalyzeSentimentActions { get; set; }
}
}
Loading

0 comments on commit 9322654

Please sign in to comment.