Skip to content

Commit cab6b1f

Browse files
committed
update samples for assertion
1 parent cf9fee3 commit cab6b1f

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
- Add property `normalized_text` to `HealthcareEntity`. This property is a normalized version of the `text` property that already
1414
exists on the `HealthcareEntity`
15+
- Add property `assertion` onto `HealthcareEntity`. This contains assertions about the entity itself, i.e. if the entity represents a diagnosis,
16+
is this diagnosis conditional on a symptom?
1517

1618
## 5.1.0b5 (2021-02-10)
1719

sdk/textanalytics/azure-ai-textanalytics/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,11 @@ for idx, doc in enumerate(docs):
477477
for data_source in entity.data_sources:
478478
print("......Entity ID: {}".format(data_source.entity_id))
479479
print("......Name: {}".format(data_source.name))
480+
if entity.assertion is not None:
481+
print("...Assertion:")
482+
print("......Conditionality: {}".format(entity.assertion.conditionality))
483+
print("......Certainty: {}".format(entity.assertion.certainty))
484+
print("......Association: {}".format(entity.assertion.association))
480485
for relation in doc.entity_relations:
481486
print("Relation of type: {} has the following roles".format(relation.relation_type))
482487
for role in relation.roles:

sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_healthcare_entities_async.py

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ async def analyze_healthcare_entities_async(self):
8888
for data_source in entity.data_sources:
8989
print("......Entity ID: {}".format(data_source.entity_id))
9090
print("......Name: {}".format(data_source.name))
91+
if entity.assertion is not None:
92+
print("...Assertion:")
93+
print("......Conditionality: {}".format(entity.assertion.conditionality))
94+
print("......Certainty: {}".format(entity.assertion.certainty))
95+
print("......Association: {}".format(entity.assertion.association))
9196
for relation in doc.entity_relations:
9297
print("Relation of type: {} has the following roles".format(relation.relation_type))
9398
for role in relation.roles:

sdk/textanalytics/azure-ai-textanalytics/samples/sample_analyze_healthcare_entities.py

+5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ def analyze_healthcare_entities(self):
8484
for data_source in entity.data_sources:
8585
print("......Entity ID: {}".format(data_source.entity_id))
8686
print("......Name: {}".format(data_source.name))
87+
if entity.assertion is not None:
88+
print("...Assertion:")
89+
print("......Conditionality: {}".format(entity.assertion.conditionality))
90+
print("......Certainty: {}".format(entity.assertion.certainty))
91+
print("......Association: {}".format(entity.assertion.association))
8792
for relation in doc.entity_relations:
8893
print("Relation of type: {} has the following roles".format(relation.relation_type))
8994
for role in relation.roles:

0 commit comments

Comments
 (0)