Open khaledJabr opened 5 years ago
The sentence object in PETRgraph.py has an entry triplets that can be used for debugging.
Here is an example of sentence: The Syrian Observatory for Human Rights, a UK-based group that tracks the war, said eight people were killed in an air strike by government forces in a separate, rebel-held part of the city.
{'-#18#20#4': -->triplet_ ID {'transfermation': '~ a (b . ATTACK) SAY = a b 112\n', -->Transformation pattern matched if any 'meaning': 'KILL,KILL', --> block meaning 'verbcode': '190', 'triple': ('-', <PETRgraph.NounPhrase instance at 0x7f47fd9dc128>, <PETRgraph.VerbPhrase instance at 0x7f47fd9dacb0>), 'before_transfer': ([u'SYR'], ([u'---MIL'], [u'---PPL'], '190'), '010'), --> events involved in tranformation 'after_transfer': [([u'SYR'], [u'---MIL'], u'112')] -->event after transformation 'event': ([u'---MIL'], [u'---PPL'], '190'), -->event or event before transformation 'matched_txt': u'KILL'}, -->matched verb pattern or block meaning if only verb is matched }
I have been working on debugging issues with UniversalPetrarch, mainly the issue of matching the dictionaries and the extracted patterns. @ahalterman (and @philip-schrodt ) suggested a way of doing so by tracking how does UP produce events through outputting the dictionary verbs and verb-patterns it matched. This method was used in debugging Petrarch2, and here is the relavent code snippets that does it (by @ahalterman )
I am having issues fitting this code to UP since it uses
PETRgraph
and it does not return ameta
object. I would appreciate any help of how to tackle this.