-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcomprehend.ts
121 lines (86 loc) · 2.41 KB
/
comprehend.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../resource';
import * as Core from '../../core';
export class Comprehend extends APIResource {
/**
* Analyze unstructured medical text to extract entities labeled with standardized
* medical codes and confidence scores.
*/
medical(
body: ComprehendMedicalParams,
options?: Core.RequestOptions,
): Core.APIPromise<ComprehendMedicalResponse> {
return this._client.post('/v1/tools/comprehend/medical', { body, ...options });
}
}
export interface ComprehendMedicalResponse {
/**
* An array of medical entities extracted from the input text.
*/
entities: Array<ComprehendMedicalResponse.Entity>;
}
export namespace ComprehendMedicalResponse {
export interface Entity {
attributes: Array<Entity.Attribute>;
begin_offset: number;
category: string;
concepts: Array<Entity.Concept>;
end_offset: number;
score: number;
text: string;
traits: Array<Entity.Trait>;
type: string;
}
export namespace Entity {
export interface Attribute {
begin_offset: number;
concepts: Array<Attribute.Concept>;
end_offset: number;
relationship_score: number;
score: number;
text: string;
traits: Array<Attribute.Trait>;
type: string;
category?: string;
relationship_type?: string;
}
export namespace Attribute {
export interface Concept {
code: string;
description: string;
score: number;
}
export interface Trait {
name: string;
score: number;
}
}
export interface Concept {
code: string;
description: string;
score: number;
}
export interface Trait {
name: string;
score: number;
}
}
}
export interface ComprehendMedicalParams {
/**
* The text to be analyzed.
*/
content: string;
/**
* The structure of the response to be returned. `Entities` returns medical
* entities, `RxNorm` returns medication information, `ICD-10-CM` returns diagnosis
* codes, and `SNOMED CT` returns medical concepts.
*/
response_type: 'Entities' | 'RxNorm' | 'ICD-10-CM' | 'SNOMED CT';
}
export declare namespace Comprehend {
export {
type ComprehendMedicalResponse as ComprehendMedicalResponse,
type ComprehendMedicalParams as ComprehendMedicalParams,
};
}