Skip to content

Commit

Permalink
Releasing version 51.2.0
Browse files Browse the repository at this point in the history
Releasing version 51.2.0
  • Loading branch information
oci-dex-release-bot committed Jan 24, 2023
2 parents 6cafdec + 00c833f commit f596286
Show file tree
Hide file tree
Showing 90 changed files with 5,450 additions and 98 deletions.
89 changes: 83 additions & 6 deletions Ailanguage/AIServiceLanguageClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,68 @@ public async Task<BatchDetectLanguageKeyPhrasesResponse> BatchDetectLanguageKeyP
}
}

/// <summary>
/// The API extracts pii entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned. It supports passing a batch of records.
/// &lt;br/&gt;
/// Limitations:
/// - A batch may have up to 100 records.
/// - A record may be up to 5000 characters long.
/// - The total of characters to process in a request can be up to 20,000 characters.
///
/// </summary>
/// <param name="request">The request object containing the details to send. Required.</param>
/// <param name="retryConfiguration">The retry configuration that will be used by to send this request. Optional.</param>
/// <param name="cancellationToken">The cancellation token to cancel this operation. Optional.</param>
/// <param name="completionOption">The completion option for this operation. Optional.</param>
/// <returns>A response object containing details about the completed operation</returns>
/// <example>Click <a href="https://docs.cloud.oracle.com/en-us/iaas/tools/dot-net-examples/latest/ailanguage/BatchDetectLanguagePiiEntities.cs.html">here</a> to see an example of how to use BatchDetectLanguagePiiEntities API.</example>
public async Task<BatchDetectLanguagePiiEntitiesResponse> BatchDetectLanguagePiiEntities(BatchDetectLanguagePiiEntitiesRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
{
logger.Trace("Called batchDetectLanguagePiiEntities");
Uri uri = new Uri(this.restClient.GetEndpoint(), System.IO.Path.Combine(basePathWithoutHost, "/actions/batchDetectLanguagePiiEntities".Trim('/')));
HttpMethod method = new HttpMethod("POST");
HttpRequestMessage requestMessage = Converter.ToHttpRequestMessage(uri, method, request);
requestMessage.Headers.Add("Accept", "application/json");
GenericRetrier retryingClient = Retrier.GetPreferredRetrier(retryConfiguration, this.retryConfiguration);
HttpResponseMessage responseMessage;

try
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
if (retryingClient != null)
{
responseMessage = await retryingClient.MakeRetryingCall(this.restClient.HttpSend, requestMessage, completionOption, cancellationToken).ConfigureAwait(false);
}
else
{
responseMessage = await this.restClient.HttpSend(requestMessage, completionOption: completionOption).ConfigureAwait(false);
}
stopWatch.Stop();
ApiDetails apiDetails = new ApiDetails
{
ServiceName = "AIServiceLanguage",
OperationName = "BatchDetectLanguagePiiEntities",
RequestEndpoint = $"{method.Method} {requestMessage.RequestUri}",
ApiReferenceLink = "https://docs.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguagePiiEntities/BatchDetectLanguagePiiEntities",
UserAgent = this.GetUserAgent()
};
this.restClient.CheckHttpResponseMessage(requestMessage, responseMessage, apiDetails);
logger.Debug($"Total Latency for this API call is: {stopWatch.ElapsedMilliseconds} ms");
return Converter.FromHttpResponseMessage<BatchDetectLanguagePiiEntitiesResponse>(responseMessage);
}
catch (OciException e)
{
logger.Error(e);
throw;
}
catch (Exception e)
{
logger.Error($"BatchDetectLanguagePiiEntities failed with error: {e.Message}");
throw;
}
}

/// <summary>
/// The API extracts aspect-based and sentence level sentiment in text records.
/// &lt;br/&gt;
Expand Down Expand Up @@ -961,9 +1023,12 @@ public async Task<DeleteProjectResponse> DeleteProject(DeleteProjectRequest requ
}

/// <summary>
/// The API returns the detected language and a related confidence score (between 0 and 1).
/// **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
/// We recommend you replace this API with the batch API, [BatchDetectDominantLanguage](https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectDominantLanguage/BatchDetectDominantLanguage).
/// &lt;br/&gt;
/// [List of supported languages.](https://docs.cloud.oracle.com/iaas/language/using/pretrain-models.htm#lang-detect)
/// The DetectDominantLanguage API returns the detected language and a related confidence score (between 0 and 1).
/// &lt;br/&gt;
/// [List of supported languages](https://docs.cloud.oracle.com/iaas/language/using/pretrain-models.htm#lang-detect)
/// &lt;br/&gt;
/// Limitations:
/// - A record may be up to 1000 characters long.
Expand Down Expand Up @@ -1023,7 +1088,10 @@ public async Task<DetectDominantLanguageResponse> DetectDominantLanguage(DetectD
}

