/// <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);
     }
 }
Ejemplo n.º 2
0
 internal static PiiTask ConvertToPiiTask(RecognizePiiEntitiesOptions option)
 {
     return(new PiiTask()
     {
         Parameters = new PiiTaskParameters()
         {
             Domain = option.DomainFilter.GetString(),
             ModelVersion = !string.IsNullOrEmpty(option.ModelVersion) ? option.ModelVersion : "latest",
             StringIndexType = option.StringIndexType
         }
     });
 }
Ejemplo n.º 3
0
 internal static PiiTask ConvertToPiiTask(RecognizePiiEntitiesOptions option)
 {
     return(new PiiTask()
     {
         Parameters = new PiiTaskParameters()
         {
             Domain = option.DomainFilter.HasValue ? option.DomainFilter.Value.GetString() : (PiiTaskParametersDomain?)null,
             ModelVersion = !string.IsNullOrEmpty(option.ModelVersion) ? option.ModelVersion : "latest",
             StringIndexType = option.StringIndexType,
             LoggingOptOut = option.DisableServiceLogs
                             // Categories are not enabled because of https://github.com/Azure/azure-sdk-for-net/issues/19237
         }
     });
 }