Skip to content

Commit 00d9827

Browse files
abhahnAbigail HartmankayousefAbby Hartman
authored
Language API for TA (2021-11-01-preview) (#16256)
* WIP for language api spec for TA * Updated preview version number; finished up async definitions * Finished first draft of full spec * Finished first draft of full spec, minus FHIR structuring in HC output * Removed features not included in 2021-11-01 preview * Update custom text tasks TODOs * Moved common definitions to TA-specific definitions * Added custom text tasks to JobManifest * Addressing feedback from PR comments and internal review * Addressed some PR comments * Updated some remaining references to documents * PR comments * Updated a previous change * Reverted references to 'records' back to 'documents' * A few small updates to examples; removed base Task type to simplify structure * PR comments * Addressed TODO items; removed LD-related objects (will be added in another preview) * Fixed anonymous types * Removed required field for body in POST request * Fix prettier check * Added a few more details; experimental change for documents property * Ran prettier * Correction to AnalysisInput object * PR comments * Added custom entities task to examples * PR comments * Prettier check * Troubleshooting model validation failure Co-authored-by: Abigail Hartman <Abigail.Hartman@microsoft.com> Co-authored-by: Kareem Yousef <kayousef@microsoft.com> Co-authored-by: Abby Hartman <abhahn@microsoft.com>
1 parent e22c931 commit 00d9827

File tree

4 files changed

+2452
-5
lines changed

4 files changed

+2452
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{
2+
"parameters": {
3+
"Ocp-Apim-Subscription-Key": "{API key}",
4+
"api-version": "2021-11-01-preview",
5+
"Endpoint": "{Endpoint}",
6+
"jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"
7+
},
8+
"responses": {
9+
"200": {
10+
"headers": {},
11+
"body": {
12+
"createdDateTime": "2020-10-01T15:00:45Z",
13+
"displayName": "Extracting Location & US Region",
14+
"expirationDateTime": "2020-10-03T15:01:03Z",
15+
"jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18",
16+
"lastUpdateDateTime": "2020-10-01T15:01:03Z",
17+
"status": "succeeded",
18+
"tasks": {
19+
"completed": 2,
20+
"failed": 0,
21+
"inProgress": 0,
22+
"total": 2,
23+
"entityRecognitionTasks": [
24+
{
25+
"taskName": "Recognize Entities",
26+
"lastUpdateDateTime": "2020-10-01T15:01:03Z",
27+
"status": "succeeded",
28+
"results": {
29+
"documents": [
30+
{
31+
"entities": [
32+
{
33+
"category": "Event",
34+
"confidenceScore": 0.61,
35+
"length": 4,
36+
"offset": 18,
37+
"text": "trip"
38+
},
39+
{
40+
"category": "Location",
41+
"confidenceScore": 0.82,
42+
"length": 7,
43+
"offset": 26,
44+
"subcategory": "GPE",
45+
"text": "Seattle"
46+
},
47+
{
48+
"category": "DateTime",
49+
"confidenceScore": 0.8,
50+
"length": 9,
51+
"offset": 34,
52+
"subcategory": "DateRange",
53+
"text": "last week"
54+
}
55+
],
56+
"id": "1",
57+
"warnings": []
58+
},
59+
{
60+
"entities": [
61+
{
62+
"category": "Location",
63+
"confidenceScore": 0.52,
64+
"length": 3,
65+
"offset": 14,
66+
"subcategory": "GPE",
67+
"text": "NYC"
68+
},
69+
{
70+
"category": "DateTime",
71+
"confidenceScore": 0.8,
72+
"length": 8,
73+
"offset": 18,
74+
"subcategory": "Date",
75+
"text": "tomorrow"
76+
}
77+
],
78+
"id": "2",
79+
"warnings": []
80+
}
81+
],
82+
"errors": [],
83+
"modelVersion": "2020-04-01"
84+
}
85+
}
86+
],
87+
"customEntityRecognitionTasks": [
88+
{
89+
"taskName": "Recognize US Regions",
90+
"lastUpdateDateTime": "2020-10-01T15:01:03Z",
91+
"status": "succeeded",
92+
"results": {
93+
"documents": [
94+
{
95+
"entities": [
96+
{
97+
"category": "USRegion",
98+
"confidenceScore": 0.85,
99+
"length": 17,
100+
"offset": 45,
101+
"text": "Pacific Northwest"
102+
}
103+
],
104+
"id": "1",
105+
"warnings": []
106+
},
107+
{
108+
"entities": [
109+
{
110+
"category": "USRegion",
111+
"confidenceScore": 0.88,
112+
"length": 10,
113+
"offset": 63,
114+
"text": "East Coast"
115+
}
116+
],
117+
"id": "2",
118+
"warnings": []
119+
}
120+
],
121+
"errors": [],
122+
"projectName": "MyProject",
123+
"deploymentName": "MyDeployment"
124+
}
125+
}
126+
]
127+
}
128+
}
129+
}
130+
}
131+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"parameters": {
3+
"Ocp-Apim-Subscription-Key": "{API key}",
4+
"api-version": "2021-11-01-preview",
5+
"Endpoint": "{Endpoint}",
6+
"jobId": "{Job ID}",
7+
"input": {
8+
"displayName": "Extracting Location & US Region",
9+
"analysisInput": {
10+
"documents": [
11+
{
12+
"id": "1",
13+
"language": "en",
14+
"text": "I had a wonderful trip to Seattle last week. The Pacific Northwest is beautiful."
15+
},
16+
{
17+
"id": "2",
18+
"language": "en",
19+
"text": "I'm flying to NYC tomorrow. I hear the weather is cold on the East Coast this time of year. Should I bring a heavy coat?"
20+
}
21+
]
22+
},
23+
"tasks": {
24+
"entityRecognitionTasks": [
25+
{
26+
"taskName": "Recognize Entities",
27+
"parameters": {
28+
"model-version": "latest"
29+
}
30+
}
31+
],
32+
"customEntityRecognitionTasks": [
33+
{
34+
"taskName": "Recognize US Regions",
35+
"parameters": {
36+
"projectName": "MyProject",
37+
"deploymentName": "MyDeployment"
38+
}
39+
}
40+
]
41+
}
42+
}
43+
},
44+
"responses": {
45+
"202": {
46+
"headers": {
47+
"Operation-Location": "{endpoint}/language/analyze-text/jobs/{jobId}"
48+
}
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)