/// <summary>
/// The API extracts entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned.
/// **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
/// We recommend you replace this API with the batch API, [BatchDetectLanguageEntities](https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageEntities/BatchDetectLanguageEntities).
/// &lt;br/&gt;
/// The DetectLanguageEntities API extracts entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned.
/// &lt;br/&gt;
/// Limitations:
/// - A text may be up to 1000 characters long.
Expand Down Expand Up @@ -1083,7 +1151,10 @@ public async Task<DetectLanguageEntitiesResponse> DetectLanguageEntities(DetectL
}

/// <summary>
/// The API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text.
/// **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
/// We recommend you replace this API with the batch API, [BatchDetectLanguageKeyPhrases](https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageKeyPhrases/BatchDetectLanguageKeyPhrases).
/// &lt;br/&gt;
/// The DetectLanguageKeyPhrases API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text.
/// &lt;br/&gt;
/// Limitations:
/// - A record may be up to 1000 characters long.
Expand Down Expand Up @@ -1143,7 +1214,10 @@ public async Task<DetectLanguageKeyPhrasesResponse> DetectLanguageKeyPhrases(Det
}

/// <summary>
/// The API extracts aspect-based in text records.
/// **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
/// We recommend you replace this API with the batch API, [BatchDetectLanguageSentiments](https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageSentiments/BatchDetectLanguageSentiments).
/// &lt;br/&gt;
/// The DetectLanguageSentiments API extracts aspect-based in text records.
/// &lt;br/&gt;
/// For aspect-based sentiment analysis, a set of aspects and their respective sentiment is returned.
/// &lt;br/&gt;
Expand Down Expand Up @@ -1209,7 +1283,10 @@ public async Task<DetectLanguageSentimentsResponse> DetectLanguageSentiments(Det
}

/// <summary>
/// The API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified.
/// **Deprecated**: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
/// We recommend you replace this API with the batch API, [BatchDetectLanguageTextClassification](https://docs.cloud.oracle.com/iaas/api/#/en/language/20221001/BatchDetectLanguageTextClassification/BatchDetectLanguageTextClassification).
/// &lt;br/&gt;
/// The DetectLanguageTextClassification API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified.
/// &lt;br/&gt;
/// Learn more about text classification [here](https://docs.cloud.oracle.com/iaas/language/using/pretrain-models.htm#text-class).
/// &lt;br/&gt;
Expand Down
47 changes: 47 additions & 0 deletions Ailanguage/models/BatchDetectLanguagePiiEntitiesDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/

// NOTE: Code generated by OracleSDKGenerator.
// DO NOT EDIT this file manually.


using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;


namespace Oci.AilanguageService.Models
{
/// <summary>
/// The documents details to detect personal identification information.
/// </summary>
public class BatchDetectLanguagePiiEntitiesDetails
{

/// <value>
/// The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that calls the API, inference will be served from pre trained model
/// </value>
[JsonProperty(PropertyName = "compartmentId")]
public string CompartmentId { get; set; }

/// <value>
/// List of documents to detect personal identification information.
/// </value>
/// <remarks>
/// Required
/// </remarks>
[Required(ErrorMessage = "Documents is required.")]
[JsonProperty(PropertyName = "documents")]
public System.Collections.Generic.List<TextDocument> Documents { get; set; }

/// <value>
/// Mask recognized PII entities with different modes.
/// </value>
[JsonProperty(PropertyName = "masking")]
public System.Collections.Generic.Dictionary<string, PiiEntityMasking> Masking { get; set; }

}
}
41 changes: 41 additions & 0 deletions Ailanguage/models/BatchDetectLanguagePiiEntitiesResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/

// NOTE: Code generated by OracleSDKGenerator.
// DO NOT EDIT this file manually.


using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;


