Skip to content

Commit 3a1416d

Browse files
committed
Add negation, speculation and confidence to evidence
1 parent 09fe17a commit 3a1416d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

indra/sources/evex/processor.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,17 @@ def process_row(self, row):
7777
'evex_relation_type': row.refined_type,
7878
'evex_polarity': row.refined_polarity,
7979
'evex_general_event_id': str(row.general_event_id),
80-
'evex_standoff_regulation_id': ev_info.get('regulation_uid')
80+
'evex_standoff_regulation_id':
81+
ev_info.get('regulation_uid'),
82+
'evex_confidence': ev_info.get('confidence')
8183
}
84+
# These are propagated to allow filtering later
85+
epistemics = {}
86+
if ev_info.get('negation'):
87+
epistemics['negated'] = True
88+
if ev_info.get('speculation'):
89+
epistemics['is_hypothesis'] = True
90+
8291
if ev_info.get('subj_coords'):
8392
annotations['agents'] = \
8493
{'coords': [ev_info['subj_coords'],
@@ -87,7 +96,8 @@ def process_row(self, row):
8796
pmid=pmid,
8897
text_refs=text_refs,
8998
text=ev_info.get('text'),
90-
annotations=annotations)
99+
annotations=annotations,
100+
epistemics=epistemics)
91101

92102
# We can set the raw Agent text which is specific to this
93103
# given evidence.
@@ -234,7 +244,10 @@ def get_regulation_info(standoff, regulation, source_uid, target_uid):
234244
'subj_coords': subj_coord,
235245
'obj_text': obj_text,
236246
'obj_coords': obj_coord,
237-
'regulation_uid': regulation.uid}
247+
'regulation_uid': regulation.uid,
248+
'confidence': regulation.confidence_val,
249+
'negation': True if regulation.negation else False,
250+
'speculation': True if regulation.speculation else False}
238251

239252

240253
def get_sentence_for_offset(text_lines, line_offsets, offset):

0 commit comments

Comments
 (0)