diff --git a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/TextAnalyticsClient.java b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/TextAnalyticsClient.java index 1e9da3748598..e522e00aaae9 100644 --- a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/TextAnalyticsClient.java +++ b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/TextAnalyticsClient.java @@ -9,7 +9,7 @@ package com.microsoft.azure.cognitiveservices.language.textanalytics; import com.microsoft.azure.AzureClient; -import com.microsoft.azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResult; +import com.microsoft.azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultV2dot1; import com.microsoft.azure.cognitiveservices.language.textanalytics.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.textanalytics.models.Input; import com.microsoft.azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResult; @@ -353,83 +353,83 @@ public interface TextAnalyticsClient { /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the EntitiesBatchResult object if successful. + * @return the EntitiesBatchResultV2dot1 object if successful. */ - EntitiesBatchResult entities(); + EntitiesBatchResultV2dot1 entities(); /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - ServiceFuture entitiesAsync(final ServiceCallback serviceCallback); + ServiceFuture entitiesAsync(final ServiceCallback serviceCallback); /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - Observable entitiesAsync(); + Observable entitiesAsync(); /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - Observable> entitiesWithServiceResponseAsync(); + Observable> entitiesWithServiceResponseAsync(); /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param documents the List<MultiLanguageInput> value * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the EntitiesBatchResult object if successful. + * @return the EntitiesBatchResultV2dot1 object if successful. */ - EntitiesBatchResult entities(List documents); + EntitiesBatchResultV2dot1 entities(List documents); /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param documents the List<MultiLanguageInput> value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - ServiceFuture entitiesAsync(List documents, final ServiceCallback serviceCallback); + ServiceFuture entitiesAsync(List documents, final ServiceCallback serviceCallback); /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param documents the List<MultiLanguageInput> value * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - Observable entitiesAsync(List documents); + Observable entitiesAsync(List documents); /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param documents the List<MultiLanguageInput> value * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - Observable> entitiesWithServiceResponseAsync(List documents); + Observable> entitiesWithServiceResponseAsync(List documents); } diff --git a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsClientImpl.java b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsClientImpl.java index 67b41d0a86d6..e9b70ca0c105 100644 --- a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsClientImpl.java +++ b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsClientImpl.java @@ -13,7 +13,7 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; import com.microsoft.azure.cognitiveservices.language.textanalytics.models.BatchInput; -import com.microsoft.azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResult; +import com.microsoft.azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultV2dot1; import com.microsoft.azure.cognitiveservices.language.textanalytics.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.textanalytics.models.Input; import com.microsoft.azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResult; @@ -154,7 +154,7 @@ public TextAnalyticsClientImpl withGenerateClientRequestId(boolean generateClien * @param credentials the management credentials for Azure */ public TextAnalyticsClientImpl(ServiceClientCredentials credentials) { - this("https://{Endpoint}/text/analytics/v2.0", credentials); + this("https://{Endpoint}/text/analytics/v2.1-preview", credentials); } /** @@ -193,7 +193,7 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "TextAnalyticsClient", "v2.0"); + return String.format("%s (%s, %s)", super.userAgent(), "TextAnalyticsClient", "v2.1-preview"); } private void initializeService() { @@ -678,40 +678,40 @@ private ServiceResponse sentimentDelegate(Response entitiesAsync(final ServiceCallback serviceCallback) { + public ServiceFuture entitiesAsync(final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(entitiesWithServiceResponseAsync(), serviceCallback); } /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - public Observable entitiesAsync() { - return entitiesWithServiceResponseAsync().map(new Func1, EntitiesBatchResult>() { + public Observable entitiesAsync() { + return entitiesWithServiceResponseAsync().map(new Func1, EntitiesBatchResultV2dot1>() { @Override - public EntitiesBatchResult call(ServiceResponse response) { + public EntitiesBatchResultV2dot1 call(ServiceResponse response) { return response.body(); } }); @@ -719,12 +719,12 @@ public EntitiesBatchResult call(ServiceResponse response) { /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - public Observable> entitiesWithServiceResponseAsync() { + public Observable> entitiesWithServiceResponseAsync() { if (this.endpoint() == null) { throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); } @@ -733,11 +733,11 @@ public Observable> entitiesWithServiceRespo input.withDocuments(null); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); return service.entities(this.acceptLanguage(), input, parameterizedHost, this.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = entitiesDelegate(response); + ServiceResponse clientResponse = entitiesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -748,43 +748,43 @@ public Observable> call(Response documents) { + public EntitiesBatchResultV2dot1 entities(List documents) { return entitiesWithServiceResponseAsync(documents).toBlocking().single().body(); } /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param documents the List<MultiLanguageInput> value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture entitiesAsync(List documents, final ServiceCallback serviceCallback) { + public ServiceFuture entitiesAsync(List documents, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(entitiesWithServiceResponseAsync(documents), serviceCallback); } /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param documents the List<MultiLanguageInput> value * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - public Observable entitiesAsync(List documents) { - return entitiesWithServiceResponseAsync(documents).map(new Func1, EntitiesBatchResult>() { + public Observable entitiesAsync(List documents) { + return entitiesWithServiceResponseAsync(documents).map(new Func1, EntitiesBatchResultV2dot1>() { @Override - public EntitiesBatchResult call(ServiceResponse response) { + public EntitiesBatchResultV2dot1 call(ServiceResponse response) { return response.body(); } }); @@ -792,13 +792,13 @@ public EntitiesBatchResult call(ServiceResponse response) { /** * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. + * 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 <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> 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 <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">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported languages in Text Analytics API</a> for the list of enabled languages. * * @param documents the List<MultiLanguageInput> value * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EntitiesBatchResult object + * @return the observable to the EntitiesBatchResultV2dot1 object */ - public Observable> entitiesWithServiceResponseAsync(List documents) { + public Observable> entitiesWithServiceResponseAsync(List documents) { if (this.endpoint() == null) { throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); } @@ -807,11 +807,11 @@ public Observable> entitiesWithServiceRespo input.withDocuments(documents); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); return service.entities(this.acceptLanguage(), input, parameterizedHost, this.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = entitiesDelegate(response); + ServiceResponse clientResponse = entitiesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -820,9 +820,9 @@ public Observable> call(Response entitiesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse entitiesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } diff --git a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntitiesBatchResultItemV2dot1.java b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntitiesBatchResultItemV2dot1.java new file mode 100644 index 000000000000..fb8114862cb5 --- /dev/null +++ b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntitiesBatchResultItemV2dot1.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.language.textanalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EntitiesBatchResultItemV2dot1 model. + */ +public class EntitiesBatchResultItemV2dot1 { + /** + * Unique document identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Recognized entities in the document. + */ + @JsonProperty(value = "entities", access = JsonProperty.Access.WRITE_ONLY) + private List entities; + + /** + * Get unique document identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get recognized entities in the document. + * + * @return the entities value + */ + public List entities() { + return this.entities; + } + +} diff --git a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntitiesBatchResultV2dot1.java b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntitiesBatchResultV2dot1.java new file mode 100644 index 000000000000..8642cdf13b8a --- /dev/null +++ b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntitiesBatchResultV2dot1.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.language.textanalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EntitiesBatchResultV2dot1 model. + */ +public class EntitiesBatchResultV2dot1 { + /** + * The documents property. + */ + @JsonProperty(value = "documents", access = JsonProperty.Access.WRITE_ONLY) + private List documents; + + /** + * The errors property. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * Get the documents value. + * + * @return the documents value + */ + public List documents() { + return this.documents; + } + + /** + * Get the errors value. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + +} diff --git a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntityRecordV2dot1.java b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntityRecordV2dot1.java new file mode 100644 index 000000000000..190ab86e1578 --- /dev/null +++ b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/EntityRecordV2dot1.java @@ -0,0 +1,216 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.language.textanalytics.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EntityRecordV2dot1 model. + */ +public class EntityRecordV2dot1 { + /** + * Entity formal name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * List of instances this entity appears in the text. + */ + @JsonProperty(value = "matches") + private List matches; + + /** + * Wikipedia language for which the WikipediaId and WikipediaUrl refers to. + */ + @JsonProperty(value = "wikipediaLanguage") + private String wikipediaLanguage; + + /** + * Wikipedia unique identifier of the recognized entity. + */ + @JsonProperty(value = "wikipediaId") + private String wikipediaId; + + /** + * URL for the entity's English Wikipedia page. + */ + @JsonProperty(value = "wikipediaUrl", access = JsonProperty.Access.WRITE_ONLY) + private String wikipediaUrl; + + /** + * Bing unique identifier of the recognized entity. Use in conjunction with + * the Bing Entity Search API to fetch additional relevant information. + */ + @JsonProperty(value = "bingId") + private String bingId; + + /** + * Entity type from Named Entity Recognition model. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Entity sub type from Named Entity Recognition model. + */ + @JsonProperty(value = "subType") + private String subType; + + /** + * Get entity formal name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set entity formal name. + * + * @param name the name value to set + * @return the EntityRecordV2dot1 object itself. + */ + public EntityRecordV2dot1 withName(String name) { + this.name = name; + return this; + } + + /** + * Get list of instances this entity appears in the text. + * + * @return the matches value + */ + public List matches() { + return this.matches; + } + + /** + * Set list of instances this entity appears in the text. + * + * @param matches the matches value to set + * @return the EntityRecordV2dot1 object itself. + */ + public EntityRecordV2dot1 withMatches(List matches) { + this.matches = matches; + return this; + } + + /** + * Get wikipedia language for which the WikipediaId and WikipediaUrl refers to. + * + * @return the wikipediaLanguage value + */ + public String wikipediaLanguage() { + return this.wikipediaLanguage; + } + + /** + * Set wikipedia language for which the WikipediaId and WikipediaUrl refers to. + * + * @param wikipediaLanguage the wikipediaLanguage value to set + * @return the EntityRecordV2dot1 object itself. + */ + public EntityRecordV2dot1 withWikipediaLanguage(String wikipediaLanguage) { + this.wikipediaLanguage = wikipediaLanguage; + return this; + } + + /** + * Get wikipedia unique identifier of the recognized entity. + * + * @return the wikipediaId value + */ + public String wikipediaId() { + return this.wikipediaId; + } + + /** + * Set wikipedia unique identifier of the recognized entity. + * + * @param wikipediaId the wikipediaId value to set + * @return the EntityRecordV2dot1 object itself. + */ + public EntityRecordV2dot1 withWikipediaId(String wikipediaId) { + this.wikipediaId = wikipediaId; + return this; + } + + /** + * Get uRL for the entity's English Wikipedia page. + * + * @return the wikipediaUrl value + */ + public String wikipediaUrl() { + return this.wikipediaUrl; + } + + /** + * Get bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information. + * + * @return the bingId value + */ + public String bingId() { + return this.bingId; + } + + /** + * Set bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information. + * + * @param bingId the bingId value to set + * @return the EntityRecordV2dot1 object itself. + */ + public EntityRecordV2dot1 withBingId(String bingId) { + this.bingId = bingId; + return this; + } + + /** + * Get entity type from Named Entity Recognition model. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set entity type from Named Entity Recognition model. + * + * @param type the type value to set + * @return the EntityRecordV2dot1 object itself. + */ + public EntityRecordV2dot1 withType(String type) { + this.type = type; + return this; + } + + /** + * Get entity sub type from Named Entity Recognition model. + * + * @return the subType value + */ + public String subType() { + return this.subType; + } + + /** + * Set entity sub type from Named Entity Recognition model. + * + * @param subType the subType value to set + * @return the EntityRecordV2dot1 object itself. + */ + public EntityRecordV2dot1 withSubType(String subType) { + this.subType = subType; + return this; + } + +} diff --git a/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/MatchRecordV2dot1.java b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/MatchRecordV2dot1.java new file mode 100644 index 000000000000..24528a27c715 --- /dev/null +++ b/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/models/MatchRecordV2dot1.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.language.textanalytics.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The MatchRecordV2dot1 model. + */ +public class MatchRecordV2dot1 { + /** + * Entity text as appears in the request. + */ + @JsonProperty(value = "text") + private String text; + + /** + * Start position (in Unicode characters) for the entity match text. + */ + @JsonProperty(value = "offset") + private Integer offset; + + /** + * Length (in Unicode characters) for the entity match text. + */ + @JsonProperty(value = "length") + private Integer length; + + /** + * Get entity text as appears in the request. + * + * @return the text value + */ + public String text() { + return this.text; + } + + /** + * Set entity text as appears in the request. + * + * @param text the text value to set + * @return the MatchRecordV2dot1 object itself. + */ + public MatchRecordV2dot1 withText(String text) { + this.text = text; + return this; + } + + /** + * Get start position (in Unicode characters) for the entity match text. + * + * @return the offset value + */ + public Integer offset() { + return this.offset; + } + + /** + * Set start position (in Unicode characters) for the entity match text. + * + * @param offset the offset value to set + * @return the MatchRecordV2dot1 object itself. + */ + public MatchRecordV2dot1 withOffset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Get length (in Unicode characters) for the entity match text. + * + * @return the length value + */ + public Integer length() { + return this.length; + } + + /** + * Set length (in Unicode characters) for the entity match text. + * + * @param length the length value to set + * @return the MatchRecordV2dot1 object itself. + */ + public MatchRecordV2dot1 withLength(Integer length) { + this.length = length; + return this; + } + +}