diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md index aaf022ef3804..aa682eccfe63 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md +++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md @@ -1,5 +1,5 @@ # Release History -## Version 1.0.0-beta.1 (2020-01-06) +## Version 1.0.0-beta.1 ((Unreleased)) For details on the Azure SDK for Java (January 2020 Preview) release refer to the [release announcement](). - Initial release of this module. diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md index 38e48b4efabb..a0be6bba761c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/README.md @@ -324,7 +324,6 @@ for (TextSentiment textSentiment : client.analyzeSentiment(text).getSentenceSent ## Troubleshooting ## General -// TODO (savaity) update exceptions ## Next steps - Samples are explained in detail [here][samples_readme]. diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java index 20038ab7f38b..9843f992f750 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java @@ -282,7 +282,7 @@ Mono>> detectBatchLangua return service.languagesWithRestResponseAsync( languageBatchInput, options == null ? null : options.getModelVersion(), options == null ? null : options.showStatistics(), context) - .doOnSubscribe(ignoredValue -> logger.info("A batch of language input - {}", ignoredValue)) + .doOnSubscribe(ignoredValue -> logger.info("A batch of language input - {}", textInputs.toString())) .doOnSuccess(response -> logger.info("A batch of detected language output - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to detected languages - {}", error)) .map(response -> new SimpleResponse<>(response, toDocumentResultCollection(response.getValue()))); @@ -291,7 +291,7 @@ Mono>> detectBatchLangua // Named Entity /** * Returns a list of general named entities in the provided text. For a list of supported entity types, check: - * For a list of enabled languages, check: + * . For a list of enabled languages, check: * * @param text the text to recognize entities for. * @@ -310,7 +310,7 @@ public Mono recognizeEntities(String text) { /** * Returns a list of general named entities in the provided text. For a list of supported entity types, check: - * For a list of enabled languages, check: + * . For a list of enabled languages, check: * * @param text the text to recognize entities for. * @param language The 2 letter ISO 639-1 representation of language. If not set, uses "en" for English as @@ -441,7 +441,7 @@ Mono>> recognizeBatch batchInput, options == null ? null : options.getModelVersion(), options == null ? null : options.showStatistics(), context) - .doOnSubscribe(ignoredValue -> logger.info("A batch of named entities input - {}", ignoredValue)) + .doOnSubscribe(ignoredValue -> logger.info("A batch of named entities input - {}", textInputs.toString())) .doOnSuccess(response -> logger.info("A batch of named entities output - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to named entities - {}", error)) .map(response -> new SimpleResponse<>(response, toDocumentResultCollection(response.getValue()))); @@ -470,7 +470,7 @@ public Mono recognizePiiEntities(String text) { /** * Returns a list of personal information entities ("SSN", "Bank Account", etc) in the text. For the list of - * supported entity types, check: For a list of enabled languages, + * supported entity types, check: . For a list of enabled languages, * check: . * * @param text the text to recognize PII entities for. @@ -502,7 +502,7 @@ Mono> recognizePiiEntitiesWithResponse(Stri /** * Returns a list of personal information entities ("SSN", "Bank Account", etc) in the list of texts. For the list - * of supported entity types, check: For a list of enabled languages, + * of supported entity types, check: . For a list of enabled languages, * check: for the list of enabled languages. * * @param textInputs A list of text to recognize PII entities for. @@ -524,7 +524,7 @@ public Mono> recognizePiiEn /** * Returns a list of personal information entities ("SSN", "Bank Account", etc) in the list of texts. For the list - * of supported entity types, check For a list of enabled languages, + * of supported entity types, check . For a list of enabled languages, * check: . * * @param textInputs A list of text to recognize PII entities for. @@ -583,7 +583,7 @@ public Mono> recognizeBatch /** * Returns a list of personal information entities ("SSN", "Bank Account", etc) in the batch of document inputs. For - * the list of supported entity types,check: For a list of enabled languages, + * the list of supported entity types,check: . For a list of enabled languages, * check: . * * @param textInputs A list of {@link TextDocumentInput inputs/documents} to recognize PII entities for. @@ -614,7 +614,7 @@ Mono>> recognizeBa batchInput, options == null ? null : options.getModelVersion(), options == null ? null : options.showStatistics(), context) - .doOnSubscribe(ignoredValue -> logger.info("A batch of PII entities input - {}", ignoredValue)) + .doOnSubscribe(ignoredValue -> logger.info("A batch of PII entities input - {}", textInputs.toString())) .doOnSuccess(response -> logger.info("A batch of PII entities output - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to PII entities - {}", error)) .map(response -> new SimpleResponse<>(response, toPiiDocumentResultCollection(response.getValue()))); @@ -785,7 +785,7 @@ Mono>> recogniz batchInput, options == null ? null : options.getModelVersion(), options == null ? null : options.showStatistics(), context) - .doOnSubscribe(ignoredValue -> logger.info("A batch of linked entities input - {}", ignoredValue)) + .doOnSubscribe(ignoredValue -> logger.info("A batch of linked entities input - {}", textInputs.toString())) .doOnSuccess(response -> logger.info("A batch of linked entities output - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to linked entities - {}", error)) .map(response -> new SimpleResponse<>(response, toDocumentResultCollection(response.getValue()))); @@ -950,7 +950,7 @@ Mono>> extractBatchKey batchInput, options == null ? null : options.getModelVersion(), options == null ? null : options.showStatistics(), context) - .doOnSubscribe(ignoredValue -> logger.info("A batch of key phrases input - {}", ignoredValue)) + .doOnSubscribe(ignoredValue -> logger.info("A batch of key phrases input - {}", textInputs.toString())) .doOnSuccess(response -> logger.info("A batch of key phrases output - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to key phrases - {}", error)) .map(response -> new SimpleResponse<>(response, toDocumentResultCollection(response.getValue()))); @@ -1132,7 +1132,7 @@ Mono>> analyzeBatchSen batchInput, options == null ? null : options.getModelVersion(), options == null ? null : options.showStatistics(), context) - .doOnSubscribe(ignoredValue -> logger.info("A batch of text sentiment input - {}", ignoredValue)) + .doOnSubscribe(ignoredValue -> logger.info("A batch of text sentiment input - {}", textInputs.toString())) .doOnSuccess(response -> logger.info("A batch of text sentiment output - {}", response)) .doOnError(error -> logger.warning("Failed to text sentiment - {}", error)) .map(response -> new SimpleResponse<>(response, toDocumentResultCollection(response.getValue()))); diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/DetectLanguageInput.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/DetectLanguageInput.java index 00b1cfb2d3d9..bcb753666b0b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/DetectLanguageInput.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/DetectLanguageInput.java @@ -74,4 +74,10 @@ public String getText() { public String getCountryHint() { return this.countryHint; } + + @Override + public String toString() { + return String.format("Text = %s, Id = %s, Country Hint = %s", + this.getText(), this.getId(), this.getCountryHint()); + } } diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextAnalyticsRequestOptions.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextAnalyticsRequestOptions.java index 791a49d0897d..3aa07c1c411a 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextAnalyticsRequestOptions.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextAnalyticsRequestOptions.java @@ -14,7 +14,7 @@ public final class TextAnalyticsRequestOptions { private boolean showStatistics; /** - * Get the model version + * Gets the version of the text analytics model used by this operation. * * @return the model version */ @@ -23,7 +23,8 @@ public String getModelVersion() { } /** - * Set the model version + * Set the model version. This value indicates which model will be used for scoring, e.g. "latest", "2019-10-01". + * If a model-version is not specified, the API will default to the latest, non-preview version. * * @param modelVersion the model version * @return the TextAnalyticsRequestOptions object itself diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextDocumentInput.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextDocumentInput.java index fa40dfee6a2c..d23b3541b232 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextDocumentInput.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/TextDocumentInput.java @@ -79,4 +79,10 @@ public String getText() { public String getLanguage() { return this.language; } + + @Override + public String toString() { + return String.format("Text = %s, Id = %s, Language = %s", + this.getText(), this.getId(), this.getLanguage()); + } }