Skip to content

Commit cf8895e

Browse files
authored
add normalizedText (Azure#14045)
1 parent 310a498 commit cf8895e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

sdk/textanalytics/ai-text-analytics/review/ai-text-analytics.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export interface HealthcareAssertion {
228228
export interface HealthcareEntity extends Entity {
229229
assertion?: HealthcareAssertion;
230230
dataSources: EntityDataSource[];
231+
normalizedText?: string;
231232
relatedEntities: Map<HealthcareEntity, string>;
232233
}
233234

sdk/textanalytics/ai-text-analytics/src/analyzeHealthcareEntitiesResult.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export interface EntityDataSource {
4141
* a particular type of relationship between the source and target nodes.
4242
*/
4343
export interface HealthcareEntity extends Entity {
44+
/**
45+
* Normalized name for the entity. For example, the normalized text for "histologically" is "histologic".
46+
*/
47+
normalizedText?: string;
4448
/**
4549
* Whether the entity is negated.
4650
*/
@@ -160,14 +164,25 @@ export interface PagedAnalyzeHealthcareEntitiesResult
160164
function makeHealthcareEntitiesWithoutNeighbors(
161165
entity: GeneratedHealthcareEntity
162166
): HealthcareEntity {
163-
const { category, confidenceScore, assertion, offset, text, links, subCategory, length } = entity;
167+
const {
168+
category,
169+
confidenceScore,
170+
assertion,
171+
offset,
172+
text,
173+
links,
174+
subCategory,
175+
length,
176+
name
177+
} = entity;
164178
return {
165179
category,
166180
confidenceScore,
167181
assertion,
168182
offset,
169183
length,
170184
text,
185+
normalizedText: name,
171186
subCategory,
172187
dataSources:
173188
links?.map(({ dataSource, id }): EntityDataSource => ({ name: dataSource, entityId: id })) ??

0 commit comments

Comments
 (0)