Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
- Added support for service version `3.0`. This can be specified in the `TextAnalyticsClientOptions` object under the `ServiceVersion` enum. By default the SDK targets latest supported service version.
- Added value `None` to enum `PiiEntityDomainType` to allow user to specify no domain.
- Added property `ActionName` to all `xxActions` input types so user can specify a name per action. If not provided, service will generate a name.
- Added property `ActionName` to all `xxActionResult` output types that displays the name of each action.
- Added property `ActionName` to all `xxActionResult` output types that displays the name of each action.
- Added new overload methods to all `xxActions` types that take a `xxOptions` object to facilitate a transition from a singular method to an actions method.
- The parameter `CategoriesFilter` in `RecognizePiiEntitiesActions` has been enabled for `StartAnalyzeActions` methods.

### Breaking changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal AnalyzeHealthcareEntitiesResultCollection() : base (default(System.Coll
public partial class AnalyzeSentimentAction
{
public AnalyzeSentimentAction() { }
public AnalyzeSentimentAction(Azure.AI.TextAnalytics.AnalyzeSentimentOptions options) { }
Comment thread
maririos marked this conversation as resolved.
public string ActionName { get { throw null; } set { } }
public bool? DisableServiceLogs { get { throw null; } set { } }
public bool? IncludeOpinionMining { get { throw null; } set { } }
Expand Down Expand Up @@ -231,6 +232,7 @@ internal EntityDataSource() { }
public partial class ExtractKeyPhrasesAction
{
public ExtractKeyPhrasesAction() { }
public ExtractKeyPhrasesAction(Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options) { }
public string ActionName { get { throw null; } set { } }
public bool? DisableServiceLogs { get { throw null; } set { } }
public string ModelVersion { get { throw null; } set { } }
Expand Down Expand Up @@ -612,6 +614,7 @@ public enum PiiEntityDomain
public partial class RecognizeEntitiesAction
{
public RecognizeEntitiesAction() { }
public RecognizeEntitiesAction(Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options) { }
public string ActionName { get { throw null; } set { } }
public bool? DisableServiceLogs { get { throw null; } set { } }
public string ModelVersion { get { throw null; } set { } }
Expand All @@ -636,6 +639,7 @@ internal RecognizeEntitiesResultCollection() : base (default(System.Collections.
public partial class RecognizeLinkedEntitiesAction
{
public RecognizeLinkedEntitiesAction() { }
public RecognizeLinkedEntitiesAction(Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options) { }
public string ActionName { get { throw null; } set { } }
public bool? DisableServiceLogs { get { throw null; } set { } }
public string ModelVersion { get { throw null; } set { } }
Expand All @@ -660,6 +664,7 @@ internal RecognizeLinkedEntitiesResultCollection() : base (default(System.Collec
public partial class RecognizePiiEntitiesAction
{
public RecognizePiiEntitiesAction() { }
public RecognizePiiEntitiesAction(Azure.AI.TextAnalytics.RecognizePiiEntitiesOptions options) { }
public string ActionName { get { throw null; } set { } }
public System.Collections.Generic.IList<Azure.AI.TextAnalytics.PiiEntityCategory> CategoriesFilter { get { throw null; } }
public bool? DisableServiceLogs { get { throw null; } set { } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ public AnalyzeSentimentAction()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AnalyzeSentimentAction"/>
/// class based on the values of a <see cref="AnalyzeSentimentOptions"/>.
/// It sets the <see cref="ModelVersion"/>, the <see cref="DisableServiceLogs"/>,
/// and the <see cref="IncludeOpinionMining"/> properties.
/// </summary>
public AnalyzeSentimentAction(AnalyzeSentimentOptions options)
{
ModelVersion = options.ModelVersion;
DisableServiceLogs = options.DisableServiceLogs;
IncludeOpinionMining = options.IncludeOpinionMining;
}

/// <summary>
/// Gets or sets a value that, if set, indicates the version of the text
/// analytics model that will be used to generate the result. For supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ public ExtractKeyPhrasesAction()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="ExtractKeyPhrasesAction"/>
/// class based on the values of a <see cref="TextAnalyticsRequestOptions"/>.
/// It sets the <see cref="ModelVersion"/> and <see cref="DisableServiceLogs"/> properties.
/// </summary>
public ExtractKeyPhrasesAction(TextAnalyticsRequestOptions options)
{
ModelVersion = options.ModelVersion;
DisableServiceLogs = options.DisableServiceLogs;
}

/// <summary>
/// Gets or sets a value that, if set, indicates the version of the text
/// analytics model that will be used to generate the result. For supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ public RecognizeEntitiesAction()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="RecognizeEntitiesAction"/>
/// class based on the values of a <see cref="TextAnalyticsRequestOptions"/>.
/// It sets the <see cref="ModelVersion"/> and <see cref="DisableServiceLogs"/> properties.
/// </summary>
public RecognizeEntitiesAction(TextAnalyticsRequestOptions options)
{
ModelVersion = options.ModelVersion;
DisableServiceLogs = options.DisableServiceLogs;
}

/// <summary>
/// Gets or sets a value that, if set, indicates the version of the text
/// analytics model that will be used to generate the result. For supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ public RecognizeLinkedEntitiesAction()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="RecognizeLinkedEntitiesAction"/>
/// class based on the values of a <see cref="TextAnalyticsRequestOptions"/>.
/// It sets the <see cref="ModelVersion"/> and <see cref="DisableServiceLogs"/> properties.
/// </summary>
public RecognizeLinkedEntitiesAction(TextAnalyticsRequestOptions options)
{
ModelVersion = options.ModelVersion;
DisableServiceLogs = options.DisableServiceLogs;
}

/// <summary>
/// Gets or sets a value that, if set, indicates the version of the text
/// analytics model that will be used to generate the result. For supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ public RecognizePiiEntitiesAction()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="RecognizePiiEntitiesAction"/>
/// class based on the values of a <see cref="RecognizePiiEntitiesOptions"/>.
/// It sets the <see cref="ModelVersion"/>, <see cref="DisableServiceLogs"/>,
/// <see cref="DomainFilter"/>, and <see cref="CategoriesFilter"/> properties.
/// </summary>
public RecognizePiiEntitiesAction(RecognizePiiEntitiesOptions options)
{
ModelVersion = options.ModelVersion;
DisableServiceLogs = options.DisableServiceLogs;
DomainFilter = options.DomainFilter;
if (options.CategoriesFilter.Count > 0)
{
CategoriesFilter = new List<PiiEntityCategory>(options.CategoriesFilter);
}
}

/// <summary>
/// Gets or sets a value that, if set, indicates the version of the text
/// analytics model that will be used to generate the result. For supported
Expand Down
22 changes: 14 additions & 8 deletions sdk/textanalytics/Azure.AI.TextAnalytics/src/Transforms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,22 @@ private static int ParseHealthcareEntityIndex(string reference)

internal static PiiTask ConvertToPiiTask(RecognizePiiEntitiesAction action)
{
var parameters = new PiiTaskParameters()
{
Domain = action.DomainFilter.GetString() ?? (PiiTaskParametersDomain?)null,
Comment thread
maririos marked this conversation as resolved.
ModelVersion = action.ModelVersion,
StringIndexType = Constants.DefaultStringIndexType,
LoggingOptOut = action.DisableServiceLogs
};

if (action.CategoriesFilter.Count > 0)
Comment thread
maririos marked this conversation as resolved.
{
parameters.PiiCategories = action.CategoriesFilter;
}

return new PiiTask()
{
Parameters = new PiiTaskParameters()
{
Domain = action.DomainFilter.GetString() ?? (PiiTaskParametersDomain?)null,
ModelVersion = action.ModelVersion,
StringIndexType = Constants.DefaultStringIndexType,
LoggingOptOut = action.DisableServiceLogs,
PiiCategories = action.CategoriesFilter
},
Parameters = parameters,
TaskName = action.ActionName
};
}
Expand Down
Loading