Skip to content

Commit

Permalink
Update readme for TA, after release review meeting (#11754)
Browse files Browse the repository at this point in the history
- update the README based on the feedback, fixes: #11752, fixes: #11825, fixes: #6765
  • Loading branch information
mssfang authored Jun 6, 2020
1 parent 6d80cdf commit e94e5e7
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 107 deletions.
1 change: 1 addition & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ known_content_issues:
- ['sdk/batch/microsoft-azure-batch/README.md', '#3113']
- ['sdk/boms/azure-sdk-bom/README.md', '#3113']
- ['sdk/core/README.md', '#3113']
- ['sdk/cognitiveservices/ms-azure-cs-textanalytics/README.md', '#3113']
- ['sdk/cosmos/changelog/README.md', '#3113']
- ['sdk/cosmos/faq/README.md', '#3113']
- ['sdk/cosmos/azure-cosmos-benchmark/README.md', '#3113']
Expand Down
2 changes: 1 addition & 1 deletion eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-textanalytics</artifactId>
<version>1.0.0-beta.6</version> <!-- {x-version-update;com.azure:azure-ai-textanalytics;current} -->
<version>1.0.0</version> <!-- {x-version-update;com.azure:azure-ai-textanalytics;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ com.azure:azure-sdk-all;1.0.0;1.0.0
com.azure:azure-sdk-parent;1.6.0;1.6.0
com.azure:azure-client-sdk-parent;1.7.0;1.7.0
com.azure:azure-ai-formrecognizer;1.0.0-beta.2;1.0.0-beta.3
com.azure:azure-ai-textanalytics;1.0.0-beta.5;1.0.0-beta.6
com.azure:azure-ai-textanalytics;1.0.0-beta.5;1.0.0
com.azure:azure-core;1.5.0;1.6.0-beta.1
com.azure:azure-core-amqp;1.1.2;1.2.0-beta.1
com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1
Expand Down
22 changes: 22 additions & 0 deletions sdk/cognitiveservices/ms-azure-cs-textanalytics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Microsoft Azure Text Analytics Client SDK library for Java

**NOTE:** This is a legacy version that works with the V2.1 version of the service API. For the new set of libraries
that support newer service versions please see
[azure-ai-textanalytics](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/textanalytics/azure-ai-textanalytics).

This is the Microsoft Azure Cognitive Services Text Analytics Client
Library.

## Usage

For code examples, see [Cognitive Services Text
Analytics](https://docs.microsoft.com/java/api/overview/azure/cognitiveservices/client/textanalytics?view=azure-java-stable)
on docs.microsoft.com.

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in
the [Issues](https://github.com/Azure/azure-sdk-for-java/issues)
section of the project.

![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fazure-cognitiveservices-language-textanalytics%2FREADME.png)
4 changes: 2 additions & 2 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Release History

## 1.0.0-beta.6 (Unreleased)

## 1.0.0 (2020-06-09)
- First stable release of `azure-ai-textanalytics`.

## 1.0.0-beta.5 (2020-05-27)
**New features**
Expand Down
90 changes: 30 additions & 60 deletions sdk/textanalytics/azure-ai-textanalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ and includes six main functions:
- [Azure Subscription][azure_subscription]
- [Cognitive Services or Text Analytics account][text_analytics_account] to use this package.

### Include the Package
**Note:** This version targets Azure Text Analytics service API version v3.0.

[//]: # ({x-version-update-start;com.azure:azure-ai-textanalytics;current})
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-textanalytics</artifactId>
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})
### Authenticate the client
#### Create a Cognitive Services or Text Analytics resource
Text Analytics supports both [multi-service and single-service access][service_access]. Create a Cognitive Services
resource if you plan to access multiple cognitive services under a single endpoint/key. For Text Analytics access only,
Expand Down Expand Up @@ -59,21 +46,36 @@ az cognitiveservices account create \
--location westus2 \
--yes
```

### Include the Package
**Note:** This version targets Azure Text Analytics service API version v3.0.

[//]: # ({x-version-update-start;com.azure:azure-ai-textanalytics;current})
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-textanalytics</artifactId>
<version>1.0.0</version>
</dependency>
```
[//]: # ({x-version-update-end})

### Authenticate the client
In order to interact with the Text Analytics service, you will need to create an instance of the Text Analytics client,
both the asynchronous and synchronous clients can be created by using `TextAnalyticsClientBuilder` invoking `buildClient()`
creates a synchronous client while `buildAsyncClient()` creates its asynchronous counterpart.

You will need an **endpoint** and either a **key** or **AAD TokenCredential** to instantiate a client object.

##### Looking up the endpoint
#### Looking up the endpoint
You can find the **endpoint** for your Text Analytics resource in the [Azure Portal][azure_portal] under the "Keys and Endpoint",
or [Azure CLI][azure_cli_endpoint].
```bash
# Get the endpoint for the text analytics resource
az cognitiveservices account show --name "resource-name" --resource-group "resource-group-name" --query "endpoint"
```

##### Create a Text Analytics client with key credential
#### Create a Text Analytics client with key credential
Once you have the value for the [key][key], provide it as a string to the [AzureKeyCredential][azure_key_credential].
This can be found in the [Azure Portal][azure_portal] under the "Keys and Endpoint" section in your created Text Analytics
resource or by running the following Azure CLI command:
Expand Down Expand Up @@ -102,7 +104,7 @@ TextAnalyticsClient textAnalyticsClient = new TextAnalyticsClientBuilder()

credential.update("{new_key}");
```
##### Create a Text Analytics client with Azure Active Directory credential
#### Create a Text Analytics client with Azure Active Directory credential
Azure SDK for Java supports an Azure Identity package, making it easy to get credentials from Microsoft identity
platform.

Expand Down Expand Up @@ -140,7 +142,7 @@ TextAnalyticsAsyncClient textAnalyticsClient = new TextAnalyticsClientBuilder()
```

## Key concepts
### Client
### Text Analytics client
The Text Analytics client library provides a [TextAnalyticsClient][text_analytics_sync_client] and
[TextAnalyticsAsyncClient][text_analytics_async_client] to do analysis on batches of documents. It provides both synchronous and
asynchronous operations to access a specific use of Text Analytics, such as language detection or key phrase extraction.
Expand Down Expand Up @@ -177,38 +179,6 @@ version of the operation and statistics of the batch documents.
**Note**: It is recommended to use the batch methods when working on production environments as they allow you to send one
request with multiple documents. This is more performant than sending a request per each document.

The following are types of text analysis that the service offers:

1. [Sentiment Analysis][sentiment_analysis]

Use sentiment analysis to find out what customers think of your brand or topic by analyzing raw text for clues about positive or negative sentiment.
The returned scores represent the model's confidence that the text is either positive, negative, or neutral. Higher values signify higher confidence.
Sentiment analysis returns scores and labels at a document and sentence level.

2. [Named Entity Recognition][named_entity_recognition]

Use named entity recognition (NER) to identify different entities in text and categorize them into pre-defined classes, or types.
Entity recognition in the client library provides three different methods depending on what you are interested in.
* `recognizeEntities()` can be used to identify and categorize entities in your text as people, places, organizations, date/time, quantities, percentages, currencies, and more.
* `recognizeLinkedEntities()` can be used to identify and disambiguate the identity of an entity found in text (For example, determining whether
"Mars" is being used as the planet or as the Roman god of war). This process uses Wikipedia as the knowledge base to which recognized entities are linked.

See a full list of [Named Entity Recognition Types][named_entity_recognition_types].

3. [Language Detection][language_detection]

Detect the language of the document and report a single language code for every document submitted on the request.
The language code is paired with a score indicating the strength of the score.
A wide range of languages, variants, dialects, and some regional/cultural languages are supported -
see [supported languages][supported_languages] for full details.

4. [Key Phrase Extraction][key_phrase_extraction]

Extract key phrases to quickly identify the main points in text.
For example, for the document "The food was delicious and there were wonderful staff", the main talking points returned: "food" and "wonderful staff".

See [Language and regional support][language_regional_support] for what is currently available for each operation.

## Examples
The following sections provide several code snippets covering some of the most common text analytics tasks, including:

Expand Down Expand Up @@ -394,19 +364,19 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[service_access]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows
[service_input_limitation]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview#data-limits
[sentiment_analysis]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis
[source_code]: src
[source_code]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/textanalytics/azure-ai-textanalytics/src
[supported_languages]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support#language-detection
[text_analytics_account]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows
[text_analytics_async_client]: src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
[text_analytics_sync_client]: src/main/java/com/azure/ai/textanalytics/TextAnalyticsClient.java
[text_analytics_async_client]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
[text_analytics_sync_client]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsClient.java
[wiki_identity]: https://github.com/Azure/azure-sdk-for-java/wiki/Identity-and-Authentication
[LogLevels]: ../../core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java

[samples_readme]: src/samples/README.md
[detect_language_sample]: src/samples/java/com/azure/ai/textanalytics/batch/DetectLanguageBatchDocuments.java
[analyze_sentiment_sample]: src/samples/java/com/azure/ai/textanalytics/batch/AnalyzeSentimentBatchDocuments.java
[extract_key_phrases_sample]: src/samples/java/com/azure/ai/textanalytics/batch/ExtractKeyPhrasesBatchDocuments.java
[recognize_entities_sample]: src/samples/java/com/azure/ai/textanalytics/batch/RecognizeEntitiesBatchDocuments.java
[recognize_linked_entities_sample]: src/samples/java/com/azure/ai/textanalytics/batch/RecognizeLinkedEntitiesBatchDocuments.java
[LogLevels]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java

[samples_readme]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/README.md
[detect_language_sample]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/batch/DetectLanguageBatchDocuments.java
[analyze_sentiment_sample]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/batch/AnalyzeSentimentBatchDocuments.java
[extract_key_phrases_sample]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/batch/ExtractKeyPhrasesBatchDocuments.java
[recognize_entities_sample]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/batch/RecognizeEntitiesBatchDocuments.java
[recognize_linked_entities_sample]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/batch/RecognizeLinkedEntitiesBatchDocuments.java

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Ftextanalytics%2Fazure-ai-textanalytics%2FREADME.png)
2 changes: 1 addition & 1 deletion sdk/textanalytics/azure-ai-textanalytics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>com.azure</groupId>
<artifactId>azure-ai-textanalytics</artifactId>
<version>1.0.0-beta.6</version> <!-- {x-version-update;com.azure:azure-ai-textanalytics;current} -->
<version>1.0.0</version> <!-- {x-version-update;com.azure:azure-ai-textanalytics;current} -->

<name>Microsoft Azure client library for Text Analytics</name>
<description>This package contains the Microsoft Azure Cognitive Services Text Analytics SDK.</description>
Expand Down
Loading

0 comments on commit e94e5e7

Please sign in to comment.