Skip to content

Commit

Permalink
added 2.1 preview SDK for text analytics (Azure#4872)
Browse files Browse the repository at this point in the history
* added 2.1 preview SDK for text analytics

* added 2.1 preview SDK for text analytics

* separated two versions into two different projects

* changed generate powershell script for the preview sdk

* added 2.1 preview SDK for text analytics

* based on PR commanets changed the number of SDK's to one

* fixed test project errors

* fixed test project errors

* fixed test project errors

* fixed test project errors

* fixed the log errors

* changed the version name and package notes
  • Loading branch information
laramume authored and Ashraf Hamad committed Oct 31, 2018
1 parent 685ad6c commit ddfb671
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 66 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Entries": [
{
"RequestUri": "/text/analytics/v2.0/languages",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjAvbGFuZ3VhZ2Vz",
"RequestUri": "/text/analytics/v2.1-preview/languages",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9sYW5ndWFnZXM=",
"RequestMethod": "POST",
"RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"id\": \"id\",\r\n \"text\": \"I love my team mates\"\r\n }\r\n ]\r\n}",
"RequestHeaders": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Entries": [
{
"RequestUri": "/text/analytics/v2.0/entities",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjAvZW50aXRpZXM=",
"RequestUri": "/text/analytics/v2.1-preview/entities",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9lbnRpdGllcw==",
"RequestMethod": "POST",
"RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"language\": \"en\",\r\n \"id\": \"id\",\r\n \"text\": \"Microsoft released Windows 10\"\r\n }\r\n ]\r\n}",
"RequestHeaders": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Entries": [
{
"RequestUri": "/text/analytics/v2.0/keyPhrases",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjAva2V5UGhyYXNlcw==",
"RequestUri": "/text/analytics/v2.1-preview/keyPhrases",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9rZXlQaHJhc2Vz",
"RequestMethod": "POST",
"RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"language\": \"en\",\r\n \"id\": \"id\",\r\n \"text\": \"I love my team mates\"\r\n }\r\n ]\r\n}",
"RequestHeaders": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Entries": [
{
"RequestUri": "/text/analytics/v2.0/sentiment",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjAvc2VudGltZW50",
"RequestUri": "/text/analytics/v2.1-preview/sentiment",
"EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9zZW50aW1lbnQ=",
"RequestMethod": "POST",
"RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"language\": \"en\",\r\n \"id\": \"id\",\r\n \"text\": \"I love my team mates\"\r\n }\r\n ]\r\n}",
"RequestHeaders": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public async Task Entities()
{
HttpMockServer.Initialize(this.GetType().FullName, "Entities");
ITextAnalyticsClient client = GetClient(HttpMockServer.CreateInstance());
EntitiesBatchResult result = await client.EntitiesAsync(
EntitiesBatchResultV2dot1 result = await client.EntitiesAsync(
new MultiLanguageBatchInput(
new List<MultiLanguageInput>()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,25 @@ public partial interface ITextAnalyticsClient : System.IDisposable
/// The API returns a list of recognized entities in a given document.
/// </summary>
/// <remarks>
/// The API returns a list of recognized entities in a given document.
/// To get even more information on each recognized entity we recommend
/// using the Bing Entity Search API by querying for the recognized
/// entities names. See the &lt;a
/// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages"&gt;Supported
/// languages in Text Analytics API&lt;/a&gt; for the list of enabled
/// languages.The API returns a list of known entities and general
/// named entities ("Person", "Location", "Organization" etc) in a
/// given document. Known entities are returned with Wikipedia Id and
/// Wikipedia link, and also Bing Id which can be used in Bing Entity
/// Search API. General named entities are returned with entity types.
/// If a general named entity is also a known entity, then all
/// information regarding it (Wikipedia Id, Bing Id, entity type etc)
/// will be returned. See the &lt;a
/// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking#supported-types-for-named-entity-recognition"&gt;Supported
/// Entity Types in Text Analytics API&lt;/a&gt; for the list of
/// supported Entity Types. See the &lt;a
/// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages"&gt;Supported
/// languages in Text Analytics API&lt;/a&gt; for the list of enabled
/// languages.
/// </remarks>
/// <param name='input'>
Expand All @@ -140,7 +154,7 @@ public partial interface ITextAnalyticsClient : System.IDisposable
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<HttpOperationResponse<EntitiesBatchResult>> EntitiesWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<HttpOperationResponse<EntitiesBatchResultV2dot1>> EntitiesWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models
using System.Collections.Generic;
using System.Linq;

public partial class EntitiesBatchResultItem
public partial class EntitiesBatchResultItemV2dot1
{
/// <summary>
/// Initializes a new instance of the EntitiesBatchResultItem class.
/// Initializes a new instance of the EntitiesBatchResultItemV2dot1
/// class.
/// </summary>
public EntitiesBatchResultItem()
public EntitiesBatchResultItemV2dot1()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the EntitiesBatchResultItem class.
/// Initializes a new instance of the EntitiesBatchResultItemV2dot1
/// class.
/// </summary>
/// <param name="id">Unique document identifier.</param>
/// <param name="entities">Recognized entities in the document.</param>
public EntitiesBatchResultItem(string id = default(string), IList<EntityRecord> entities = default(IList<EntityRecord>))
public EntitiesBatchResultItemV2dot1(string id = default(string), IList<EntityRecordV2dot1> entities = default(IList<EntityRecordV2dot1>))
{
Id = id;
Entities = entities;
Expand All @@ -52,7 +54,7 @@ public EntitiesBatchResultItem()
/// Gets recognized entities in the document.
/// </summary>
[JsonProperty(PropertyName = "entities")]
public IList<EntityRecord> Entities { get; private set; }
public IList<EntityRecordV2dot1> Entities { get; private set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models
using System.Collections.Generic;
using System.Linq;

public partial class EntitiesBatchResult
public partial class EntitiesBatchResultV2dot1
{
/// <summary>
/// Initializes a new instance of the EntitiesBatchResult class.
/// Initializes a new instance of the EntitiesBatchResultV2dot1 class.
/// </summary>
public EntitiesBatchResult()
public EntitiesBatchResultV2dot1()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the EntitiesBatchResult class.
/// Initializes a new instance of the EntitiesBatchResultV2dot1 class.
/// </summary>
public EntitiesBatchResult(IList<EntitiesBatchResultItem> documents = default(IList<EntitiesBatchResultItem>), IList<ErrorRecord> errors = default(IList<ErrorRecord>))
public EntitiesBatchResultV2dot1(IList<EntitiesBatchResultItemV2dot1> documents = default(IList<EntitiesBatchResultItemV2dot1>), IList<ErrorRecord> errors = default(IList<ErrorRecord>))
{
Documents = documents;
Errors = errors;
Expand All @@ -43,7 +43,7 @@ public EntitiesBatchResult()
/// <summary>
/// </summary>
[JsonProperty(PropertyName = "documents")]
public IList<EntitiesBatchResultItem> Documents { get; private set; }
public IList<EntitiesBatchResultItemV2dot1> Documents { get; private set; }

/// <summary>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models
using System.Collections.Generic;
using System.Linq;

public partial class EntityRecord
public partial class EntityRecordV2dot1
{
/// <summary>
/// Initializes a new instance of the EntityRecord class.
/// Initializes a new instance of the EntityRecordV2dot1 class.
/// </summary>
public EntityRecord()
public EntityRecordV2dot1()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the EntityRecord class.
/// Initializes a new instance of the EntityRecordV2dot1 class.
/// </summary>
/// <param name="name">Entity formal name.</param>
/// <param name="matches">List of instances this entity appears in the
Expand All @@ -40,14 +40,20 @@ public EntityRecord()
/// <param name="bingId">Bing unique identifier of the recognized
/// entity. Use in conjunction with the Bing Entity Search API to fetch
/// additional relevant information.</param>
public EntityRecord(string name = default(string), IList<MatchRecord> matches = default(IList<MatchRecord>), string wikipediaLanguage = default(string), string wikipediaId = default(string), string wikipediaUrl = default(string), string bingId = default(string))
/// <param name="type">Entity type from Named Entity Recognition
/// model</param>
/// <param name="subType">Entity sub type from Named Entity Recognition
/// model</param>
public EntityRecordV2dot1(string name = default(string), IList<MatchRecordV2dot1> matches = default(IList<MatchRecordV2dot1>), string wikipediaLanguage = default(string), string wikipediaId = default(string), string wikipediaUrl = default(string), string bingId = default(string), string type = default(string), string subType = default(string))
{
Name = name;
Matches = matches;
WikipediaLanguage = wikipediaLanguage;
WikipediaId = wikipediaId;
WikipediaUrl = wikipediaUrl;
BingId = bingId;
Type = type;
SubType = subType;
CustomInit();
}

Expand All @@ -63,10 +69,10 @@ public EntityRecord()
public string Name { get; set; }

/// <summary>
/// Gets list of instances this entity appears in the text.
/// Gets or sets list of instances this entity appears in the text.
/// </summary>
[JsonProperty(PropertyName = "matches")]
public IList<MatchRecord> Matches { get; private set; }
public IList<MatchRecordV2dot1> Matches { get; set; }

/// <summary>
/// Gets or sets wikipedia language for which the WikipediaId and
Expand Down Expand Up @@ -95,5 +101,17 @@ public EntityRecord()
[JsonProperty(PropertyName = "bingId")]
public string BingId { get; set; }

/// <summary>
/// Gets or sets entity type from Named Entity Recognition model
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; set; }

/// <summary>
/// Gets or sets entity sub type from Named Entity Recognition model
/// </summary>
[JsonProperty(PropertyName = "subType")]
public string SubType { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models
using Newtonsoft.Json;
using System.Linq;

public partial class MatchRecord
public partial class MatchRecordV2dot1
{
/// <summary>
/// Initializes a new instance of the MatchRecord class.
/// Initializes a new instance of the MatchRecordV2dot1 class.
/// </summary>
public MatchRecord()
public MatchRecordV2dot1()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the MatchRecord class.
/// Initializes a new instance of the MatchRecordV2dot1 class.
/// </summary>
/// <param name="text">Entity text as appears in the request.</param>
/// <param name="offset">Start position (in Unicode characters) for the
/// entity match text.</param>
/// <param name="length">Length (in Unicode characters) for the entity
/// match text.</param>
public MatchRecord(string text = default(string), int? offset = default(int?), int? length = default(int?))
public MatchRecordV2dot1(string text = default(string), int? offset = default(int?), int? length = default(int?))
{
Text = text;
Offset = offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_TextAnalyticsCl
{
return new Tuple<string, string, string>[]
{
new Tuple<string, string, string>("TextAnalyticsClient", "Detect Language", "v2.0"),
new Tuple<string, string, string>("TextAnalyticsClient", "Entities", "v2.0"),
new Tuple<string, string, string>("TextAnalyticsClient", "Key Phrases", "v2.0"),
new Tuple<string, string, string>("TextAnalyticsClient", "Sentiment", "v2.0"),
new Tuple<string, string, string>("TextAnalyticsClient", "Detect Language", "v2.1-preview"),
new Tuple<string, string, string>("TextAnalyticsClient", "Entities", "v2.1-preview"),
new Tuple<string, string, string>("TextAnalyticsClient", "Key Phrases", "v2.1-preview"),
new Tuple<string, string, string>("TextAnalyticsClient", "Sentiment", "v2.1-preview"),
}.AsEnumerable();
}
}
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/TextAnalytics/readme.md --csharp --version=latest --reflect-api-versions --tag=release_2_1 --csharp.output-folder=C:\\mygitrepo\\azure-sdk-for-net\\src\\SDKs\\CognitiveServices\\dataPlane\\Language\\TextAnalytics\\TextAnalytics\\Generated\\TextAnalytics";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "9c1fe12b46cd05f44ed40a9e4bc25205cc343667";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
}
}

Loading

0 comments on commit ddfb671

Please sign in to comment.