Search through a chunk structure, looking for relational triples.
These consist of
-
a Named Entity (i.e subtree), called the 'subject' of the triple,
-
a string of words (i.e. leaves), called the 'filler' of the triple,
-
another Named Entity, called the 'object' of the triple.
To help in data analysis, we also identify a fourth item,
rcon , i.e., a few words of right context immediately
following the second Named Entity.
Apart from the first and last, every Named Entity can occur as both
the subject and the object of a triple.
The parameters stype and otype can be used
to restrict the Named Entities to particular types (any of 'LOCATION',
'ORGANIZATION', 'PERSON', 'DURATION', 'DATE', 'CARDINAL', 'PERCENT',
'MONEY', 'MEASURE').
- Parameters:
t (Tree ) - a chunk structured portion of the ieer corpus.
stype (string or None .) - the type of the subject Named Entity (by default, all types are
admissible).
otype (string or None .) - the type of the object Named Entity (by default, all types are
admissible).
- Returns:
list
- a list of 4-tuples
(subj, filler, obj, rcon) .
|