Skip to content

Commit

Permalink
add normalizedText (Azure#14045)
Browse files Browse the repository at this point in the history
  • Loading branch information
deyaaeldeen authored Mar 2, 2021
1 parent 310a498 commit cf8895e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export interface HealthcareAssertion {
export interface HealthcareEntity extends Entity {
assertion?: HealthcareAssertion;
dataSources: EntityDataSource[];
normalizedText?: string;
relatedEntities: Map<HealthcareEntity, string>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export interface EntityDataSource {
* a particular type of relationship between the source and target nodes.
*/
export interface HealthcareEntity extends Entity {
/**
* Normalized name for the entity. For example, the normalized text for "histologically" is "histologic".
*/
normalizedText?: string;
/**
* Whether the entity is negated.
*/
Expand Down Expand Up @@ -160,14 +164,25 @@ export interface PagedAnalyzeHealthcareEntitiesResult
function makeHealthcareEntitiesWithoutNeighbors(
entity: GeneratedHealthcareEntity
): HealthcareEntity {
const { category, confidenceScore, assertion, offset, text, links, subCategory, length } = entity;
const {
category,
confidenceScore,
assertion,
offset,
text,
links,
subCategory,
length,
name
} = entity;
return {
category,
confidenceScore,
assertion,
offset,
length,
text,
normalizedText: name,
subCategory,
dataSources:
links?.map(({ dataSource, id }): EntityDataSource => ({ name: dataSource, entityId: id })) ??
Expand Down

0 comments on commit cf8895e

Please sign in to comment.