namespace Oci.AilanguageService.Models
{
/// <summary>
/// Result of batch detect personal identification.
/// </summary>
public class BatchDetectLanguagePiiEntitiesResult
{

/// <value>
/// List of succeeded document response.
/// </value>
/// <remarks>
/// Required
/// </remarks>
[Required(ErrorMessage = "Documents is required.")]
[JsonProperty(PropertyName = "documents")]
public System.Collections.Generic.List<PiiEntityDocumentResult> Documents { get; set; }

/// <value>
/// List of failed document response.
/// </value>
[JsonProperty(PropertyName = "errors")]
public System.Collections.Generic.List<DocumentError> Errors { get; set; }

}
}
55 changes: 55 additions & 0 deletions Ailanguage/models/PiiEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/

// NOTE: Code generated by OracleSDKGenerator.
// DO NOT EDIT this file manually.


using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;


namespace Oci.AilanguageService.Models
{
/// <summary>
/// PII entity object.
/// </summary>
public class PiiEntity
{

/// <value>
/// The number of Unicode code points preceding this entity in the submitted text.
/// </value>
[JsonProperty(PropertyName = "offset")]
public System.Nullable<int> Offset { get; set; }

/// <value>
/// Length of PII entity text.
/// </value>
[JsonProperty(PropertyName = "length")]
public System.Nullable<int> Length { get; set; }

/// <value>
/// Entity text like name of person, Organization and so on.
/// </value>
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }

/// <value>
/// Type of PII entity text like PER, LOC.
/// </value>
[JsonProperty(PropertyName = "type")]
public string Type { get; set; }

/// <value>
/// Score or confidence for detected PII entity.
/// </value>
[JsonProperty(PropertyName = "score")]
public System.Double Score { get; set; }

}
}
65 changes: 65 additions & 0 deletions Ailanguage/models/PiiEntityDocumentResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/

// NOTE: Code generated by OracleSDKGenerator.
// DO NOT EDIT this file manually.


using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;


namespace Oci.AilanguageService.Models
{
/// <summary>
/// The document response for batch detect personal identification.
/// </summary>
public class PiiEntityDocumentResult
{

/// <value>
/// Document unique identifier defined by the user.
/// </value>
/// <remarks>
/// Required
/// </remarks>
[Required(ErrorMessage = "Key is required.")]
[JsonProperty(PropertyName = "key")]
public string Key { get; set; }

/// <value>
/// List of batch detect personal identification.
/// </value>
/// <remarks>
/// Required
/// </remarks>
[Required(ErrorMessage = "Entities is required.")]
[JsonProperty(PropertyName = "entities")]
public System.Collections.Generic.List<PiiEntity> Entities { get; set; }

/// <value>
/// Masked text per given mask mode.
/// </value>
/// <remarks>
/// Required
/// </remarks>
[Required(ErrorMessage = "MaskedText is required.")]
[JsonProperty(PropertyName = "maskedText")]
public string MaskedText { get; set; }

/// <value>
/// Language code per the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) standard.
/// </value>
/// <remarks>
/// Required
/// </remarks>
[Required(ErrorMessage = "LanguageCode is required.")]
[JsonProperty(PropertyName = "languageCode")]
public string LanguageCode { get; set; }

}
}
48 changes: 48 additions & 0 deletions Ailanguage/models/PiiEntityMask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/

// NOTE: Code generated by OracleSDKGenerator.
// DO NOT EDIT this file manually.


using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;


namespace Oci.AilanguageService.Models
{
/// <summary>
/// Mask PII entities with the given masking character.
/// </summary>
public class PiiEntityMask : PiiEntityMasking
{

/// <value>
/// Masking character. By default, the character is an asterisk (*)
/// </value>
[JsonProperty(PropertyName = "maskingCharacter")]
public string MaskingCharacter { get; set; }

/// <value>
/// Number of characters to leave unmasked. By default, the whole entity is masked.
/// </value>
[JsonProperty(PropertyName = "leaveCharactersUnmasked")]
public System.Nullable<int> LeaveCharactersUnmasked { get; set; }

/// <value>
/// Unmask from the end. By default, the whole entity is masked. This field works in concert with
/// leaveCharactersUnmasked. For example, leaveCharactersUnmasked is 3 and isUnmaskedFromEnd is true,
/// then if the entity is India the masked entity/result is **dia.
///
/// </value>
[JsonProperty(PropertyName = "isUnmaskedFromEnd")]
public System.Nullable<bool> IsUnmaskedFromEnd { get; set; }

[JsonProperty(PropertyName = "mode")]
private readonly string mode = "MASK";
}
}
Loading

0 comments on commit f596286

Please sign in to comment.