Skip to content

Commit

Permalink
[Language Text] Prepare for GA (#23127)
Browse files Browse the repository at this point in the history
* [Language Text] Prepare for GA

* address feedback
  • Loading branch information
deyaaeldeen committed Sep 7, 2022
1 parent d98d442 commit cfd4f6b
Show file tree
Hide file tree
Showing 433 changed files with 37,797 additions and 51,390 deletions.
14 changes: 14 additions & 0 deletions sdk/cognitivelanguage/ai-language-text/CHANGELOG.md
@@ -1,5 +1,19 @@
# Release History

## 1.0.0 (2022-09-08)

### Features Added

- Supports service version 2022-05-01 by default instead of 2022-04-01-preview.

### Breaking Changes

- `AnalyzeBatchPoller` has been updated by removing `isStarted`, `isCanceled`, and `isCompleted`.
- Extractive Summarization action has been removed because it is still in beta. Use @azure/ai-language-text@1.0.0-beta.1 to access this feature.
- FHIR has been removed from healthcare actions because it is still in beta. Use @azure/ai-language-text@1.0.0-beta.1 to access this feature.
- `apiVersion` option in the client class constructor options bag has been renamed to `serviceVersion`.
- `apiVersion` option in the method options bags has been removed.

## 1.0.0-beta.1 (2022-08-11)

- Initial release
55 changes: 2 additions & 53 deletions sdk/cognitivelanguage/ai-language-text/README.md
Expand Up @@ -2,7 +2,7 @@

[Azure Cognitive Service for Language](https://azure.microsoft.com/services/cognitive-services/language-service/) is a cloud-based service that provides advanced natural language processing over raw text, and includes the following main features:

**Note:** This SDK targets Azure Cognitive Service for Language API version 2022-04-01-preview.
**Note:** This SDK targets Azure Cognitive Service for Language API version 2022-05-01.

- Language Detection
- Sentiment Analysis
Expand All @@ -11,7 +11,6 @@
- Recognition of Personally Identifiable Information
- Entity Linking
- Healthcare Analysis
- Extractive Summarization
- Custom Entity Recognition
- Custom Document Classification
- Support Multiple Actions Per Document
Expand Down Expand Up @@ -446,56 +445,6 @@ async function main() {
main();
```

### Extractive Summarization

Extractive summarization identifies sentences that summarize the article they belong to.

```javascript
const {
AzureKeyCredential,
TextAnalysisClient,
} = require("@azure/ai-language-text");

const client = new TextAnalysisClient("<endpoint>", new AzureKeyCredential("<API key>"));

const documents = [
"Prescribed 100mg ibuprofen, taken twice daily.",
"Patient does not suffer from high blood pressure.",
];

async function main() {
const actions = [
{
kind: "ExtractiveSummarization",
maxSentenceCount: 2,
},
];
const poller = await client.beginAnalyzeBatch(actions, documents, "en");
const results = await poller.pollUntilDone();

for await (const actionResult of results) {
if (actionResult.kind !== "ExtractiveSummarization") {
throw new Error(`Expected extractive summarization results but got: ${actionResult.kind}`);
}
if (actionResult.error) {
const { code, message } = actionResult.error;
throw new Error(`Unexpected error (${code}): ${message}`);
}
for (const result of actionResult.results) {
console.log(`- Document ${result.id}`);
if (result.error) {
const { code, message } = result.error;
throw new Error(`Unexpected error (${code}): ${message}`);
}
console.log("Summary:");
console.log(result.sentences.map((sentence) => sentence.text).join("\n"));
}
}
}

main();
```

### Custom Entity Recognition

Recognize and categorize entities in text as entities using custom entity detection models built using [Azure Language Studio][lang_studio].
Expand Down Expand Up @@ -587,7 +536,7 @@ async function main() {
const { code, message } = result.error;
throw new Error(`Unexpected error (${code}): ${message}`);
}
console.log(`\tClassification: ${result.classification.category}`);
console.log(`\tClassification: ${result.classifications[0].category}`);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions sdk/cognitivelanguage/ai-language-text/package.json
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "client",
"author": "Microsoft Corporation",
"description": "An isomorphic client library for the text analysis features in the Azure Cognitive Language Service.",
"version": "1.0.0-beta.1",
"version": "1.0.0",
"keywords": [
"node",
"azure",
Expand Down Expand Up @@ -86,9 +86,9 @@
"@azure/core-auth": "^1.3.0",
"@azure/core-client": "^1.0.0",
"@azure/core-rest-pipeline": "^1.8.1",
"@azure/core-lro": "2.3.0-beta.1",
"@azure/core-lro": "^2.3.0",
"@azure/core-paging": "^1.3.0",
"@azure/core-tracing": "1.0.0",
"@azure/core-tracing": "^1.0.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cfd4f6b

Please sign in to comment.