Skip to content

Commit 68ff36f

Browse files
authored
[Text Analytics] Convenience layer for healthcare and analyze features (Azure#13483)
* [Text Analytics] [3.1-preview.3 design] Exposing job's metadata as part of the poller state for LROs (Azure#13031) * [Text Analytics] Adding job metadata to the healthcare poller * [Text Analytics] Adding job metadata to the analyze poller * address feedback in the api review * address more feedback * make beginAnalyze task arrays required * address feedback * [Text Analytics] Organize healthcare entities as nodes in a graph (Azure#13032) * [Text Analytics] Organize healthcare entities as a graph * address feedback * [Text Analytics] Adds an option to control how lengths and offsets are calculated (Azure#13035) * [Text Analytics] Expose string encoding parameter * adding length back * adding unit tests for the string encoding parameter * fix export * renaming and refactoring * rename back to the service's name * fixes * address feedback * address feedback * update samples * [Text Analytics] Address feedback from the arch board meeting 11/1 (Azure#13169) * address feedback * update sample * update the name of the options type to beginAnalyzeHealthcareEntities * [Text Analytics] Address additional feedback (Azure#13296) * [Text Analytics] Address additional feedback * fix build * [Text Analytics] Implementing agreed-on renamings (Azure#13424) * [Text Analytics] Implementing agreed-on renamings * fix failures in CI, address feedback, and make one more renaming * address feedback * edit README * address feedback * address feedback * move utils to public to fix min max testing * this is needed for the test/public package created by minmax testing * fix mapping
1 parent e4dba89 commit 68ff36f

File tree

258 files changed

+25139
-15262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+25139
-15262
lines changed

sdk/textanalytics/ai-text-analytics/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release History
22

3+
## 5.1.0-beta.4 (unreleased)
4+
5+
- [Breaking] `beginAnalyzeHealthcare` is renamed to `beginAnalyzeHealthcareEntities`.
6+
- [Breaking] `beginAnalyze` is renamed to `beginAnalyzeBatchActions`.
7+
- A new option to control how the offset is calculated by the service, `stringIndexType`, is added to `analyzeSentiment`, `recognizeEntities`, `recognizePiiEntities`, and `beginAnalyzeHealthcareEntities`. Furthermore, `stringIndexType` is added to task types `RecognizeEntitiesAction` and `RecognizePiiEntitiesAction`, which are the types of input actions to the `beginAnalyzeBatchActions` method. For more information, see [the Text Analytics documentation](https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/text-offsets#offsets-in-api-version-31-preview).
8+
- [Breaking] The healthcare entities returned by `beginAnalyzeHealthcare` are now organized as a directed graph where the edges represent a certain type of healthcare relationship between the source and target entities. Edges are stored in the `relatedEntities` property.
9+
- [Breaking] The `links` property of `HealthcareEntity` is renamed to `dataSources`, a list of objects representing medical databases, where each object has `name` and `entityId` properties.
10+
- The poller for the `beginAnalyzeBatchActions` long-running operation gained the ability to return certain metadata information about the currently running operation (e.g., when the operation was created, will be expired, and last time it was updated, and also how many actions completed and failed so far). Also, the poller for `beginAnalyzeHealthcareEntities` gained a similar ability.
11+
- [Breaking] the words "operation" and "action" are used consistently in our names and documentation instead of "job" and "task" respectively.
12+
313
## 5.1.0-beta.3 (2020-11-23)
414

515
- We are now targeting the service's v3.1-preview.3 API as the default instead of v3.1-preview.2.

sdk/textanalytics/ai-text-analytics/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ const documents = [
406406
];
407407

408408
async function main() {
409-
const poller = await client.beginAnalyzeHealthcare(documents);
409+
const poller = await client.beginAnalyzeHealthcareEntities(documents);
410410
const results = await poller.pollUntilDone();
411411

412412
for await (const result of results) {
@@ -423,9 +423,9 @@ async function main() {
423423
main();
424424
```
425425

426-
### Analyze
426+
### Analyze Batch Actions
427427

428-
Analyze enables the application of multiple analyses at once.
428+
Analyze batch actions enables the application of multiple analyses (named actions) at once.
429429

430430
```javascript
431431
const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics");
@@ -440,16 +440,16 @@ const documents = [
440440
];
441441

442442
async function main() {
443-
const tasks = {
444-
entityRecognitionTasks: [{ modelVersion: "latest" }],
445-
entityRecognitionPiiTasks: [{ modelVersion: "latest" }],
446-
keyPhraseExtractionTasks: [{ modelVersion: "latest" }]
443+
const actions = {
444+
recognizeEntitiesActions: [{ modelVersion: "latest" }],
445+
recognizePiiEntitiesActions: [{ modelVersion: "latest" }],
446+
extractKeyPhrasesActions: [{ modelVersion: "latest" }]
447447
};
448-
const poller = await client.beginAnalyze(documents, tasks);
448+
const poller = await client.beginAnalyzeBatchActions(documents, actions);
449449
const resultPages = await poller.pollUntilDone();
450450

451451
for await (const page of resultPages) {
452-
const keyPhrasesResults = page.keyPhrasesExtractionResults[0];
452+
const keyPhrasesResults = page.extractKeyPhrasesResults[0];
453453
for (const doc of keyPhrasesResults) {
454454
console.log(`- Document ${doc.id}`);
455455
if (!doc.error) {
@@ -462,7 +462,7 @@ async function main() {
462462
}
463463
}
464464

465-
const entitiesResults = page.entitiesRecognitionResults[0];
465+
const entitiesResults = page.recognizeEntitiesResults[0];
466466
for (const doc of entitiesResults) {
467467
console.log(`- Document ${doc.id}`);
468468
if (!doc.error) {
@@ -475,7 +475,7 @@ async function main() {
475475
}
476476
}
477477

478-
const piiEntitiesResults = page.piiEntitiesRecognitionResults[0];
478+
const piiEntitiesResults = page.recognizePiiEntitiesResults[0];
479479
for (const doc of piiEntitiesResults) {
480480
console.log(`- Document ${doc.id}`);
481481
if (!doc.error) {

sdk/textanalytics/ai-text-analytics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"browser": {
5050
"./dist-esm/src/utils/url.js": "./dist-esm/src/utils/url.browser.js",
51-
"./dist-esm/test/utils/env.js": "./dist-esm/test/utils/env.browser.js"
51+
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
5252
},
5353
"scripts": {
5454
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",

sdk/textanalytics/ai-text-analytics/recordings/browsers/aad_textanalyticsclient_fast_tests_analyzesentiment/recording_client_accepts_string_and_language.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/textanalytics/ai-text-analytics/recordings/browsers/aad_textanalyticsclient_fast_tests_analyzesentiment/recording_client_accepts_string_with_no_language.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/textanalytics/ai-text-analytics/recordings/browsers/aad_textanalyticsclient_fast_tests_analyzesentiment/recording_client_accepts_textdocumentinput.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/textanalytics/ai-text-analytics/recordings/browsers/aad_textanalyticsclient_fast_tests_analyzesentiment/recording_client_gets_negative_mined_opinions.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/textanalytics/ai-text-analytics/recordings/browsers/aad_textanalyticsclient_fast_tests_analyzesentiment/recording_client_gets_no_mined_opinions.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)