adherent commited on
Commit
4bb803b
1 Parent(s): 44a9d55

Add application file

Browse files
Bart-gen-arg CHANGED
@@ -1 +1 @@
1
- Subproject commit 26debc5ccc7a55a0186cc440e4eb824f7eb66b0c
 
1
+ Subproject commit 617b285fd86f1e7fb2ca5352c530f80f3f4608ae
aida_ontology_fj-w-3.csv ADDED
@@ -0,0 +1,593 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ event_type,template,arg1,arg2,arg3,arg4,arg5
2
+ artifactexistence.artifactfailure.mechanicalfailure,what is the <arg1> mechanical artifact failed due to instrument in <trg>,evt152arg01mechanicalartifact,,,,
3
+ artifactexistence.artifactfailure.mechanicalfailure,what is the <arg2> cause of mechanical artifact failure in <trg>,,evt152arg02instrument,,,
4
+ artifactexistence.artifactfailure.mechanicalfailure,where is the <arg3> in <trg>,,,evt152arg03place,,
5
+ artifactexistence.damagedestroy.unspecified,who is the <arg1> damaging something in <trg>,evt001arg01damagerdestroyer,,,,
6
+ artifactexistence.damagedestroy.unspecified,what is the <arg2> being damaged in <trg>,,evt001arg02artifact,,,
7
+ artifactexistence.damagedestroy.unspecified,what is the <arg3> being used to damage in <trg>,,,evt001arg03instrument,,
8
+ artifactexistence.damagedestroy.unspecified,where is the <arg4> in <trg>,,,,evt001arg04place,
9
+ artifactexistence.damagedestroy.damage,who is the <arg1> damaging something in <trg>,evt002arg01damager,,,,
10
+ artifactexistence.damagedestroy.damage,what is the <arg2> being damaged in <trg>,,evt002arg02artifact,,,
11
+ artifactexistence.damagedestroy.damage,what is the <arg3> being used to damage in <trg>,,,evt002arg03instrument,,
12
+ artifactexistence.damagedestroy.damage,where is the <arg4> in <trg>,,,,evt002arg04place,
13
+ artifactexistence.damagedestroy.destroy,who is the <arg1> damaging something in <trg>,evt003arg01destroyer,,,,
14
+ artifactexistence.damagedestroy.destroy,what is the <arg2> being damaged in <trg>,,evt003arg02artifact,,,
15
+ artifactexistence.damagedestroy.destroy,what is the <arg3> being used to damage in <trg>,,,evt003arg03instrument,,
16
+ artifactexistence.damagedestroy.destroy,where is the <arg4> in <trg>,,,,evt003arg04place,
17
+ artifactexistence.shortage.shortage,who is the <arg1> experiencing a shortage of something in <trg>,evt149arg01experiencer ,,,,
18
+ artifactexistence.shortage.shortage,what is the <arg2> in shortage in <trg>,,evt149arg02supply ,,,
19
+ artifactexistence.shortage.shortage,where is the <arg3> in <trg>,,,evt149arg03place ,,
20
+ conflict.attack.unspecified,what is the <arg1> attacking target in <trg>,evt004arg01attacker,,,,
21
+ conflict.attack.unspecified,what is the <arg2> being attacked in <trg>,,evt004arg02target,,,
22
+ conflict.attack.unspecified,what is the <arg3> being used to attack something in <trg>,,,evt004arg03instrument,,
23
+ conflict.attack.unspecified,where is the <arg4> in <trg>,,,,evt004arg04place,
24
+ conflict.attack.airstrikemissilestrike,what is the <arg1> attacking target in <trg>,evt005arg01attacker,,,,
25
+ conflict.attack.airstrikemissilestrike,what is the <arg2> being attacked in <trg>,,evt005arg02target,,,
26
+ conflict.attack.airstrikemissilestrike,what is the <arg3> being used to attack something in <trg>,,,evt005arg03instrument,,
27
+ conflict.attack.airstrikemissilestrike,where is the <arg4> in <trg>,,,,evt005arg04place,
28
+ conflict.attack.biologicalchemicalpoisonattack,what is the <arg1> attacking target in <trg>,evt006arg01attacker,,,,
29
+ conflict.attack.biologicalchemicalpoisonattack,what is the <arg2> being attacked in <trg>,,evt006arg02target,,,
30
+ conflict.attack.biologicalchemicalpoisonattack,what is the <arg3> being used to attack something in <trg>,,,evt006arg03instrument,,
31
+ conflict.attack.biologicalchemicalpoisonattack,where is the <arg4> in <trg>,,,,evt006arg04place,
32
+ conflict.attack.bombing,what is the <arg1> attacking target in <trg>,evt007arg01attacker,,,,
33
+ conflict.attack.bombing,what is the <arg2> being attacked in <trg>,,evt007arg02target,,,
34
+ conflict.attack.bombing,what is the <arg3> being used to attack something in <trg>,,,evt007arg03instrument,,
35
+ conflict.attack.bombing,where is the <arg4> in <trg>,,,,evt007arg04place,
36
+ conflict.attack.firearmattack,what is the <arg1> attacking target in <trg>,evt008arg01attacker,,,,
37
+ conflict.attack.firearmattack,what is the <arg2> being attacked in <trg>,,evt008arg02target,,,
38
+ conflict.attack.firearmattack,what is the <arg3> being used to attack something in <trg>,,,evt008arg03instrument,,
39
+ conflict.attack.firearmattack,where is the <arg4> in <trg>,,,,evt008arg04place,
40
+ conflict.attack.hanging,what is the <arg1> attacking target in <trg>,evt009arg01attacker,,,,
41
+ conflict.attack.hanging,what is the <arg2> being attacked in <trg>,,evt009arg02target,,,
42
+ conflict.attack.hanging,what is the <arg3> being used to attack something in <trg>,,,evt009arg03instrument,,
43
+ conflict.attack.hanging,where is the <arg4> in <trg>,,,,evt009arg04place,
44
+ conflict.attack.invade,what is the <arg1> attacking target in <trg>,evt010arg01attacker,,,,
45
+ conflict.attack.invade,what is the <arg2> being attacked in <trg>,,evt010arg02target,,,
46
+ conflict.attack.invade,what is the <arg3> being used to attack something in <trg>,,,evt010arg03instrument,,
47
+ conflict.attack.invade,where is the <arg4> in <trg>,,,,evt010arg04place,
48
+ conflict.attack.selfdirectedbattle,what is the <arg1> attacking target in <trg>,evt011arg01attacker,,,,
49
+ conflict.attack.selfdirectedbattle,what is the <arg2> being attacked in <trg>,,evt011arg02target,,,
50
+ conflict.attack.selfdirectedbattle,what is the <arg3> being used to attack something in <trg>,,,evt011arg03instrument,,
51
+ conflict.attack.selfdirectedbattle,where is the <arg4> in <trg>,,,,evt011arg04place,
52
+ conflict.attack.setfire,what is the <arg1> attacking target in <trg>,evt012arg01attacker,,,,
53
+ conflict.attack.setfire,what is the <arg2> being attacked in <trg>,,evt012arg02target,,,
54
+ conflict.attack.setfire,what is the <arg3> being used to attack something in <trg>,,,evt012arg03instrument,,
55
+ conflict.attack.setfire,where is the <arg4> in <trg>,,,,evt012arg04place,
56
+ conflict.attack.stabbing,what is the <arg1> attacking target in <trg>,evt013arg01attacker,,,,
57
+ conflict.attack.stabbing,what is the <arg2> being attacked in <trg>,,evt013arg02target,,,
58
+ conflict.attack.stabbing,what is the <arg3> being used to attack something in <trg>,,,evt013arg03instrument,,
59
+ conflict.attack.stabbing,where is the <arg4> in <trg>,,,,evt013arg04place,
60
+ conflict.attack.stealrobhijack,what is the <arg1> attacking target in <trg>,evt014arg01attacker,,,,
61
+ conflict.attack.stealrobhijack,what is the <arg2> being attacked in <trg>,,evt014arg02target,,,
62
+ conflict.attack.stealrobhijack,what is the <arg3> being used to attack something in <trg>,,,evt014arg03instrument,,
63
+ conflict.attack.stealrobhijack,where is the <arg4> in <trg>,,,,evt014arg04place,
64
+ conflict.attack.stealrobhijack,what is the <arg5> target artifact of attacker in <trg>,,,,,evt014arg05artifact
65
+ conflict.attack.strangling,what is the <arg1> attacking target in <trg>,evt015arg01attacker,,,,
66
+ conflict.attack.strangling,what is the <arg2> being attacked in <trg>,,evt015arg02target,,,
67
+ conflict.attack.strangling,what is the <arg3> being used to attack something in <trg>,,,evt015arg03instrument,,
68
+ conflict.attack.strangling,where is the <arg4> in <trg>,,,,evt015arg04place,
69
+ conflict.coup.coup,what is the <arg1> being deposed by somebody at place in <trg>,evt151arg01deposedentity ,,,,
70
+ conflict.coup.coup,who is the <arg2> deposingentity in <trg>,,evt151arg02deposingentity ,,,
71
+ conflict.coup.coup,where is the <arg3> in <trg>,,,evt151arg03place ,,
72
+ conflict.demonstrate.unspecified,who is the <arg1> in a demonstration in <trg>,evt016arg01demonstrator,,,,
73
+ conflict.demonstrate.unspecified,where is the <arg2> in <trg>,,evt016arg02place,,,
74
+ conflict.demonstrate.marchprotestpoliticalgathering,who is the <arg1> in a demonstration in <trg>,evt017arg01demonstrator,,,,
75
+ conflict.demonstrate.marchprotestpoliticalgathering,where is the <arg2> in <trg>,,evt017arg02place,,,
76
+ conflict.yield.unspecified,what is the <arg1> yielder yielding to recipient in <trg>,evt018arg01yielder,,,,
77
+ conflict.yield.unspecified,what is the <arg2> being yielded in <trg>,,evt018arg02recipient,,,
78
+ conflict.yield.unspecified,where is the <arg3> in <trg>,,,evt018arg03place,,
79
+ conflict.yield.retreat,who is the <arg1> retreater retreating from original place to target place in <trg>,evt019arg01retreater,,,,
80
+ conflict.yield.retreat,where is the original <arg2> place in <trg>,,evt019arg02origin,,,
81
+ conflict.yield.retreat,where is the target <arg3> place in <trg>,,,evt019arg03destination,,
82
+ conflict.yield.surrender,who is the <arg1> surrenderring to recipient at place in <trg>,evt020arg01surrenderer,,,,
83
+ conflict.yield.surrender,who is the <arg2> being surrenderred to at place in <trg>,,evt020arg02recipient,,,
84
+ conflict.yield.surrender,where is the <arg3> in <trg>,,,evt020arg03place,,
85
+ contact.collaborate.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt021arg01participant,,,,
86
+ contact.collaborate.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt021arg02participant,,,
87
+ contact.collaborate.unspecified,where is the <arg3> in <trg>,,,evt021arg03place,,
88
+ contact.collaborate.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt022arg01participant,,,,
89
+ contact.collaborate.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt022arg02participant,,,
90
+ contact.collaborate.correspondence,where is the <arg3> in <trg>,,,evt022arg03place,,
91
+ contact.collaborate.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt023arg01participant,,,,
92
+ contact.collaborate.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt023arg02participant,,,
93
+ contact.collaborate.meet,where is the <arg3> in <trg>,,,evt023arg03place,,
94
+ contact.commandorder.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt024arg01communicator,,,,
95
+ contact.commandorder.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt024arg02recipient,,,
96
+ contact.commandorder.unspecified,where is the <arg3> in <trg>,,,evt024arg03place,,
97
+ contact.commandorder.unspecified,what is the <arg4> topic in <trg>,,,,evt024arg04topic,
98
+ contact.commandorder.broadcast,who is the <arg1> communicating with participant at place in <trg>,evt025arg01communicator,,,,
99
+ contact.commandorder.broadcast,who is the <arg2> communicating with participant at place in <trg>,,evt025arg02recipient,,,
100
+ contact.commandorder.broadcast,where is the <arg3> in <trg>,,,evt025arg03place,,
101
+ contact.commandorder.broadcast,what is the <arg4> topic in <trg>,,,,evt025arg04topic,
102
+ contact.commandorder.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt026arg01communicator,,,,
103
+ contact.commandorder.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt026arg02recipient,,,
104
+ contact.commandorder.correspondence,where is the <arg3> in <trg>,,,evt026arg03place,,
105
+ contact.commandorder.correspondence,what is the <arg4> topic in <trg>,,,,evt026arg04topic,
106
+ contact.commandorder.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt027arg01communicator,,,,
107
+ contact.commandorder.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt027arg02recipient,,,
108
+ contact.commandorder.meet,where is the <arg3> in <trg>,,,evt027arg03place,,
109
+ contact.commandorder.meet,what is the <arg4> topic in <trg>,,,,evt027arg04topic,
110
+ contact.commitmentpromiseexpressintent.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt028arg01communicator,,,,
111
+ contact.commitmentpromiseexpressintent.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt028arg02recipient,,,
112
+ contact.commitmentpromiseexpressintent.unspecified,where is the <arg3> in <trg>,,,evt028arg03place,,
113
+ contact.commitmentpromiseexpressintent.unspecified,what is the <arg4> topic in <trg>,,,,evt028arg04topic,
114
+ contact.commitmentpromiseexpressintent.broadcast,who is the <arg1> communicating with participant at place in <trg>,evt029arg01communicator,,,,
115
+ contact.commitmentpromiseexpressintent.broadcast,who is the <arg2> communicating with participant at place in <trg>,,evt029arg02recipient,,,
116
+ contact.commitmentpromiseexpressintent.broadcast,where is the <arg3> in <trg>,,,evt029arg03place,,
117
+ contact.commitmentpromiseexpressintent.broadcast,what is the <arg4> topic in <trg>,,,,evt029arg04topic,
118
+ contact.commitmentpromiseexpressintent.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt030arg01communicator,,,,
119
+ contact.commitmentpromiseexpressintent.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt030arg02recipient,,,
120
+ contact.commitmentpromiseexpressintent.correspondence,where is the <arg3> in <trg>,,,evt030arg03place,,
121
+ contact.commitmentpromiseexpressintent.correspondence,what is the <arg4> topic in <trg>,,,,evt030arg04topic,
122
+ contact.commitmentpromiseexpressintent.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt031arg01communicator,,,,
123
+ contact.commitmentpromiseexpressintent.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt031arg02recipient,,,
124
+ contact.commitmentpromiseexpressintent.meet,where is the <arg3> in <trg>,,,evt031arg03place,,
125
+ contact.commitmentpromiseexpressintent.meet,what is the <arg4> topic in <trg>,,,,evt031arg04topic,
126
+ contact.discussion.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt032arg01participant,,,,
127
+ contact.discussion.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt032arg02participant,,,
128
+ contact.discussion.unspecified,where is the <arg3> in <trg>,,,evt032arg03place,,
129
+ contact.discussion.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt033arg01participant,,,,
130
+ contact.discussion.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt033arg02participant,,,
131
+ contact.discussion.correspondence,where is the <arg3> in <trg>,,,evt033arg03place,,
132
+ contact.discussion.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt034arg01participant,,,,
133
+ contact.discussion.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt034arg02participant,,,
134
+ contact.discussion.meet,where is the <arg3> in <trg>,,,evt034arg03place,,
135
+ contact.funeralvigil.unspecified,who is the <arg1> communicating with participant during a funeral or vigil at place in <trg>,evt035arg01participant,,,,
136
+ contact.funeralvigil.unspecified,who is the <arg2> communicating with participant during a funeral or vigil at place in <trg>,,evt035arg02participant,,,
137
+ contact.funeralvigil.unspecified,what is the <arg3> in <trg>,,,evt035arg03deceased,,
138
+ contact.funeralvigil.unspecified,where is the <arg4> in <trg>,,,,evt035arg04place,
139
+ contact.funeralvigil.meet,who is the <arg1> met face-to-face with participant during a funeral or vigil at place in <trg>,evt036arg01participant,,,,
140
+ contact.funeralvigil.meet,who is the <arg2> met face-to-face with participant during a funeral or vigil at place in <trg>,,evt036arg02participant,,,
141
+ contact.funeralvigil.meet,what is the <arg3> in <trg>,,,evt036arg03deceased,,
142
+ contact.funeralvigil.meet,where is the <arg4> in <trg>,,,,evt036arg04place,
143
+ contact.mediastatement.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt037arg01communicator,,,,
144
+ contact.mediastatement.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt037arg02recipient,,,
145
+ contact.mediastatement.unspecified,where is the <arg3> in <trg>,,,evt037arg03place,,
146
+ contact.mediastatement.broadcast,who is the <arg1> communicated to at place (one-way communication) in <trg>,evt038arg01communicator,,,,
147
+ contact.mediastatement.broadcast,who is the <arg2> communicated to at place (one-way communication) in <trg>,,evt038arg02recipient,,,
148
+ contact.mediastatement.broadcast,where is the <arg3> in <trg>,,,evt038arg03place,,
149
+ contact.negotiate.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt039arg01participant,,,,
150
+ contact.negotiate.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt039arg02participant,,,
151
+ contact.negotiate.unspecified,where is the <arg3> in <trg>,,,evt039arg03place,,
152
+ contact.negotiate.unspecified,what is the <arg4> topic in <trg>,,,,evt039arg04topic,
153
+ contact.negotiate.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt040arg01participant,,,,
154
+ contact.negotiate.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt040arg02participant,,,
155
+ contact.negotiate.correspondence,where is the <arg3> in <trg>,,,evt040arg03place,,
156
+ contact.negotiate.correspondence,what is the <arg4> topic in <trg>,,,,evt040arg04topic,
157
+ contact.negotiate.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt041arg01participant,,,,
158
+ contact.negotiate.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt041arg02participant,,,
159
+ contact.negotiate.meet,where is the <arg3> in <trg>,,,evt041arg03place,,
160
+ contact.negotiate.meet,what is the <arg4> topic in <trg>,,,,evt041arg04topic,
161
+ contact.prevarication.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt042arg01communicator,,,,
162
+ contact.prevarication.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt042arg02recipient,,,
163
+ contact.prevarication.unspecified,where is the <arg3> in <trg>,,,evt042arg03place,,
164
+ contact.prevarication.unspecified,what is the <arg4> topic in <trg>,,,,evt042arg04topic,
165
+ contact.prevarication.broadcast,who is the <arg1> communicated to at place (one-way communication) in <trg>,evt043arg01communicator,,,,
166
+ contact.prevarication.broadcast,who is the <arg2> communicated to at place (one-way communication) in <trg>,,evt043arg02recipient,,,
167
+ contact.prevarication.broadcast,where is the <arg3> in <trg>,,,evt043arg03place,,
168
+ contact.prevarication.broadcast,what is the <arg4> topic in <trg>,,,,evt043arg04topic,
169
+ contact.prevarication.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt044arg01communicator,,,,
170
+ contact.prevarication.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt044arg02recipient,,,
171
+ contact.prevarication.correspondence,where is the <arg3> in <trg>,,,evt044arg03place,,
172
+ contact.prevarication.correspondence,what is the <arg4> topic in <trg>,,,,evt044arg04topic,
173
+ contact.prevarication.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt045arg01communicator,,,,
174
+ contact.prevarication.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt045arg02recipient,,,
175
+ contact.prevarication.meet,where is the <arg3> in <trg>,,,evt045arg03place,,
176
+ contact.prevarication.meet,what is the <arg4> topic in <trg>,,,,evt045arg04topic,
177
+ contact.publicstatementinperson.unspecified,who is the <arg1> communicating with participant at place in <trg>,evt046arg01communicator,,,,
178
+ contact.publicstatementinperson.unspecified,who is the <arg2> communicating with participant at place in <trg>,,evt046arg02recipient,,,
179
+ contact.publicstatementinperson.unspecified,where is the <arg3> in <trg>,,,evt046arg03place,,
180
+ contact.publicstatementinperson.broadcast,who is the <arg1> communicated to at place (one-way communication) in <trg>,evt047arg01communicator,,,,
181
+ contact.publicstatementinperson.broadcast,who is the <arg2> communicated to at place (one-way communication) in <trg>,,evt047arg02recipient,,,
182
+ contact.publicstatementinperson.broadcast,where is the <arg3> in <trg>,,,evt047arg03place,,
183
+ contact.requestadvise.unspecified,who is the <arg1> communicating with recipient at place in <trg>,evt048arg01communicator,,,,
184
+ contact.requestadvise.unspecified,who is the <arg2> communicating with recipient at place in <trg>,,evt048arg02recipient,,,
185
+ contact.requestadvise.unspecified,where is the <arg3> in <trg>,,,evt048arg03place,,
186
+ contact.requestadvise.unspecified,what is the <arg4> topic in <trg>,,,,evt048arg04topic,
187
+ contact.requestadvise.broadcast,who is the <arg1> communicated to at place (one-way communication) in <trg>,evt049arg01communicator,,,,
188
+ contact.requestadvise.broadcast,who is the <arg2> communicated to at place (one-way communication) in <trg>,,evt049arg02recipient,,,
189
+ contact.requestadvise.broadcast,where is the <arg3> in <trg>,,,evt049arg03place,,
190
+ contact.requestadvise.broadcast,what is the <arg4> topic in <trg>,,,,evt049arg04topic,
191
+ contact.requestadvise.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt050arg01communicator,,,,
192
+ contact.requestadvise.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt050arg02recipient,,,
193
+ contact.requestadvise.correspondence,where is the <arg3> in <trg>,,,evt050arg03place,,
194
+ contact.requestadvise.correspondence,what is the <arg4> topic in <trg>,,,,evt050arg04topic,
195
+ contact.requestadvise.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt051arg01communicator,,,,
196
+ contact.requestadvise.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt051arg02recipient,,,
197
+ contact.requestadvise.meet,where is the <arg3> in <trg>,,,evt051arg03place,,
198
+ contact.requestadvise.meet,what is the <arg4> topic in <trg>,,,,evt051arg04topic,
199
+ contact.threatencoerce.unspecified,who is the <arg1> communicating with recipient at place in <trg>,evt052arg01communicator,,,,
200
+ contact.threatencoerce.unspecified,who is the <arg2> communicating with recipient at place in <trg>,,evt052arg02recipient,,,
201
+ contact.threatencoerce.unspecified,where is the <arg3> in <trg>,,,evt052arg03place,,
202
+ contact.threatencoerce.unspecified,what is the <arg4> topic in <trg>,,,,evt052arg04topic,
203
+ contact.threatencoerce.broadcast,who is the <arg1> communicated to at place (one-way communication) in <trg>,evt053arg01communicator,,,,
204
+ contact.threatencoerce.broadcast,who is the <arg2> communicated to at place (one-way communication) in <trg>,,evt053arg02recipient,,,
205
+ contact.threatencoerce.broadcast,where is the <arg3> in <trg>,,,evt053arg03place,,
206
+ contact.threatencoerce.broadcast,what is the <arg4> topic in <trg>,,,,evt053arg04topic,
207
+ contact.threatencoerce.correspondence,who is the <arg1> communicating remotely with participant at place in <trg>,evt054arg01communicator,,,,
208
+ contact.threatencoerce.correspondence,who is the <arg2> communicating remotely with participant at place in <trg>,,evt054arg02recipient,,,
209
+ contact.threatencoerce.correspondence,where is the <arg3> in <trg>,,,evt054arg03place,,
210
+ contact.threatencoerce.correspondence,what is the <arg4> topic in <trg>,,,,evt054arg04topic,
211
+ contact.threatencoerce.meet,who is the <arg1> met face-to-face with participant at place in <trg>,evt055arg01communicator,,,,
212
+ contact.threatencoerce.meet,who is the <arg2> met face-to-face with participant at place in <trg>,,evt055arg02recipient,,,
213
+ contact.threatencoerce.meet,where is the <arg3> in <trg>,,,evt055arg03place,,
214
+ contact.threatencoerce.meet,what is the <arg4> topic in <trg>,,,,evt055arg04topic,
215
+ disaster.accidentcrash.accidentcrash,who is the <arg1> in vehicle crashing into something at place in <trg>,evt057arg01driverpassenger,,,,
216
+ disaster.accidentcrash.accidentcrash,what is the <arg2> in <trg>,,evt057arg02vehicle,,,
217
+ disaster.accidentcrash.accidentcrash,what is the <arg3> being crashed into in <trg>,,,evt057arg03crashobject,,
218
+ disaster.accidentcrash.accidentcrash,where is the <arg4> in <trg>,,,,evt057arg04place,
219
+ disaster.diseaseoutbreak.diseaseoutbreak,what is the <arg1> broking out amoing victims or population at place in <trg>,evt148arg01disease ,,,,
220
+ disaster.diseaseoutbreak.diseaseoutbreak,what is the <arg2> in <trg>,,evt148arg02victim ,,,
221
+ disaster.diseaseoutbreak.diseaseoutbreak,where is the <arg3> in <trg>,,,evt148arg03place ,,
222
+ disaster.fireexplosion.fireexplosion,what is the <arg1> catching fire or exploding from instrument at place in <trg>,evt059arg01fireexplosionobject,,,,
223
+ disaster.fireexplosion.fireexplosion,what is the <arg2> being exploded from in <trg>,,evt059arg02instrument,,,
224
+ disaster.fireexplosion.fireexplosion,where is the <arg3> in <trg>,,,evt059arg03place,,
225
+ genericcrime.genericcrime.genericcrime,who is the <arg1> committing a crime against victim in <trg>,evt154arg01perpetrator ,,,,
226
+ genericcrime.genericcrime.genericcrime,who is the <arg2> being committed against in <trg>,,evt154arg02victim ,,,
227
+ genericcrime.genericcrime.genericcrime,where is the <arg3> in <trg>,,,evt154arg03place ,,
228
+ government.agreements.unspecified,who is the <arg1> signing an agreement in <trg>,evt060arg01participant,,,,
229
+ government.agreements.unspecified,who is the <arg2> signing an agreement in <trg>,,evt060arg02participant,,,
230
+ government.agreements.unspecified,where is the <arg3> in <trg>,,,evt060arg03place,,
231
+ government.agreements.acceptagreementcontractceasefire,who is the <arg1> signing an agreement in <trg>,evt061arg01participant,,,,
232
+ government.agreements.acceptagreementcontractceasefire,who is the <arg2> signing an agreement in <trg>,,evt061arg02participant,,,
233
+ government.agreements.acceptagreementcontractceasefire,where is the <arg3> in <trg>,,,evt061arg03place,,
234
+ government.agreements.rejectnullifyagreementcontractceasefire,who is the <arg1> rejecting or nullifying an agreement with participant in place,evt062arg01rejecternullifier,,,,
235
+ government.agreements.rejectnullifyagreementcontractceasefire,who is the <arg2> being rejected in <trg>,,evt062arg02otherparticipant,,,
236
+ government.agreements.rejectnullifyagreementcontractceasefire,where is the <arg3> in <trg>,,,evt062arg03place,,
237
+ government.agreements.violateagreement,who is the <arg1> violating an agreement with participant in place in <trg>e,evt063arg01violator,,,,
238
+ government.agreements.violateagreement,who is the <arg2> being violated with an agreement by violator in <trg>,,evt063arg02otherparticipant,,,
239
+ government.agreements.violateagreement,where is the <arg3> in <trg>,,,evt063arg03place,,
240
+ government.convene.convene,who is the <arg1> convening somebody in <trg>,evt145arg01convener ,,,,
241
+ government.convene.convene,who is the <arg2> being convened in <trg>,,evt145arg02convenedthing ,,,
242
+ government.convene.convene,where is the <arg3> in <trg>,,,evt145arg03place ,,
243
+ government.formation.unspecified,what is the <arg1> being formed by founder in place in <trg>,evt064arg01gpe,,,,
244
+ government.formation.unspecified,who is the <arg2> forming something in <trg>,,evt064arg02founder,,,
245
+ government.formation.unspecified,where is the <arg3> in <trg>,,,evt064arg03place,,
246
+ government.formation.mergegpe,who is the <arg1> merging with participant in <trg>,evt065arg01participant,,,,
247
+ government.formation.mergegpe,who is the <arg2> being merged with in <trg>,,evt065arg02participant,,,
248
+ government.formation.mergegpe,where is the <arg3> in <trg>,,,evt065arg03place,,
249
+ government.formation.startgpe,what is the <arg1> started by founder in <trg>,evt066arg01gpe,,,,
250
+ government.formation.startgpe,who is the <arg2> starting something in <trg>,,evt066arg02founder,,,
251
+ government.formation.startgpe,where is the <arg3> in <trg>,,,evt066arg03place,,
252
+ government.legislate.legislate,what is the <arg1> enacted law in <trg>,evt068arg01governmentbody,,,,
253
+ government.legislate.legislate,what is the <arg2> being enacted by government in <trg>,,evt068arg02law,,,
254
+ government.legislate.legislate,where is the <arg3> in <trg>,,,evt068arg03place,,
255
+ government.spy.spy,who is the <arg1> spying on something to the benefit of beneficiary in <trg>,evt070arg01spy,,,,
256
+ government.spy.spy,what is the <arg2> being spied on to the benefit of beneficiary in <trg>,,evt070arg02observedentity,,,
257
+ government.spy.spy,what is the target <arg3> benefit in <trg>,,,evt070arg03beneficiary,,
258
+ government.spy.spy,where is the <arg4> in <trg>,,,,evt070arg04place,
259
+ government.vote.unspecified,who is the <arg1> voting for candidate on ballot with results in <trg>,evt071arg01voter,,,,
260
+ government.vote.unspecified,what is the <arg2> being voted for on ballot with results in <trg>,,evt071arg02candidate,,,
261
+ government.vote.unspecified,what is the <arg3> voter voting for on in <trg>,,,evt071arg03ballot,,
262
+ government.vote.unspecified,what is the <arg4> voter voting for with in <trg>,,,,evt071arg04result,
263
+ government.vote.unspecified,where is the <arg5> in <trg>,,,,,evt071arg05place
264
+ government.vote.castvote,who is the <arg1> voting for candidate on ballot with results in <trg>,evt072arg01voter,,,,
265
+ government.vote.castvote,what is the <arg2> being voted for on ballot with results in <trg>,,evt072arg02candidate,,,
266
+ government.vote.castvote,what is the <arg3> voter voting for on in <trg>,,,evt072arg03ballot,,
267
+ government.vote.castvote,what is the <arg4> voter voting for with in <trg>,,,,evt072arg04result,
268
+ government.vote.castvote,where is the <arg5> in <trg>,,,,,evt072arg05place
269
+ government.vote.violationspreventvote,who is the <arg1> preventing voter from voting for candidate on ballot in <trg>,evt073arg01preventer,,,,
270
+ government.vote.violationspreventvote,who is the <arg2> being prevented from voting for candidate on ballot in <trg>,,evt073arg02voter,,,
271
+ government.vote.violationspreventvote,who is the <arg3> being prevented from voting for in <trg>,,,evt073arg03candidate,,
272
+ government.vote.violationspreventvote,what is the <arg4> in <trg>,,,,evt073arg04ballot,
273
+ government.vote.violationspreventvote,where is the <arg5> in <trg>,,,,,evt073arg05place
274
+ inspection.sensoryobserve.unspecified,who is the <arg1> observing something in <trg>,evt074arg01observer,,,,
275
+ inspection.sensoryobserve.unspecified,what is the <arg2> being observed in <trg>,,evt074arg02observedentity,,,
276
+ inspection.sensoryobserve.unspecified,where is the <arg3> in <trg>,,,evt074arg03place,,
277
+ inspection.sensoryobserve.inspectpeopleorganization,who is the <arg1> inspecting something in <trg>,evt075arg01inspector,,,,
278
+ inspection.sensoryobserve.inspectpeopleorganization,what is the <arg2> being inspected in <trg>,,evt075arg02inspectedentity,,,
279
+ inspection.sensoryobserve.inspectpeopleorganization,where is the <arg3> in <trg>,,,evt075arg03place,,
280
+ inspection.sensoryobserve.monitorelection,who is the <arg1> monitoring something taking part in an election in <trg>,evt076arg01monitor,,,,
281
+ inspection.sensoryobserve.monitorelection,what is the <arg2> being monitored taking part in an election in <trg>,,evt076arg02monitoredentity,,,
282
+ inspection.sensoryobserve.monitorelection,where is the <arg3> in <trg>,,,evt076arg03place,,
283
+ inspection.sensoryobserve.physicalinvestigateinspect,who is the <arg1> inspecting something in <trg>,evt077arg01inspector,,,,
284
+ inspection.sensoryobserve.physicalinvestigateinspect,what is the <arg2> being inspected in <trg>,,evt077arg02inspectedentity,,,
285
+ inspection.sensoryobserve.physicalinvestigateinspect,where is the <arg3> in <trg>,,,evt077arg03place,,
286
+ inspection.targetaimat.targetaimat,who is the <arg1> physically targeted target with instrument in <trg>,evt153arg01targeter ,,,,
287
+ inspection.targetaimat.targetaimat,what is the <arg2> being physically targeted in <trg>,,evt153arg02target ,,,
288
+ inspection.targetaimat.targetaimat,what is the <arg3> targeter physically targeted with in <trg>,,,evt153arg03instrument ,,
289
+ inspection.targetaimat.targetaimat,where is the <arg4> in <trg>,,,,evt153arg04place ,
290
+ justice.arrestjaildetain.arrestjaildetain,who is the <arg1> arresting or jailing detainee for crime in <trg>,evt079arg01jailer,,,,
291
+ justice.arrestjaildetain.arrestjaildetain,who is the <arg2> being arrested or jailed by jailer in <trg>,,evt079arg02detainee,,,
292
+ justice.arrestjaildetain.arrestjaildetain,what is the <arg3> jailer jailed or arrested for in <trg>,,,evt079arg03crime,,
293
+ justice.arrestjaildetain.arrestjaildetain,where is the <arg4> in <trg>,,,,evt079arg04place,
294
+ justice.initiatejudicialprocess.unspecified,who is the <arg1> initiating judicial process pertaining to defendant before court or judge for crime in <trg>,evt080arg01prosecutor,,,,
295
+ justice.initiatejudicialprocess.unspecified,what is the <arg2> prosecutor initiated judicial process pertaining to in <trg>,,evt080arg02defendant,,,
296
+ justice.initiatejudicialprocess.unspecified,what is the <arg3> prosecutor initiated judicial process pertaining to defendant before in <trg>,,,evt080arg03judgecourt,,
297
+ justice.initiatejudicialprocess.unspecified,what is the <arg4> prosecutor initiated judicial process pertaining to defendant before court or judge for in <trg>,,,,evt080arg04crime,
298
+ justice.initiatejudicialprocess.unspecified,where is the <arg5> in <trg>,,,,,evt080arg05place
299
+ justice.initiatejudicialprocess.chargeindict,who is the <arg1> charging or indicting defendant before court or judge for crime in <trg>,evt081arg01prosecutor,,,,
300
+ justice.initiatejudicialprocess.chargeindict,who is the <arg2> being charged or indicted before court or judge for crime in <trg>,,evt081arg02defendant,,,
301
+ justice.initiatejudicialprocess.chargeindict,what is the <arg3> prosecutor charging or indicting defendant before in <trg>,,,evt081arg03judgecourt,,
302
+ justice.initiatejudicialprocess.chargeindict,what is the <arg4> prosecutor charging or indicting defendant before court or judge for in <trg>,,,,evt081arg04crime,
303
+ justice.initiatejudicialprocess.chargeindict,where is the <arg5> in <trg>,,,,,evt081arg05place
304
+ justice.initiatejudicialprocess.trialhearing,who is the <arg1> trying defendant before court or judge for crime in <trg>,evt082arg01prosecutor,,,,
305
+ justice.initiatejudicialprocess.trialhearing,who is the <arg2> tried by prosecutor before court or judge for crime in <trg>,,evt082arg02defendant,,,
306
+ justice.initiatejudicialprocess.trialhearing,what is the <arg3> prosecutor tried defendant before in <trg>,,,evt082arg03judgecourt,,
307
+ justice.initiatejudicialprocess.trialhearing,what is the <arg4> prosecutor tried defendant before court or judge for in <trg> ,,,,evt082arg04crime,
308
+ justice.initiatejudicialprocess.trialhearing,where is the <arg5> in <trg>,,,,,evt082arg05place
309
+ justice.investigate.unspecified,who is the <arg1> investigating defendant in <trg>,evt083arg01investigator,,,,
310
+ justice.investigate.unspecified,what is the <arg2> being investigated in <trg>,,evt083arg02defendant,,,
311
+ justice.investigate.unspecified,where is the <arg3> in <trg>,,,evt083arg03place,,
312
+ justice.investigate.investigatecrime,who is the <arg1> investigating defendant for crime in <trg>,evt084arg01investigator,,,,
313
+ justice.investigate.investigatecrime,what is the <arg2> being investigated for crime in <trg>,,evt084arg02defendant,,,
314
+ justice.investigate.investigatecrime,what is the <arg3> investigator investigated defendant for in <trg>,,,evt084arg03crime,,
315
+ justice.investigate.investigatecrime,where is the <arg4> in <trg>,,,,evt084arg04place,
316
+ justice.judicialconsequences.unspecified,what is the <arg1> deciding consequences of crime committed by defendant in <trg>,evt085arg01judgecourt,,,,
317
+ justice.judicialconsequences.unspecified,what is the <arg2> court or judge decided consequences of crime committed by in <trg>,,evt085arg02defendant,,,
318
+ justice.judicialconsequences.unspecified,what is the <arg3> court or judge decided consequences of in <trg>,,,evt085arg03crime,,
319
+ justice.judicialconsequences.unspecified,where is the <arg4> in <trg>,,,,evt085arg04place,
320
+ justice.judicialconsequences.convict,what is the <arg1> convicting defendant of crime in <trg>,evt086arg01judgecourt,,,,
321
+ justice.judicialconsequences.convict,what is the <arg2> convicted by court or judge in <trg>,,evt086arg02defendant,,,
322
+ justice.judicialconsequences.convict,what is the <arg3> court or judge convicted defendant of in <trg>,,,evt086arg03crime,,
323
+ justice.judicialconsequences.convict,where is the <arg4> in <trg>,,,,evt086arg04place,
324
+ justice.judicialconsequences.execute,who is the <arg1> executing defendant for crime in <trg>,evt087arg01executioner,,,,
325
+ justice.judicialconsequences.execute,what is the <arg2> executed by excutioner for crime in <trg>,,evt087arg02defendant,,,
326
+ justice.judicialconsequences.execute,what is the <arg3> executioner executed defendant for in <trg>,,,evt087arg03crime,,
327
+ justice.judicialconsequences.execute,where is the <arg4> in <trg>,,,,evt087arg04place,
328
+ justice.judicialconsequences.extradite,who is the <arg1> extraditing defendant for crime from place to place in <trg>,evt088arg01extraditer,,,,
329
+ justice.judicialconsequences.extradite,what is the <arg2> extradited by extraditer for crime from place to place in <trg>,,evt088arg02defendant,,,
330
+ justice.judicialconsequences.extradite,what is the <arg3> extraditer extradited for from place to place in <trg>,,,evt088arg03crime,,
331
+ justice.judicialconsequences.extradite,where is the original <arg4> place in <trg>,,,,evt088arg04origin,
332
+ justice.judicialconsequences.extradite,where is the target <arg5> place in <trg>,,,,,evt088arg05destination
333
+ life.die.unspecified,who is the <arg1> dying at place from medical issue killed by killer in <trg>,evt089arg01victim,,,,
334
+ life.die.unspecified,where is the <arg2> in <trg>,,evt089arg02place,,,
335
+ life.die.unspecified,who is the <arg3> killing victime in <trg>,,,evt089arg03killer,,
336
+ life.die.unspecified,what is the <arg4> victim died from in <trg>,,,,evt089arg04medicalissue,
337
+ life.die.deathcausedbyviolentevents,who is the <arg1> killing victim using instrument or medical issue in <trg>,evt090arg01killer,,,,
338
+ life.die.deathcausedbyviolentevents,what is the <arg2> being killed using instrument or medical issue in <trg>,,evt090arg02victim,,,
339
+ life.die.deathcausedbyviolentevents,what is the <arg3> killer killed victim using in <trg>,,,evt090arg03instrument,,
340
+ life.die.deathcausedbyviolentevents,where is the <arg4> in <trg>,,,,evt090arg04place,
341
+ life.die.deathcausedbyviolentevents,what is the <arg5> killer killed victim using in <trg>,,,,,evt090arg05medicalissue
342
+ life.die.nonviolentdeath,who is the <arg1> dying at place from medical issue killed by killer in <trg>,evt091arg01victim,,,,
343
+ life.die.nonviolentdeath,where is the <arg2> in <trg>,,evt091arg02place,,,
344
+ life.die.nonviolentdeath,who is the <arg3> killing victime in <trg>,,,evt091arg03killer,,
345
+ life.die.nonviolentdeath,what is the <arg4> victim died from in <trg>,,,,evt091arg04medicalissue,
346
+ life.injure.unspecified,who is the <arg1> being injured by injurer with medical issue in <trg>,evt092arg01victim,,,,
347
+ life.injure.unspecified,who is the <arg2> injuring victims with medical issue in <trg>,,evt092arg02injurer,,,
348
+ life.injure.unspecified,where is the <arg3> in <trg>,,,evt092arg03place,,
349
+ life.injure.unspecified,what is the <arg4> victim was injured by injurer with in <trg>,,,,evt092arg04medicalissue,
350
+ life.injure.illnessdegradationhungerthirst,who is the <arg1> having extreme hunger or thirst from medical issue imposed by injurer in <trg>,evt093arg01victim,,,,
351
+ life.injure.illnessdegradationhungerthirst,where is the <arg2> in <trg>,,evt093arg02place,,,
352
+ life.injure.illnessdegradationhungerthirst,what is the <arg3> imposed by injurer in <trg>,,,evt093arg03injurer,,
353
+ life.injure.illnessdegradationhungerthirst,what is the <arg4> victim has extreme hunger or thirst from in <trg>,,,,evt093arg04medicalissue,
354
+ life.injure.illnessdegradationphysical,who is the <arg1> having some physical degradation form medical issue imposed by injurer in <trg>,evt094arg01victim,,,,
355
+ life.injure.illnessdegradationphysical,where is the <arg2> in <trg>,,evt094arg02place,,,
356
+ life.injure.illnessdegradationphysical,who is the <arg3> imposing physical degradation in <trg>,,,evt094arg03injurer,,
357
+ life.injure.illnessdegradationphysical,what is the <arg4> victim has some physical degradation from in <trg>,,,,evt094arg04medicalissue,
358
+ life.injure.illnessdegredationsickness,who is the <arg1> having sickness or illness in <trg>,evt150arg01victim ,,,,
359
+ life.injure.illnessdegredationsickness,what is the <arg2> infecting victim in <trg>,,evt150arg02injurer ,,,
360
+ life.injure.illnessdegredationsickness,what is the <arg3> victim having infected by injurer in <trg>,,,evt150arg03disease ,,
361
+ life.injure.illnessdegredationsickness,where is the <arg4> in <trg>,,,,evt150arg04place ,
362
+ life.injure.injurycausedbyviolentevents,who is the <arg1> injuring victim in <trg>,evt095arg01injurer,,,,
363
+ life.injure.injurycausedbyviolentevents,who is the <arg2> injured by injurer in <trg>,,evt095arg02victim,,,
364
+ life.injure.injurycausedbyviolentevents,what is the <arg3> injurer injured victim using in <trg>,,,evt095arg03instrument,,
365
+ life.injure.injurycausedbyviolentevents,where is the <arg4> in <trg>,,,,evt095arg04place,
366
+ life.injure.injurycausedbyviolentevents,what is the <arg5> injurer injured victim using in <trg>,,,,,evt095arg05medicalissue
367
+ manufacture.artifact.unspecified,who is the <arg1> manufacturing or creating producing artifact using instrument in <trg>,evt096arg01manufacturer,,,,
368
+ manufacture.artifact.unspecified,what is the <arg2> manufactured or created or produced by manufacturer in <trg>,,evt096arg02artifact,,,
369
+ manufacture.artifact.unspecified,what is the <arg3> manufacturer manufactured or created or produced artifact using in <trg>,,,evt096arg03instrument,,
370
+ manufacture.artifact.unspecified,where is the <arg4> in <trg>,,,,evt096arg04place,
371
+ manufacture.artifact.build,who is the <arg1> manufacturing or creating producing artifact using instrument in <trg>,evt097arg01manufacturer,,,,
372
+ manufacture.artifact.build,what is the <arg2> manufactured or created or produced by manufacturer in <trg>,,evt097arg02artifact,,,
373
+ manufacture.artifact.build,what is the <arg3> manufacturer manufactured or created or produced artifact using in <trg>,,,evt097arg03instrument,,
374
+ manufacture.artifact.build,where is the <arg4> in <trg>,,,,evt097arg04place,
375
+ manufacture.artifact.createintellectualproperty,who is the <arg1> manufacturing or creating producing artifact using instrument in <trg>,evt098arg01manufacturer,,,,
376
+ manufacture.artifact.createintellectualproperty,what is the <arg2> manufactured or created or produced by manufacturer in <trg>,,evt098arg02artifact,,,
377
+ manufacture.artifact.createintellectualproperty,what is the <arg3> manufacturer manufactured or created or produced artifact using in <trg>,,,evt098arg03instrument,,
378
+ manufacture.artifact.createintellectualproperty,where is the <arg4> in <trg>,,,,evt098arg04place,
379
+ manufacture.artifact.createmanufacture,who is the <arg1> manufacturing or creating producing artifact using instrument in <trg>,evt099arg01manufacturer,,,,
380
+ manufacture.artifact.createmanufacture,what is the <arg2> manufactured or created or produced by manufacturer in <trg>,,evt099arg02artifact,,,
381
+ manufacture.artifact.createmanufacture,what is the <arg3> manufacturer manufactured or created or produced artifact using in <trg>,,,evt099arg03instrument,,
382
+ manufacture.artifact.createmanufacture,where is the <arg4> in <trg>,,,,evt099arg04place,
383
+ medical.intervention.intervention,who is the <arg1> treating patient for medical issue with means in <trg>,evt147arg01treater ,,,,
384
+ medical.intervention.intervention,who is the <arg2> being treated by treater for medical with means in <trg> ,,evt147arg02patient ,,,
385
+ medical.intervention.intervention,what is the <arg3> treater treated patient for in <trg>,,,evt147arg03medicalissue ,,
386
+ medical.intervention.intervention,what is the <arg4> treater treated patient for medical issue with in <trg>,,,,evt147arg04instrument ,
387
+ medical.intervention.intervention,where is the <arg5> in <trg>,,,,,evt147arg05place
388
+ movement.transportartifact.unspecified,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt100arg01transporter,,,,
389
+ movement.transportartifact.unspecified,what is the <arg2> being transported by transporter in vehicle from place to place in <trg>,,evt100arg02artifact,,,
390
+ movement.transportartifact.unspecified,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt100arg03vehicle,,
391
+ movement.transportartifact.unspecified,where is the original <arg4> place in <trg>,,,,evt100arg04origin,
392
+ movement.transportartifact.unspecified,where is the target <arg5> place in <trg>,,,,,evt100arg05destination
393
+ movement.transportartifact.bringcarryunload,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt101arg01transporter,,,,
394
+ movement.transportartifact.bringcarryunload,what is the <arg2> being transported by transporter in vehicle from place to place in <trg>,,evt101arg02artifact,,,
395
+ movement.transportartifact.bringcarryunload,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt101arg03vehicle,,
396
+ movement.transportartifact.bringcarryunload,where is the original <arg4> place in <trg>,,,,evt101arg04origin,
397
+ movement.transportartifact.bringcarryunload,where is the target <arg5> place in <trg>,,,,,evt101arg05destination
398
+ movement.transportartifact.disperseseparate,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt102arg01transporter,,,,
399
+ movement.transportartifact.disperseseparate,what is the <arg2> being transported by transporter in vehicle from place to place in <trg>,,evt102arg02artifact,,,
400
+ movement.transportartifact.disperseseparate,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt102arg03vehicle,,
401
+ movement.transportartifact.disperseseparate,where is the original <arg4> place in <trg>,,,,evt102arg04origin,
402
+ movement.transportartifact.disperseseparate,where is the target <arg5> place in <trg>,,,,,evt102arg05destination
403
+ movement.transportartifact.fall,what is the <arg1> falling from place to place in <trg>,evt103arg01artifact,,,,
404
+ movement.transportartifact.fall,where is the original <arg2> place in <trg>,,evt103arg02origin,,,
405
+ movement.transportartifact.fall,where is the target <arg3> place in <trg>,,,evt103arg03destination,,
406
+ movement.transportartifact.grantentry,who is the <arg1> granting artifact entry from place to place in <trg>,evt104arg01transporter,,,,
407
+ movement.transportartifact.grantentry,what is the <arg2> granted by transporter from place to place in <trg>,,evt104arg02artifact,,,
408
+ movement.transportartifact.grantentry,where is the original <arg3> place in <trg>,,,evt104arg03origin,,
409
+ movement.transportartifact.grantentry,where is the target <arg4> place in <trg>,,,,evt104arg04destination,
410
+ movement.transportartifact.hide,who is the <arg1> concealing artifact in place transported in vehicle from place in <trg>,evt105arg01transporter,,,,
411
+ movement.transportartifact.hide,what is the <arg2> concealed by transporter in place transported in vehicle from place in <trg>,,evt105arg02artifact,,,
412
+ movement.transportartifact.hide,where is the target <arg3> place in <trg>,,,evt105arg03hidingplace,,
413
+ movement.transportartifact.hide,what is the <arg4> transporter concealing artifact in place transported in from place in <trg>,,,,evt105arg04vehicle,
414
+ movement.transportartifact.hide,where is the original <arg5> place in <trg>,,,,,evt105arg05origin
415
+ movement.transportartifact.lossofcontrol,who is the <arg1> losing control of moving something in place in <trg>,evt146arg01controller ,,,,
416
+ movement.transportartifact.lossofcontrol,what is the <arg2> controller losing control of moving in <trg>,,evt146arg02controlledthing ,,,
417
+ movement.transportartifact.lossofcontrol,where is the <arg3> in <trg>,,,evt146arg03place ,,
418
+ movement.transportartifact.nonviolentthrowlaunch,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt106arg01transporter,,,,
419
+ movement.transportartifact.nonviolentthrowlaunch,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt106arg02artifact,,,
420
+ movement.transportartifact.nonviolentthrowlaunch,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt106arg03vehicle,,
421
+ movement.transportartifact.nonviolentthrowlaunch,where is the original <arg4> place in <trg>,,,,evt106arg04origin,
422
+ movement.transportartifact.nonviolentthrowlaunch,where is the target <arg5> place in <trg>,,,,,evt106arg05destination
423
+ movement.transportartifact.prevententry,who is the <arg1> preventing transporter from transporting artifact from place to place in <trg>,evt107arg01preventer,,,,
424
+ movement.transportartifact.prevententry,who is the <arg2> prevented by preventer from transporting artifact from place to place in <trg>,,evt107arg02transporter,,,
425
+ movement.transportartifact.prevententry,what is the <arg3> preventer prevented transporter from transporting in <trg>,,,evt107arg03artifact,,
426
+ movement.transportartifact.prevententry,where is the original <arg4> place in <trg>,,,,evt107arg04origin,
427
+ movement.transportartifact.prevententry,where is the target <arg5> place in <trg>,,,,,evt107arg05destination
428
+ movement.transportartifact.preventexit,who is the <arg1> preventing transporter from transporting artifact from place to place in <trg>,evt108arg01preventer,,,,
429
+ movement.transportartifact.preventexit,who is the <arg2> prevented by preventer from transporting artifact from place to place in <trg>,,evt108arg02transporter,,,
430
+ movement.transportartifact.preventexit,what is the <arg3> preventer prevented transporter from transporting in <trg>,,,evt108arg03artifact,,
431
+ movement.transportartifact.preventexit,where is the original <arg4> place in <trg>,,,,evt108arg04origin,
432
+ movement.transportartifact.preventexit,where is the target <arg5> place in <trg>,,,,,evt108arg05destination
433
+ movement.transportartifact.receiveimport,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt109arg01transporter,,,,
434
+ movement.transportartifact.receiveimport,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt109arg02artifact,,,
435
+ movement.transportartifact.receiveimport,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt109arg03vehicle,,
436
+ movement.transportartifact.receiveimport,where is the original <arg4> place in <trg>,,,,evt109arg04origin,
437
+ movement.transportartifact.receiveimport,where is the target <arg5> place in <trg>,,,,,evt109arg05destination
438
+ movement.transportartifact.sendsupplyexport,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt110arg01transporter,,,,
439
+ movement.transportartifact.sendsupplyexport,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt110arg02artifact,,,
440
+ movement.transportartifact.sendsupplyexport,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt110arg03vehicle,,
441
+ movement.transportartifact.sendsupplyexport,where is the original <arg4> place in <trg>,,,,evt110arg04origin,
442
+ movement.transportartifact.sendsupplyexport,where is the target <arg5> place in <trg>,,,,,evt110arg05destination
443
+ movement.transportartifact.smuggleextract,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt111arg01transporter,,,,
444
+ movement.transportartifact.smuggleextract,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt111arg02artifact,,,
445
+ movement.transportartifact.smuggleextract,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt111arg03vehicle,,
446
+ movement.transportartifact.smuggleextract,where is the original <arg4> place in <trg>,,,,evt111arg04origin,
447
+ movement.transportartifact.smuggleextract,where is the target <arg5> place in <trg>,,,,,evt111arg05destination
448
+ movement.transportperson.unspecified,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt112arg01transporter,,,,
449
+ movement.transportperson.unspecified,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt112arg02passenger,,,
450
+ movement.transportperson.unspecified,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt112arg03vehicle,,
451
+ movement.transportperson.unspecified,where is the original <arg4> place in <trg>,,,,evt112arg04origin,
452
+ movement.transportperson.unspecified,where is the target <arg5> place in <trg>,,,,,evt112arg05destination
453
+ movement.transportperson.bringcarryunload,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt113arg01transporter,,,,
454
+ movement.transportperson.bringcarryunload,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt113arg02passenger,,,
455
+ movement.transportperson.bringcarryunload,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt113arg03vehicle,,
456
+ movement.transportperson.bringcarryunload,where is the original <arg4> place in <trg>,,,,evt113arg04origin,
457
+ movement.transportperson.bringcarryunload,where is the target <arg5> place in <trg>,,,,,evt113arg05destination
458
+ movement.transportperson.disperseseparate,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt114arg01transporter,,,,
459
+ movement.transportperson.disperseseparate,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt114arg02passenger,,,
460
+ movement.transportperson.disperseseparate,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt114arg03vehicle,,
461
+ movement.transportperson.disperseseparate,where is the original <arg4> place in <trg>,,,,evt114arg04origin,
462
+ movement.transportperson.disperseseparate,where is the target <arg5> place in <trg>,,,,,evt114arg05destination
463
+ movement.transportperson.evacuationrescue,who is the <arg1> transporting artifact in vehicle from place to place in <trg>,evt115arg01transporter,,,,
464
+ movement.transportperson.evacuationrescue,what is the <arg2> being trangsported in vehicle from place to place in <trg>,,evt115arg02passenger,,,
465
+ movement.transportperson.evacuationrescue,what is the <arg3> transporter transporting artifact in from place to place in <trg>,,,evt115arg03vehicle,,
466
+ movement.transportperson.evacuationrescue,where is the original <arg4> place in <trg>,,,,evt115arg04origin,
467
+ movement.transportperson.evacuationrescue,where is the target <arg5> place in <trg>,,,,,evt115arg05destination
468
+ movement.transportperson.fall,what is the <arg1> falling from place to place in <trg>,evt116arg01passenger,,,,
469
+ movement.transportperson.fall,where is the original <arg2> place in <trg>,,evt116arg02origin,,,
470
+ movement.transportperson.fall,where is the target <arg3> place in <trg>,,,evt116arg03destination,,
471
+ movement.transportperson.grantentryasylum,who is the <arg1> granting entry to transporter transporting passenger from place to place in <trg>,evt117arg01granter,,,,
472
+ movement.transportperson.grantentryasylum,who is the <arg2> granter grants entry to in <trg>,,evt117arg02transporter,,,
473
+ movement.transportperson.grantentryasylum,what is the <arg3> granter grants entry to transporter transporting in <trg>,,,evt117arg03passenger,,
474
+ movement.transportperson.grantentryasylum,where is the original <arg4> place in <trg>,,,,evt117arg04origin,
475
+ movement.transportperson.grantentryasylum,where is the target <arg5> place in <trg>,,,,,evt117arg05destination
476
+ movement.transportperson.hide,who is the <arg1> concealing artifact in place transported in vehicle from place in <trg>,evt118arg01transporter,,,,
477
+ movement.transportperson.hide,what is the <arg2> concealed by transporter in place transported in vehicle from place in <trg>,,evt118arg02passenger,,,
478
+ movement.transportperson.hide,where is the <arg3> transporter concealing artifact in transported in vehicle from place in <trg>,,,evt118arg03hidingplace,,
479
+ movement.transportperson.hide,what is the <arg4> transporter concealing artifact in place transported in from place in <trg>,,,,evt118arg04vehicle,
480
+ movement.transportperson.hide,where is the original <arg5> place in <trg>,,,,,evt118arg05origin
481
+ movement.transportperson.prevententry,who is the <arg1> preventing transporter from transporting artifact from place to place in <trg>,evt119arg01preventer,,,,
482
+ movement.transportperson.prevententry,who is the <arg2> prevented by preventer from transporting artifact from place to place in <trg>,,evt119arg02transporter,,,
483
+ movement.transportperson.prevententry,what is the <arg3> preventer prevented transporter from transporting in <trg>,,,evt119arg03passenger,,
484
+ movement.transportperson.prevententry,where is the original <arg4> place in <trg>,,,,evt119arg04origin,
485
+ movement.transportperson.prevententry,where is the target <arg5> place in <trg>,,,,,evt119arg05destination
486
+ movement.transportperson.preventexit,who is the <arg1> preventing transporter from transporting artifact from place to place in <trg>,evt120arg01preventer,,,,
487
+ movement.transportperson.preventexit,who is the <arg2> prevented by preventer from transporting artifact from place to place in <trg>,,evt120arg02transporter,,,
488
+ movement.transportperson.preventexit,what is the <arg3> preventer prevented transporter from transporting in <trg>,,,evt120arg03passenger,,
489
+ movement.transportperson.preventexit,where is the original <arg4> place in <trg>,,,,evt120arg04origin,
490
+ movement.transportperson.preventexit,where is the target <arg5> place in <trg>,,,,,evt120arg05destination
491
+ movement.transportperson.selfmotion,who is the <arg1> moving in vehicle from place to place in <trg>,evt121arg01transporter,,,,
492
+ movement.transportperson.selfmotion,what is the <arg2> transporter moved in from place to place in <trg>,,evt121arg02vehicle,,,
493
+ movement.transportperson.selfmotion,where is the original <arg3> place in <trg>,,,evt121arg03origin,,
494
+ movement.transportperson.selfmotion,where is the target <arg4> place in <trg>,,,,evt121arg04destination,
495
+ movement.transportperson.smuggleextract,who is the <arg1> transporting passenger in vehicle from place to place in <trg>,evt122arg01transporter,,,,
496
+ movement.transportperson.smuggleextract,who is the <arg2> transported by transporter in vehicle from place to place in <trg>,,evt122arg02passenger,,,
497
+ movement.transportperson.smuggleextract,what is the <arg3> transporter transporting passenger in from place to place in <trg>,,,evt122arg03vehicle,,
498
+ movement.transportperson.smuggleextract,where is the original <arg4> place in <trg>,,,,evt122arg04origin,
499
+ movement.transportperson.smuggleextract,where is the target <arg5> place in <trg>,,,,,evt122arg05destination
500
+ personnel.elect.unspecified,who is the <arg1> electing candidate in place in <trg>,evt123arg01voter,,,,
501
+ personnel.elect.unspecified,who is the <arg2> elected by voter in place in <trg>,,evt123arg02candidate,,,
502
+ personnel.elect.unspecified,where is the <arg3> place in <trg>,,,evt123arg03place,,
503
+ personnel.elect.winelection,who is the <arg1> electing candidate in place in <trg>,evt124arg01voter,,,,
504
+ personnel.elect.winelection,who is the <arg2> elected by voter in place in <trg>,,evt124arg02candidate,,,
505
+ personnel.elect.winelection,where is the <arg3> place in <trg>,,,evt124arg03place,,
506
+ personnel.endposition.unspecified,who is the <arg1> stopping working at place of employment in <trg>,evt125arg01employee,,,,
507
+ personnel.endposition.unspecified,what is the <arg2> employee stopping working at in <trg>,,evt125arg02placeofemployment,,,
508
+ personnel.endposition.unspecified,where is the <arg3> in <trg>,,,evt125arg03place,,
509
+ personnel.endposition.firinglayoff,who is the <arg1> stopping working at place of employment in <trg>,evt126arg01employee,,,,
510
+ personnel.endposition.firinglayoff,what is the <arg2> employee stopping working at in <trg>,,evt126arg02placeofemployment,,,
511
+ personnel.endposition.firinglayoff,where is the <arg3> in <trg>,,,evt126arg03place,,
512
+ personnel.endposition.quitretire,who is the <arg1> stopping working at place of employment in <trg>,evt127arg01employee,,,,
513
+ personnel.endposition.quitretire,what is the <arg2> employee stopping working at in <trg>,,evt127arg02placeofemployment,,,
514
+ personnel.endposition.quitretire,where is the <arg3> in <trg>,,,evt127arg03place,,
515
+ personnel.startposition.unspecified,who is the <arg1> starting working at place of employment in <trg>,evt128arg01employee,,,,
516
+ personnel.startposition.unspecified,what is the <arg2> employee starting working at in <trg>,,evt128arg02placeofemployment,,,
517
+ personnel.startposition.unspecified,where is the <arg3> in <trg>,,,evt128arg03place,,
518
+ personnel.startposition.hiring,who is the <arg1> starting working at place of employment in <trg>,evt129arg01employee,,,,
519
+ personnel.startposition.hiring,what is the <arg2> employee starting working at in <trg>,,evt129arg02placeofemployment,,,
520
+ personnel.startposition.hiring,where is the <arg3> in <trg>,,,evt129arg03place,,
521
+ transaction.transaction.unspecified,who is the <arg1> in a transaction for the benefit of beneficiary in <trg>,evt130arg01participant,,,,
522
+ transaction.transaction.unspecified,who is the <arg2> in a transaction for the benefit of beneficiary in <trg>,,evt130arg02participant,,,
523
+ transaction.transaction.unspecified,what is the <arg3> the benefit of beneficiary in <trg>,,,evt130arg03beneficiary,,
524
+ transaction.transaction.unspecified,where is the <arg4> in <trg>,,,,evt130arg04place,
525
+ transaction.transaction.embargosanction,who is the <arg1> preventing giver from giving artifact money to recipient in <trg>,evt131arg01preventer,,,,
526
+ transaction.transaction.embargosanction,who is the <arg2> prevented by preventer from giving money to recipient in <trg>,,evt131arg02giver,,,
527
+ transaction.transaction.embargosanction,who is the <arg3> preventer prevented giver from giving artifact money to in <trg>,,,evt131arg03recipient,,
528
+ transaction.transaction.embargosanction,what is the <arg4> preventer prevented giver from giving to recipient in <trg>,,,,evt131arg04artifactmoney,
529
+ transaction.transaction.embargosanction,where is the <arg5> in <trg>,,,,,evt131arg05place
530
+ transaction.transaction.giftgrantprovideaid,who is the <arg1> giving something to recipient for the benefit of beneficiary in <trg>,evt132arg01giver,,,,
531
+ transaction.transaction.giftgrantprovideaid,who is the <arg2> giver gave something to for the benefit of beneficiary in <trg>,,evt132arg02recipient,,,
532
+ transaction.transaction.giftgrantprovideaid,what is the <arg3> giver gave something to recipient for the benefit of in <trg>,,,evt132arg03beneficiary,,
533
+ transaction.transaction.giftgrantprovideaid,where is the <arg4> in <trg>,,,,evt132arg04place,
534
+ transaction.transfermoney.unspecified,who is the <arg1> giving money to recipient for the benefit of beneficiary in <trg>,evt133arg01giver,,,,
535
+ transaction.transfermoney.unspecified,who is the <arg2> giver gave money to for the benefit of beneficiary in <trg>,,evt133arg02recipient,,,
536
+ transaction.transfermoney.unspecified,what is the <arg3> giver gave money to recipient for the benefit of in <trg>,,,evt133arg03beneficiary,,
537
+ transaction.transfermoney.unspecified,what is the <arg4> giver gave to recipient for the benefit of beneficiary in <trg<>,,,,evt133arg04money,
538
+ transaction.transfermoney.unspecified,where is the <arg5> in <trg>,,,,,evt133arg05place
539
+ transaction.transfermoney.borrowlend,who is the <arg1> giving money to recipient for the benefit of beneficiary in <trg>,evt134arg01giver,,,,
540
+ transaction.transfermoney.borrowlend,who is the <arg2> giver gave money to for the benefit of beneficiary in <trg>,,evt134arg02recipient,,,
541
+ transaction.transfermoney.borrowlend,what is the <arg3> giver gave money to recipient for the benefit of in <trg>,,,evt134arg03beneficiary,,
542
+ transaction.transfermoney.borrowlend,what is the <arg4> giver gave to recipient for the benefit of beneficiary in <trg<>,,,,evt134arg04money,
543
+ transaction.transfermoney.borrowlend,where is the <arg5> in <trg>,,,,,evt134arg05place
544
+ transaction.transfermoney.embargosanction,who is the <arg1> preventing giver from giving artifact money to recipient in <trg>,evt135arg01preventer,,,,
545
+ transaction.transfermoney.embargosanction,who is the <arg2> prevented by preventer from giving money to recipient in <trg>,,evt135arg02giver,,,
546
+ transaction.transfermoney.embargosanction,who is the <arg3> preventer prevented giver from giving artifact money to in <trg>,,,evt135arg03recipient,,
547
+ transaction.transfermoney.embargosanction,what is the <arg4> preventer prevented giver from giving to recipient in <trg>,,,,evt135arg04money,
548
+ transaction.transfermoney.embargosanction,where is the <arg5> in <trg>,,,,,evt135arg05place
549
+ transaction.transfermoney.giftgrantprovideaid,who is the <arg1> giving money to recipient for the benefit of beneficiary in <trg>,evt136arg01giver,,,,
550
+ transaction.transfermoney.giftgrantprovideaid,who is the <arg2> giver gave money to for the benefit of beneficiary in <trg>,,evt136arg02recipient,,,
551
+ transaction.transfermoney.giftgrantprovideaid,what is the <arg3> giver gave money to recipient for the benefit of in <trg>,,,evt136arg03beneficiary,,
552
+ transaction.transfermoney.giftgrantprovideaid,what is the <arg4> giver gave to recipient for the benefit of beneficiary in <trg<>,,,,evt136arg04money,
553
+ transaction.transfermoney.giftgrantprovideaid,where is the <arg5> in <trg>,,,,,evt136arg05place
554
+ transaction.transfermoney.payforservice,who is the <arg1> giving money to recipient for the benefit of beneficiary in <trg>,evt137arg01giver,,,,
555
+ transaction.transfermoney.payforservice,who is the <arg2> giver gave money to for the benefit of beneficiary in <trg>,,evt137arg02recipient,,,
556
+ transaction.transfermoney.payforservice,what is the <arg3> giver gave money to recipient for the benefit of in <trg>,,,evt137arg03beneficiary,,
557
+ transaction.transfermoney.payforservice,what is the <arg4> giver gave to recipient for the benefit of beneficiary in <trg<>,,,,evt137arg04money,
558
+ transaction.transfermoney.payforservice,where is the <arg5> in <trg>,,,,,evt137arg05place
559
+ transaction.transfermoney.purchase,who is the <arg1> giving money to recipient for the benefit of beneficiary in <trg>,evt138arg01giver,,,,
560
+ transaction.transfermoney.purchase,who is the <arg2> giver gave money to for the benefit of beneficiary in <trg>,,evt138arg02recipient,,,
561
+ transaction.transfermoney.purchase,what is the <arg3> giver gave money to recipient for the benefit of in <trg>,,,evt138arg03beneficiary,,
562
+ transaction.transfermoney.purchase,what is the <arg4> giver gave to recipient for the benefit of beneficiary in <trg>,,,,evt138arg04money,
563
+ transaction.transfermoney.purchase,where is the <arg5> in <trg>,,,,,evt138arg05place
564
+ transaction.transferownership.unspecified,who is the <arg1> giving artifact to recipient for the benefit of beneficiary in <trg>,evt139arg01giver,,,,
565
+ transaction.transferownership.unspecified,who is the <arg2> giver artifact to for the benefit of beneficiary in <trg>,,evt139arg02recipient,,,
566
+ transaction.transferownership.unspecified,what is the <arg3> giver artifact to recipient for the benefit of in <trg>,,,evt139arg03beneficiary,,
567
+ transaction.transferownership.unspecified,what is the <arg4> giver gaving to recipient for the benefit of beneficiart in <trg>,,,,evt139arg04artifact,
568
+ transaction.transferownership.unspecified,where is the <arg5> in <trg>,,,,,evt139arg05place
569
+ transaction.transferownership.borrowlend,who is the <arg1> giving artifact to recipient for the benefit of beneficiary in <trg>,evt140arg01giver,,,,
570
+ transaction.transferownership.borrowlend,who is the <arg2> giver artifact to for the benefit of beneficiary in <trg>,,evt140arg02recipient,,,
571
+ transaction.transferownership.borrowlend,what is the <arg3> giver artifact to recipient for the benefit of in <trg>,,,evt140arg03beneficiary,,
572
+ transaction.transferownership.borrowlend,what is the <arg4> giver gaving to recipient for the benefit of beneficiart in <trg>,,,,evt140arg04artifact,
573
+ transaction.transferownership.borrowlend,where is the <arg5> in <trg>,,,,,evt140arg05place
574
+ transaction.transferownership.embargosanction,who is the <arg1> preventing giver from giving artifact money to recipient in <trg>,evt141arg01preventer,,,,
575
+ transaction.transferownership.embargosanction,who is the <arg2> prevented by preventer from giving money to recipient in <trg>,,evt141arg02giver,,,
576
+ transaction.transferownership.embargosanction,who is the <arg3> preventer prevented giver from giving artifact money to in <trg>,,,evt141arg03recipient,,
577
+ transaction.transferownership.embargosanction,what is the <arg4> preventer prevented giver from giving to recipient in <trg>,,,,evt141arg04artifact,
578
+ transaction.transferownership.embargosanction,where is the <arg5> in <trg>,,,,,evt141arg05place
579
+ transaction.transferownership.giftgrantprovideaid,who is the <arg1> giving artifact to recipient for the benefit of beneficiary in <trg>,evt142arg01giver,,,,
580
+ transaction.transferownership.giftgrantprovideaid,who is the <arg2> giver artifact to for the benefit of beneficiary in <trg>,,evt142arg02recipient,,,
581
+ transaction.transferownership.giftgrantprovideaid,what is the <arg3> giver artifact to recipient for the benefit of in <trg>,,,evt142arg03beneficiary,,
582
+ transaction.transferownership.giftgrantprovideaid,what is the <arg4> giver gaving to recipient for the benefit of beneficiart in <trg>,,,,evt142arg04artifact,
583
+ transaction.transferownership.giftgrantprovideaid,where is the <arg5> in <trg>,,,,,evt142arg05place
584
+ transaction.transferownership.purchase,who is the <arg1> giving artifact to recipient for the benefit of beneficiary in <trg>,evt143arg01giver,,,,
585
+ transaction.transferownership.purchase,who is the <arg2> giver artifact to for the benefit of beneficiary in <trg>,,evt143arg02recipient,,,
586
+ transaction.transferownership.purchase,what is the <arg3> giver artifact to recipient for the benefit of in <trg>,,,evt143arg03beneficiary,,
587
+ transaction.transferownership.purchase,what is the <arg4> giver gaving to recipient for the benefit of beneficiart in <trg>,,,,evt143arg04artifact,
588
+ transaction.transferownership.purchase,where is the <arg5> in <trg>,,,,,evt143arg05place
589
+ transaction.transaction.transfercontrol,who is the <arg1> transferring control of something to recipient for the benefit of beneficiary in <trg>,evt144arg01giver,,,,
590
+ transaction.transaction.transfercontrol,who is the <arg2> giver transferred control of something to for the benefit of beneficiary in <trg>,,evt144arg02recipient,,,
591
+ transaction.transaction.transfercontrol,what is the <arg3> giver transferred control of something to recipient for the benefit of in <trg>,,,evt144arg03beneficiary,,
592
+ transaction.transaction.transfercontrol,what is the <arg4> giver transferred control of in <trg>,,,,evt144arg04territoryorfacility,
593
+ transaction.transaction.transfercontrol,where is the <arg5> in <trg>,,,,,evt144arg05place
app.py ADDED
@@ -0,0 +1,431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import difflib
2
+ import os
3
+ import json
4
+ from tqdm import tqdm
5
+ from glob import glob
6
+ #
7
+ # if not os.path.exists('./evttgr2type.json'):
8
+ # for file_name in glob('data/RAMS_1.0/data/test.jsonlines'):
9
+ # dic = {}
10
+ # with open(file_name,'r',encoding='utf-8') as f:
11
+ # lines = f.readlines()
12
+ # for line in tqdm(lines):
13
+ # linej = json.loads(line.strip())
14
+ # evt_triggers = linej['evt_triggers']
15
+ # # print(evt_triggers)
16
+ # sentences = linej['sentences']
17
+ # # print(sentences)
18
+ # sentences_uni = []
19
+ # for s in sentences:
20
+ # sentences_uni += s
21
+ # print(' '.join(sentences_uni))
22
+ # triggers = ' '.join(sentences_uni[evt_triggers[0][0]:evt_triggers[0][1]+1])
23
+ # evt_type = evt_triggers[0][2][0][0]
24
+ # if triggers in dic:
25
+ # if dic[triggers] != evt_type:
26
+ # print('一个触发词有不同的事件类型: {} {} {}'.format(triggers,evt_type,dic[triggers]))
27
+ # dic[triggers] = evt_type
28
+ # print(evt_type, triggers)
29
+ # exit()
30
+
31
+ import argparse
32
+ import jsonlines
33
+ import torch
34
+
35
+ from src.genie.data import my_collate
36
+ from src.genie.data_module_w import RAMSDataModule
37
+ from src.genie.model import GenIEModel
38
+
39
+ import gradio as gr
40
+
41
+ import re
42
+ from transformers import BartTokenizer
43
+
44
+ MAX_LENGTH = 424
45
+ MAX_TGT_LENGTH = 72
46
+ DOC_STRIDE = 256
47
+
48
+ class DataModule4():
49
+ def __init__(self, ontology_file):
50
+ super().__init__()
51
+ self.ontology_file = ontology_file
52
+ self.tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
53
+ self.tokenizer.add_tokens([' <arg>', ' <tgr>'])
54
+ self.ontology_dict = self.load_ontology()
55
+
56
+ def create_gold_gen(self, context_words, evt_type, trigger):
57
+ # 设置三个总列表、存放输入模板、输出模板
58
+ INPUT = []
59
+ CONTEXT = []
60
+ input_template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
61
+ i = len(input_template)
62
+ input_list = []
63
+ for x in range(i):
64
+ str = re.sub(r'<arg\d>', '<arg>', input_template[x])
65
+ input_list.append(str)
66
+ # 其中input_list种存放的是 原始数据中<arg1> 全部替换为 <arg> 之后的模板 下一步应该进行分词
67
+ temp = []
68
+ for x in range(i):
69
+ space_tokenized_template = input_list[x].split(' ')
70
+ temp.append(space_tokenized_template)
71
+ # 其中temp中存放的都是分词后的模板 下一步对temp中的所有元素进行tokenize
72
+ tokenized_input_template = []
73
+ for x in range(len(temp)):
74
+ for w in temp[x]:
75
+ tokenized_input_template.extend(self.tokenizer.tokenize(w, add_prefix_space=True))
76
+ INPUT.append(tokenized_input_template)
77
+ tokenized_input_template = []
78
+ context_words = context_words.split(' ')
79
+ trigger_words = trigger.split(' ')
80
+ trigger_span_start = context_words.index(trigger_words[0])
81
+ trigger_span_end = context_words.index(trigger_words[-1])
82
+ # 触发词之前的单词
83
+ prefix = self.tokenizer.tokenize(' '.join(context_words[:trigger_span_start]), add_prefix_space=True)
84
+ # 触发词短语
85
+ tgt = self.tokenizer.tokenize(trigger, add_prefix_space=True)
86
+ # 触发词之后的单词
87
+ suffix = self.tokenizer.tokenize(' '.join(context_words[trigger_span_end+1:]), add_prefix_space=True)
88
+ context = prefix + [' <tgr>', ] + tgt + [' <tgr>', ] + suffix
89
+ # context = self.tokenizer.tokenize(' '.join(context_words), add_prefix_space=True)
90
+
91
+ # 将context放入CONTEXT中
92
+ for w in range(i):
93
+ CONTEXT.append(context)
94
+ return INPUT, CONTEXT
95
+
96
+ def load_ontology(self):
97
+ ontology_dict = {}
98
+ with open(self.ontology_file, 'r') as f:
99
+ for lidx, line in enumerate(f):
100
+ if lidx == 0: # header
101
+ continue
102
+ fields = line.strip().split(',')
103
+ if len(fields) < 2:
104
+ break
105
+ evt_type = fields[0]
106
+ if evt_type in ontology_dict.keys():
107
+ args = fields[2:]
108
+ ontology_dict[evt_type]['template'].append(fields[1])
109
+ for i, arg in enumerate(args):
110
+ if arg != '':
111
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
112
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
113
+ else:
114
+ ontology_dict[evt_type] = {}
115
+ args = fields[2:]
116
+ ontology_dict[evt_type]['template'] = []
117
+ ontology_dict[evt_type]['template'].append(fields[1])
118
+ for i, arg in enumerate(args):
119
+ if arg != '':
120
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
121
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
122
+
123
+ return ontology_dict
124
+
125
+ def prepare_data(self, sentences, evt_type, trigger):
126
+ input_template, context = self.create_gold_gen(sentences, evt_type, trigger)
127
+ length = len(input_template)
128
+ # print(input_template)
129
+ # print(context)
130
+ results = []
131
+ for i in range(length):
132
+ input_tokens = self.tokenizer.encode_plus(input_template[i], context[i],
133
+ add_special_tokens=True,
134
+ add_prefix_space=True,
135
+ max_length=MAX_LENGTH,
136
+ truncation='only_second',
137
+ padding='max_length')
138
+ # input_ids 单词在词典中的编码
139
+ results.append(input_tokens['input_ids'])
140
+ temp = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]
141
+ return results, temp
142
+
143
+ class DataModuleW():
144
+ def __init__(self, ontology_file):
145
+ super().__init__()
146
+ self.ontology_file = ontology_file
147
+ self.tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
148
+ self.tokenizer.add_tokens([' <arg>', ' <tgr>'])
149
+ self.ontology_dict = self.load_ontology()
150
+
151
+ def create_gold_gen(self, context_words, evt_type, trigger):
152
+ # 设置三个总列表、存放输入模板、输出模板
153
+ INPUT = []
154
+ CONTEXT = []
155
+ input_template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
156
+ i = len(input_template)
157
+ input_list = []
158
+ for x in range(i):
159
+ str = re.sub('<trg>', trigger, input_template[x])
160
+ str = re.sub('<trg>', trigger, str)
161
+ input_list.append(str)
162
+ # 其中input_list种存放的是 原始数据中<arg1> 全部替换为 <arg> 之后的模板 下一步应该进行分词
163
+ temp = []
164
+ for x in range(i):
165
+ space_tokenized_template = input_list[x].split(' ')
166
+ temp.append(space_tokenized_template)
167
+ # 其中temp中存放的都是分词后的模板 下一步对temp中的所有元素进行tokenize
168
+ tokenized_input_template = []
169
+ for x in range(len(temp)):
170
+ for w in temp[x]:
171
+ tokenized_input_template.extend(self.tokenizer.tokenize(w, add_prefix_space=True))
172
+ INPUT.append(tokenized_input_template)
173
+ tokenized_input_template = []
174
+ template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
175
+ for y in range(len(template)):
176
+ template[y] = re.sub('<trg>', trigger, template[y])
177
+
178
+ context = self.tokenizer.tokenize(context_words, add_prefix_space=True)
179
+ # 将context放入CONTEXT中
180
+ for w in range(i):
181
+ CONTEXT.append(context)
182
+
183
+ return INPUT, CONTEXT
184
+
185
+ def load_ontology(self):
186
+ ontology_dict = {}
187
+ with open(self.ontology_file, 'r') as f:
188
+ for lidx, line in tqdm(enumerate(f)):
189
+ if lidx == 0: # header
190
+ continue
191
+ fields = line.strip().split(',')
192
+ if len(fields) < 2:
193
+ break
194
+ evt_type = fields[0]
195
+ if evt_type in ontology_dict.keys():
196
+ args = fields[2:]
197
+ ontology_dict[evt_type]['template'].append(fields[1])
198
+ for i, arg in enumerate(args):
199
+ if arg != '':
200
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
201
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
202
+ else:
203
+ ontology_dict[evt_type] = {}
204
+ args = fields[2:]
205
+ ontology_dict[evt_type]['template'] = []
206
+ ontology_dict[evt_type]['template'].append(fields[1])
207
+ for i, arg in enumerate(args):
208
+ if arg != '':
209
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
210
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
211
+
212
+ return ontology_dict
213
+
214
+ def prepare_data(self, sentences, evt_type, trigger):
215
+ input_template, context = self.create_gold_gen(sentences, evt_type, trigger)
216
+ length = len(input_template)
217
+ # print(input_template)
218
+ # print(output_template)
219
+ # print(context)
220
+ results = []
221
+ for i in range(length):
222
+ input_tokens = self.tokenizer.encode_plus(input_template[i], context[i],
223
+ add_special_tokens=True,
224
+ add_prefix_space=True,
225
+ max_length=MAX_LENGTH,
226
+ truncation='only_second',
227
+ padding='max_length')
228
+ # input_ids 单词在词典中的编码
229
+ results.append(input_tokens['input_ids'])
230
+ temp = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]
231
+ return results, temp
232
+
233
+ class Runner():
234
+ def __init__(self, load_ckpt = 'checkpoints/gen-RAMS-what-new-span/epoch=2-v0.ckpt'):
235
+ model = 'gen'
236
+ self.ckpt_name = 'gen-RAMS-pred'
237
+ self.load_ckpt = load_ckpt
238
+ self.dataset = 'RAMS'
239
+ self.eval_only = True
240
+ self.train_file = 'data/RAMS_1.0/data/train.jsonlines'
241
+ self.val_file = 'data/RAMS_1.0/data/dev.jsonlines'
242
+ self.test_file = 'data/RAMS_1.0/data/test.jsonlines'
243
+ self.train_batch_size = 2
244
+ self.eval_batch_size = 4
245
+ self.learning_rate = 3e-5
246
+ self.accumulate_grad_batches = 4
247
+ self.num_train_epochs = 3
248
+
249
+ parser = argparse.ArgumentParser()
250
+
251
+ # Required parameters
252
+ parser.add_argument(
253
+ "--model",
254
+ type=str,
255
+ default=model
256
+ )
257
+ parser.add_argument(
258
+ "--dataset",
259
+ type=str,
260
+ default=self.dataset
261
+ )
262
+ parser.add_argument('--tmp_dir', type=str)
263
+ parser.add_argument(
264
+ "--ckpt_name",
265
+ default=self.ckpt_name,
266
+ type=str,
267
+ help="The output directory where the model checkpoints and predictions will be written.",
268
+ )
269
+ parser.add_argument(
270
+ "--load_ckpt",
271
+ default=self.load_ckpt,
272
+ type=str,
273
+ )
274
+ parser.add_argument(
275
+ "--train_file",
276
+ default=self.train_file,
277
+ type=str,
278
+ help="The input training file. If a data dir is specified, will look for the file there"
279
+ + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
280
+ )
281
+ parser.add_argument(
282
+ "--val_file",
283
+ default=self.val_file,
284
+ type=str,
285
+ help="The input evaluation file. If a data dir is specified, will look for the file there"
286
+ + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
287
+ )
288
+ parser.add_argument(
289
+ '--test_file',
290
+ type=str,
291
+ default=self.test_file,
292
+ )
293
+ parser.add_argument('--input_dir', type=str, default=None)
294
+ parser.add_argument('--coref_dir', type=str, default='data/kairos/coref_outputs')
295
+ parser.add_argument('--use_info', action='store_true', default=False,
296
+ help='use informative mentions instead of the nearest mention.')
297
+ parser.add_argument('--mark_trigger', action='store_true')
298
+ parser.add_argument('--sample-gen', action='store_true', help='Do sampling when generation.')
299
+ parser.add_argument("--train_batch_size", default=self.train_batch_size, type=int,
300
+ help="Batch size per GPU/CPU for training.")
301
+ parser.add_argument(
302
+ "--eval_batch_size", default=self.eval_batch_size, type=int, help="Batch size per GPU/CPU for evaluation."
303
+ )
304
+ parser.add_argument("--learning_rate", default=self.learning_rate, type=float,
305
+ help="The initial learning rate for Adam.")
306
+ parser.add_argument(
307
+ "--accumulate_grad_batches",
308
+ type=int,
309
+ default=self.accumulate_grad_batches,
310
+ help="Number of updates steps to accumulate before performing a backward/update pass.",
311
+ )
312
+ parser.add_argument("--weight_decay", default=0.0, type=float, help="Weight decay if we apply some.")
313
+ parser.add_argument("--adam_epsilon", default=1e-8, type=float, help="Epsilon for Adam optimizer.")
314
+ parser.add_argument("--gradient_clip_val", default=1.0, type=float, help="Max gradient norm.")
315
+ parser.add_argument(
316
+ "--num_train_epochs", default=self.num_train_epochs, type=int,
317
+ help="Total number of training epochs to perform."
318
+ )
319
+ parser.add_argument(
320
+ "--max_steps",
321
+ default=-1,
322
+ type=int,
323
+ help="If > 0: set total number of training steps to perform. Override num_train_epochs.",
324
+ )
325
+ parser.add_argument("--warmup_steps", default=0, type=int, help="Linear warmup over warmup_steps.")
326
+
327
+ parser.add_argument("--gpus", default=None, help='-1 means train on all gpus')
328
+ parser.add_argument("--seed", type=int, default=42, help="random seed for initialization")
329
+ parser.add_argument(
330
+ "--fp16",
331
+ action="store_true",
332
+ help="Whether to use 16-bit (mixed) precision (through NVIDIA apex) instead of 32-bit",
333
+ )
334
+ parser.add_argument("--threads", type=int, default=1,
335
+ help="multiple threads for converting example to features")
336
+ self.args = parser.parse_args()
337
+
338
+ self.model = GenIEModel(self.args)
339
+ self.model.load_state_dict(torch.load(self.args.load_ckpt, map_location=self.model.device)['state_dict'])
340
+
341
+ def pred(self,input):
342
+ x = torch.stack([torch.LongTensor(u) for u in input])
343
+ return self.model.pred(x)
344
+
345
+ print('Loading data...')
346
+ dm1 = DataModule4('aida_ontology_cleaned.csv')
347
+ dm2 = DataModuleW('aida_ontology_fj-w-2.csv')
348
+ dm3 = DataModuleW('aida_ontology_fj-w-3.csv')
349
+ dm4 = DataModule4('aida_ontology_fj-5.csv')
350
+
351
+ print('Loading Model 1...')
352
+ runner1 = Runner('checkpoints/gen-RAMS-1-span/epoch=2-v1.ckpt')
353
+ print('Loading Model 2...')
354
+ runner2 = Runner('checkpoints/gen-RAMS-2-span/epoch=2-v0.ckpt')
355
+ print('Loading Model 3...')
356
+ runner3 = Runner('checkpoints/gen-RAMS-3-span/epoch=2-v0.ckpt')
357
+ print('Loading Model 4...')
358
+ runner4 = Runner('checkpoints/gen-RAMS-4-span/epoch=2-v0.ckpt')
359
+
360
+ def handle(sentences,trigger, temp=3, evt_type='contact.prevarication.broadcast'):
361
+ x, argnames = eval('dm{}.prepare_data(sentences,evt_type,trigger)'.format(temp+1))
362
+ ys = eval('runner{}.pred(x)'.format(temp+1))
363
+ print(ys)
364
+ results = []
365
+ for y in ys:
366
+ while ' ' in y:
367
+ y = y.replace(' ', ' ')
368
+ result = y.strip(' ').split(' ')
369
+ results.append(result)
370
+ print(results)
371
+ argss = []
372
+ temp = 'trigger: ' + trigger
373
+ argss.append(temp)
374
+ # print(argnames)
375
+ for n,template in enumerate(argnames['template']):
376
+ template = template.split(' ')
377
+ # print(template)
378
+ args = []
379
+ for i, w in enumerate(template):
380
+ if '<arg' in w:
381
+ m = re.match(r'evt\d+arg\d+(\w+)', argnames[re.match(r'<(\w+)>', w).group(1)])
382
+ if m:
383
+ label = m.group(1)
384
+ if results[n][i] == '<arg>':
385
+ args.append(label+': None')
386
+ else:
387
+ args.append(label+': '+results[n][i])
388
+ argss.append(', '.join(args))
389
+ #print(argss)
390
+ if len(argnames['template']) == 1:
391
+ temp = argss[1].split(',')
392
+ rs = []
393
+ rs.append(argss[0])
394
+ for i in temp:
395
+ rs.append(i)
396
+ argss = rs
397
+ return '\n'.join(argss)
398
+
399
+ if __name__ == "__main__":
400
+ # trigger = 'deceive'
401
+ # sentences = """We are ashamed of them . " However , Mutko stopped short of admitting the doping scandal was state sponsored . " We are very sorry that athletes who tried to deceive us , and the world , were not caught sooner . We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values , " he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio"""
402
+ # print(handle(sentences, trigger))
403
+
404
+ dm_key = list(dm1.ontology_dict.keys())
405
+ print(len(dm_key))
406
+ def get_tmp(index,evt_type):
407
+ if index is None or evt_type is None:
408
+ return ''
409
+ input_template = eval("dm{}.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']".format(index+1))
410
+ return '\n'.join(input_template)
411
+
412
+ with gr.Blocks() as demo:
413
+ with gr.Row().style(equal_height=False):
414
+ with gr.Column(variant="panel"):
415
+ stens = gr.Text(label='文档')
416
+ evt_type = gr.Dropdown(choices=dm_key, label='事件类型')
417
+ trigger = gr.Text(label='触发词')
418
+ temp = gr.Dropdown(choices=['基础模板', '简单子模板', '融入语义信息的子模板', '融入论元信息的子模板'],
419
+ type='index', value='基础模板', label='模板')
420
+
421
+ output_tmp = gr.Text(label='模板内容')
422
+ btn = gr.Button("Run")
423
+ input_examples = gr.Examples(examples=[["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "基础模板","contact.prevarication.broadcast"],["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "简单子模板", "contact.prevarication.broadcast"],["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "融入语义信息的子模板", "contact.prevarication.broadcast"],["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "融入论元信息的子模板", "contact.prevarication.broadcast"]],inputs=[stens, trigger, temp, evt_type])
424
+
425
+ #btn = gr.Button("Run")
426
+ with gr.Column(variant="panel"):
427
+ result = gr.Text(label='输出论元生成结果')
428
+ evt_type.change(get_tmp,inputs=[temp,evt_type],outputs=[output_tmp])
429
+ temp.change(get_tmp,inputs=[temp,evt_type],outputs=[output_tmp])
430
+ btn.click(fn=handle, inputs=[stens,trigger,temp,evt_type], outputs=[result])
431
+ demo.launch(server_name='0.0.0.0',server_port=6006,share=True)
flagged/log.csv ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 数据输入,模板,输出,flag,username,timestamp
2
+ "'{
3
+ ""rel_triggers"": [],
4
+ ""gold_rel_links"": [],
5
+ ""doc_key"": ""nw_RC00c8620ef5810429342a1c339e6c76c1b0b9add3f6010f04482fd832"",
6
+ ""ent_spans"": [
7
+ [27, 27, [[""evt043arg01communicator"", 1.0]]],
8
+ [48, 48, [[""evt043arg03place"", 1.0]]],
9
+ [32, 36, [[""evt043arg02recipient"", 1.0]]]],
10
+ ""language_id"": ""eng"",
11
+ ""source_url"": ""http://bbc.co.uk/sport/athletics/36295481"",
12
+ ""evt_triggers"": [[31, 31, [[""contact.prevarication.broadcast"", 1.0]]]],
13
+ ""split"": ""test"",
14
+ ""sentences"": [[""We"", ""are"", ""ashamed"", ""of"", ""them"", ""."", ""\""""],
15
+ [""However"", "","", ""Mutko"", ""stopped"", ""short"", ""of"", ""admitting"", ""the"", ""doping"", ""scandal"", ""was"", ""state"", ""sponsored"", "".""],
16
+ [""\"""", ""We"", ""are"", ""very"", ""sorry"", ""that"", ""athletes"", ""who"", ""tried"", ""to"", ""deceive"", ""us"", "","", ""and"", ""the"", ""world"", "","", ""were"", ""not"", ""caught"", ""sooner"", "".""],
17
+ [""We"", ""are"", ""very"", ""sorry"", ""because"", ""Russia"", ""is"", ""committed"", ""to"", ""upholding"", ""the"", ""highest"", ""standards"", ""in"", ""sport"", ""and"", ""is"", ""opposed"", ""to"", ""anything"", ""that"", ""threatens"", ""the"", ""Olympic"", ""values"", "","", ""\"""", ""he"", ""said"", "".""],
18
+ [""English"", ""former"", ""heptathlete"", ""and"", ""Athens"", ""2004"", ""bronze"", ""medallist"", ""Kelly"", ""Sotherton"", ""was"", ""unhappy"", ""with"", ""Mutko"", ""'s"", ""plea"", ""for"", ""Russia"", ""'s"", ""ban"", ""to"", ""be"", ""lifted"", ""for"", ""Rio""]],
19
+ ""gold_evt_links"": [[[31, 31], [27, 27], ""evt043arg01communicator""], [[31, 31], [32, 36], ""evt043arg02recipient""], [[31, 31], [48, 48], ""evt043arg03place""]]
20
+ }",模板四," Mutko communicated to recipient about topic at place (one-way communication)
21
+ Communicator communicated to <arg> about topic at place (one-way communication)
22
+ Communicator communicated to recipient about topic at <arg> place (one-way communication)
23
+ Communicator communicated to recipient about <arg> topic at place (one-way communication)",,,2022-10-26 08:46:09.392562
head_what_new_preprocessed_data/test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3431c0bd2ef65487a7e0900c901bb5044725f5ed624f5279677a83c112cae30
3
+ size 12597960
head_what_new_preprocessed_data/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82b7ab52100a6c3573f94ec4271469d30d047d5389a42ef97a957b0d1a4c8b32
3
+ size 106039983
head_what_new_preprocessed_data/val.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a9a4da7025f405380ee4451d44215838c3207b761d1aefbf3f022c34c7e8049
3
+ size 13403704
head_what_new_preprocessed_data_span/test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2be2da47452d07bc53cb6be56f3d0ad770e213b42bab143b95d990047b2f8ead
3
+ size 12603278
head_what_new_preprocessed_data_span/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82b7ab52100a6c3573f94ec4271469d30d047d5389a42ef97a957b0d1a4c8b32
3
+ size 106039983
head_what_new_preprocessed_data_span/val.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a9a4da7025f405380ee4451d44215838c3207b761d1aefbf3f022c34c7e8049
3
+ size 13403704
requirements.txt ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ absl-py==1.2.0
2
+ aiohttp==3.8.3
3
+ aiosignal==1.2.0
4
+ anyio==3.6.1
5
+ argon2-cffi==21.1.0
6
+ astunparse==1.6.3
7
+ async-timeout==4.0.2
8
+ attrs==21.2.0
9
+ Babel==2.9.1
10
+ backcall==0.2.0
11
+ bcrypt==4.0.0
12
+ bert4keras==0.11.3
13
+ bleach==4.1.0
14
+ blis==0.7.8
15
+ brotlipy==0.7.0
16
+ cachetools==4.2.2
17
+ catalogue==2.0.7
18
+ certifi==2021.5.30
19
+ cffi @ file:///tmp/build/80754af9/cffi_1625807838443/work
20
+ chardet @ file:///tmp/build/80754af9/chardet_1607706746162/work
21
+ charset-normalizer==2.1.1
22
+ click==7.1.2
23
+ conda==4.10.3
24
+ conda-package-handling @ file:///tmp/build/80754af9/conda-package-handling_1618262148928/work
25
+ cryptography @ file:///tmp/build/80754af9/cryptography_1616769286105/work
26
+ cycler==0.10.0
27
+ cymem==2.0.6
28
+ dataclasses==0.6
29
+ debugpy==1.4.3
30
+ decorator==5.1.0
31
+ defusedxml==0.7.1
32
+ en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl
33
+ entrypoints==0.3
34
+ fastapi==0.85.0
35
+ ffmpy==0.3.0
36
+ filelock==3.7.1
37
+ flatbuffers==1.12
38
+ frozenlist==1.3.1
39
+ fsspec==2022.5.0
40
+ future==0.18.2
41
+ gast==0.4.0
42
+ google-auth==1.35.0
43
+ google-auth-oauthlib==0.4.6
44
+ google-pasta==0.2.0
45
+ gradio==3.4.1
46
+ grpcio==1.40.0
47
+ h11==0.12.0
48
+ h5py==3.7.0
49
+ httpcore==0.15.0
50
+ httpx==0.23.0
51
+ idna @ file:///home/linux1/recipes/ci/idna_1610986105248/work
52
+ ipykernel==6.4.1
53
+ ipython==7.27.0
54
+ ipython-genutils==0.2.0
55
+ ipywidgets==7.6.5
56
+ jedi==0.18.0
57
+ Jinja2==3.0.1
58
+ joblib==1.1.0
59
+ json5==0.9.6
60
+ jsonlines==3.1.0
61
+ jsonschema==3.2.0
62
+ jupyter-client==7.0.3
63
+ jupyter-core==4.8.1
64
+ jupyter-server==1.11.0
65
+ jupyterlab==3.1.12
66
+ jupyterlab-language-pack-zh-CN @ http://autodl-public.ks3-cn-beijing.ksyun.com/instance/jupyterlab_language_pack_zh_CN-0.0.1.dev0-py2.py3-none-any.whl
67
+ jupyterlab-pygments==0.1.2
68
+ jupyterlab-server==2.8.1
69
+ jupyterlab-widgets==1.0.2
70
+ keras==2.9.0
71
+ Keras-Applications==1.0.8
72
+ Keras-Preprocessing==1.1.2
73
+ kiwisolver==1.3.2
74
+ libclang==14.0.6
75
+ linkify-it-py==1.0.3
76
+ Markdown==3.3.4
77
+ markdown-it-py==2.1.0
78
+ MarkupSafe==2.0.1
79
+ matplotlib==3.4.3
80
+ matplotlib-inline==0.1.3
81
+ mdit-py-plugins==0.3.1
82
+ mdurl==0.1.2
83
+ mistune==0.8.4
84
+ multidict==6.0.2
85
+ murmurhash==1.0.7
86
+ nbclassic==0.3.2
87
+ nbclient==0.5.4
88
+ nbconvert==6.1.0
89
+ nbformat==5.1.3
90
+ nest-asyncio==1.5.1
91
+ notebook==6.4.4
92
+ numpy==1.21.2
93
+ oauthlib==3.1.1
94
+ opt-einsum==3.3.0
95
+ orjson==3.8.0
96
+ packaging==21.0
97
+ pandas==1.5.0
98
+ pandocfilters==1.5.0
99
+ paramiko==2.11.0
100
+ parso==0.8.2
101
+ pathy==0.6.2
102
+ pexpect==4.8.0
103
+ pickleshare==0.7.5
104
+ Pillow==8.3.2
105
+ preshed==3.0.6
106
+ prometheus-client==0.11.0
107
+ prompt-toolkit==3.0.20
108
+ protobuf==3.18.0
109
+ ptyprocess==0.7.0
110
+ pyasn1==0.4.8
111
+ pyasn1-modules==0.2.8
112
+ pycosat==0.6.3
113
+ pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work
114
+ pycryptodome==3.15.0
115
+ pydantic==1.7.4
116
+ pydub==0.25.1
117
+ Pygments==2.10.0
118
+ PyNaCl==1.5.0
119
+ pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1608057966937/work
120
+ pyparsing==2.4.7
121
+ pyrsistent==0.18.0
122
+ PySocks @ file:///tmp/build/80754af9/pysocks_1605305779399/work
123
+ python-dateutil==2.8.2
124
+ python-multipart==0.0.5
125
+ pytorch-lightning==1.0.6
126
+ pytz==2021.1
127
+ PyYAML==6.0
128
+ pyzmq==22.3.0
129
+ regex==2022.6.2
130
+ requests @ file:///tmp/build/80754af9/requests_1608241421344/work
131
+ requests-oauthlib==1.3.0
132
+ requests-unixsocket==0.2.0
133
+ rfc3986==1.5.0
134
+ rsa==4.7.2
135
+ ruamel-yaml-conda @ file:///tmp/build/80754af9/ruamel_yaml_1616016699510/work
136
+ sacremoses==0.0.53
137
+ scipy==1.9.1
138
+ Send2Trash==1.8.0
139
+ sentencepiece==0.1.96
140
+ six @ file:///tmp/build/80754af9/six_1623709665295/work
141
+ smart-open==5.2.1
142
+ sniffio==1.2.0
143
+ spacy==3.0.0
144
+ spacy-legacy==3.0.9
145
+ srsly==2.4.3
146
+ starlette==0.20.4
147
+ supervisor==4.2.2
148
+ tensorboard==2.9.1
149
+ tensorboard-data-server==0.6.1
150
+ tensorboard-plugin-wit==1.8.0
151
+ tensorflow==2.9.0
152
+ tensorflow-estimator==2.9.0
153
+ tensorflow-io-gcs-filesystem==0.27.0
154
+ termcolor==2.0.1
155
+ terminado==0.12.1
156
+ testpath==0.5.0
157
+ thinc==8.0.17
158
+ tokenizers==0.8.1rc2
159
+ torch @ http://download.pytorch.org/whl/cu110/torch-1.7.0%2Bcu110-cp38-cp38-linux_x86_64.whl
160
+ torchvision @ http://download.pytorch.org/whl/cu110/torchvision-0.8.1%2Bcu110-cp38-cp38-linux_x86_64.whl
161
+ tornado==6.1
162
+ tqdm @ file:///tmp/build/80754af9/tqdm_1625563689033/work
163
+ traitlets==5.1.0
164
+ transformers==3.1.0
165
+ typer==0.3.2
166
+ typing-extensions==3.10.0.2
167
+ uc-micro-py==1.0.1
168
+ urllib3 @ file:///tmp/build/80754af9/urllib3_1625084269274/work
169
+ uvicorn==0.18.3
170
+ wasabi==0.9.1
171
+ wcwidth==0.2.5
172
+ webencodings==0.5.1
173
+ websocket-client==1.2.1
174
+ websockets==10.3
175
+ Werkzeug==2.0.1
176
+ widgetsnbextension==3.5.1
177
+ wrapt==1.14.1
178
+ yarl==1.8.1
runner.py ADDED
@@ -0,0 +1,431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import difflib
2
+ import os
3
+ import json
4
+ from tqdm import tqdm
5
+ from glob import glob
6
+ #
7
+ # if not os.path.exists('./evttgr2type.json'):
8
+ # for file_name in glob('data/RAMS_1.0/data/test.jsonlines'):
9
+ # dic = {}
10
+ # with open(file_name,'r',encoding='utf-8') as f:
11
+ # lines = f.readlines()
12
+ # for line in tqdm(lines):
13
+ # linej = json.loads(line.strip())
14
+ # evt_triggers = linej['evt_triggers']
15
+ # # print(evt_triggers)
16
+ # sentences = linej['sentences']
17
+ # # print(sentences)
18
+ # sentences_uni = []
19
+ # for s in sentences:
20
+ # sentences_uni += s
21
+ # print(' '.join(sentences_uni))
22
+ # triggers = ' '.join(sentences_uni[evt_triggers[0][0]:evt_triggers[0][1]+1])
23
+ # evt_type = evt_triggers[0][2][0][0]
24
+ # if triggers in dic:
25
+ # if dic[triggers] != evt_type:
26
+ # print('一个触发词有不同的事件类型: {} {} {}'.format(triggers,evt_type,dic[triggers]))
27
+ # dic[triggers] = evt_type
28
+ # print(evt_type, triggers)
29
+ # exit()
30
+
31
+ import argparse
32
+ import jsonlines
33
+ import torch
34
+
35
+ from src.genie.data import my_collate
36
+ from src.genie.data_module_w import RAMSDataModule
37
+ from src.genie.model import GenIEModel
38
+
39
+ import gradio as gr
40
+
41
+ import re
42
+ from transformers import BartTokenizer
43
+
44
+ MAX_LENGTH = 424
45
+ MAX_TGT_LENGTH = 72
46
+ DOC_STRIDE = 256
47
+
48
+ class DataModule4():
49
+ def __init__(self, ontology_file):
50
+ super().__init__()
51
+ self.ontology_file = ontology_file
52
+ self.tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
53
+ self.tokenizer.add_tokens([' <arg>', ' <tgr>'])
54
+ self.ontology_dict = self.load_ontology()
55
+
56
+ def create_gold_gen(self, context_words, evt_type, trigger):
57
+ # 设置三个总列表、存放输入模板、输出模板
58
+ INPUT = []
59
+ CONTEXT = []
60
+ input_template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
61
+ i = len(input_template)
62
+ input_list = []
63
+ for x in range(i):
64
+ str = re.sub(r'<arg\d>', '<arg>', input_template[x])
65
+ input_list.append(str)
66
+ # 其中input_list种存放的是 原始数据中<arg1> 全部替换为 <arg> 之后的模板 下一步应该进行分词
67
+ temp = []
68
+ for x in range(i):
69
+ space_tokenized_template = input_list[x].split(' ')
70
+ temp.append(space_tokenized_template)
71
+ # 其中temp中存放的都是分词后的模板 下一步对temp中的所有元素进行tokenize
72
+ tokenized_input_template = []
73
+ for x in range(len(temp)):
74
+ for w in temp[x]:
75
+ tokenized_input_template.extend(self.tokenizer.tokenize(w, add_prefix_space=True))
76
+ INPUT.append(tokenized_input_template)
77
+ tokenized_input_template = []
78
+ context_words = context_words.split(' ')
79
+ trigger_words = trigger.split(' ')
80
+ trigger_span_start = context_words.index(trigger_words[0])
81
+ trigger_span_end = context_words.index(trigger_words[-1])
82
+ # 触发词之前的单词
83
+ prefix = self.tokenizer.tokenize(' '.join(context_words[:trigger_span_start]), add_prefix_space=True)
84
+ # 触发词短语
85
+ tgt = self.tokenizer.tokenize(trigger, add_prefix_space=True)
86
+ # 触发词之后的单词
87
+ suffix = self.tokenizer.tokenize(' '.join(context_words[trigger_span_end+1:]), add_prefix_space=True)
88
+ context = prefix + [' <tgr>', ] + tgt + [' <tgr>', ] + suffix
89
+ # context = self.tokenizer.tokenize(' '.join(context_words), add_prefix_space=True)
90
+
91
+ # 将context放入CONTEXT中
92
+ for w in range(i):
93
+ CONTEXT.append(context)
94
+ return INPUT, CONTEXT
95
+
96
+ def load_ontology(self):
97
+ ontology_dict = {}
98
+ with open(self.ontology_file, 'r') as f:
99
+ for lidx, line in enumerate(f):
100
+ if lidx == 0: # header
101
+ continue
102
+ fields = line.strip().split(',')
103
+ if len(fields) < 2:
104
+ break
105
+ evt_type = fields[0]
106
+ if evt_type in ontology_dict.keys():
107
+ args = fields[2:]
108
+ ontology_dict[evt_type]['template'].append(fields[1])
109
+ for i, arg in enumerate(args):
110
+ if arg != '':
111
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
112
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
113
+ else:
114
+ ontology_dict[evt_type] = {}
115
+ args = fields[2:]
116
+ ontology_dict[evt_type]['template'] = []
117
+ ontology_dict[evt_type]['template'].append(fields[1])
118
+ for i, arg in enumerate(args):
119
+ if arg != '':
120
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
121
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
122
+
123
+ return ontology_dict
124
+
125
+ def prepare_data(self, sentences, evt_type, trigger):
126
+ input_template, context = self.create_gold_gen(sentences, evt_type, trigger)
127
+ length = len(input_template)
128
+ # print(input_template)
129
+ # print(context)
130
+ results = []
131
+ for i in range(length):
132
+ input_tokens = self.tokenizer.encode_plus(input_template[i], context[i],
133
+ add_special_tokens=True,
134
+ add_prefix_space=True,
135
+ max_length=MAX_LENGTH,
136
+ truncation='only_second',
137
+ padding='max_length')
138
+ # input_ids 单词在词典中的编码
139
+ results.append(input_tokens['input_ids'])
140
+ temp = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]
141
+ return results, temp
142
+
143
+ class DataModuleW():
144
+ def __init__(self, ontology_file):
145
+ super().__init__()
146
+ self.ontology_file = ontology_file
147
+ self.tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
148
+ self.tokenizer.add_tokens([' <arg>', ' <tgr>'])
149
+ self.ontology_dict = self.load_ontology()
150
+
151
+ def create_gold_gen(self, context_words, evt_type, trigger):
152
+ # 设置三个总列表、存放输入模板、输出模板
153
+ INPUT = []
154
+ CONTEXT = []
155
+ input_template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
156
+ i = len(input_template)
157
+ input_list = []
158
+ for x in range(i):
159
+ str = re.sub('<trg>', trigger, input_template[x])
160
+ str = re.sub('<trg>', trigger, str)
161
+ input_list.append(str)
162
+ # 其中input_list种存放的是 原始数据中<arg1> 全部替换为 <arg> 之后的模板 下一步应该进行分词
163
+ temp = []
164
+ for x in range(i):
165
+ space_tokenized_template = input_list[x].split(' ')
166
+ temp.append(space_tokenized_template)
167
+ # 其中temp中存放的都是分词后的模板 下一步对temp中的所有元素进行tokenize
168
+ tokenized_input_template = []
169
+ for x in range(len(temp)):
170
+ for w in temp[x]:
171
+ tokenized_input_template.extend(self.tokenizer.tokenize(w, add_prefix_space=True))
172
+ INPUT.append(tokenized_input_template)
173
+ tokenized_input_template = []
174
+ template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
175
+ for y in range(len(template)):
176
+ template[y] = re.sub('<trg>', trigger, template[y])
177
+
178
+ context = self.tokenizer.tokenize(context_words, add_prefix_space=True)
179
+ # 将context放入CONTEXT中
180
+ for w in range(i):
181
+ CONTEXT.append(context)
182
+
183
+ return INPUT, CONTEXT
184
+
185
+ def load_ontology(self):
186
+ ontology_dict = {}
187
+ with open(self.ontology_file, 'r') as f:
188
+ for lidx, line in tqdm(enumerate(f)):
189
+ if lidx == 0: # header
190
+ continue
191
+ fields = line.strip().split(',')
192
+ if len(fields) < 2:
193
+ break
194
+ evt_type = fields[0]
195
+ if evt_type in ontology_dict.keys():
196
+ args = fields[2:]
197
+ ontology_dict[evt_type]['template'].append(fields[1])
198
+ for i, arg in enumerate(args):
199
+ if arg != '':
200
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
201
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
202
+ else:
203
+ ontology_dict[evt_type] = {}
204
+ args = fields[2:]
205
+ ontology_dict[evt_type]['template'] = []
206
+ ontology_dict[evt_type]['template'].append(fields[1])
207
+ for i, arg in enumerate(args):
208
+ if arg != '':
209
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
210
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
211
+
212
+ return ontology_dict
213
+
214
+ def prepare_data(self, sentences, evt_type, trigger):
215
+ input_template, context = self.create_gold_gen(sentences, evt_type, trigger)
216
+ length = len(input_template)
217
+ # print(input_template)
218
+ # print(output_template)
219
+ # print(context)
220
+ results = []
221
+ for i in range(length):
222
+ input_tokens = self.tokenizer.encode_plus(input_template[i], context[i],
223
+ add_special_tokens=True,
224
+ add_prefix_space=True,
225
+ max_length=MAX_LENGTH,
226
+ truncation='only_second',
227
+ padding='max_length')
228
+ # input_ids 单词在词典中的编码
229
+ results.append(input_tokens['input_ids'])
230
+ temp = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]
231
+ return results, temp
232
+
233
+ class Runner():
234
+ def __init__(self, load_ckpt = 'checkpoints/gen-RAMS-what-new-span/epoch=2-v0.ckpt'):
235
+ model = 'gen'
236
+ self.ckpt_name = 'gen-RAMS-pred'
237
+ self.load_ckpt = load_ckpt
238
+ self.dataset = 'RAMS'
239
+ self.eval_only = True
240
+ self.train_file = 'data/RAMS_1.0/data/train.jsonlines'
241
+ self.val_file = 'data/RAMS_1.0/data/dev.jsonlines'
242
+ self.test_file = 'data/RAMS_1.0/data/test.jsonlines'
243
+ self.train_batch_size = 2
244
+ self.eval_batch_size = 4
245
+ self.learning_rate = 3e-5
246
+ self.accumulate_grad_batches = 4
247
+ self.num_train_epochs = 3
248
+
249
+ parser = argparse.ArgumentParser()
250
+
251
+ # Required parameters
252
+ parser.add_argument(
253
+ "--model",
254
+ type=str,
255
+ default=model
256
+ )
257
+ parser.add_argument(
258
+ "--dataset",
259
+ type=str,
260
+ default=self.dataset
261
+ )
262
+ parser.add_argument('--tmp_dir', type=str)
263
+ parser.add_argument(
264
+ "--ckpt_name",
265
+ default=self.ckpt_name,
266
+ type=str,
267
+ help="The output directory where the model checkpoints and predictions will be written.",
268
+ )
269
+ parser.add_argument(
270
+ "--load_ckpt",
271
+ default=self.load_ckpt,
272
+ type=str,
273
+ )
274
+ parser.add_argument(
275
+ "--train_file",
276
+ default=self.train_file,
277
+ type=str,
278
+ help="The input training file. If a data dir is specified, will look for the file there"
279
+ + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
280
+ )
281
+ parser.add_argument(
282
+ "--val_file",
283
+ default=self.val_file,
284
+ type=str,
285
+ help="The input evaluation file. If a data dir is specified, will look for the file there"
286
+ + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
287
+ )
288
+ parser.add_argument(
289
+ '--test_file',
290
+ type=str,
291
+ default=self.test_file,
292
+ )
293
+ parser.add_argument('--input_dir', type=str, default=None)
294
+ parser.add_argument('--coref_dir', type=str, default='data/kairos/coref_outputs')
295
+ parser.add_argument('--use_info', action='store_true', default=False,
296
+ help='use informative mentions instead of the nearest mention.')
297
+ parser.add_argument('--mark_trigger', action='store_true')
298
+ parser.add_argument('--sample-gen', action='store_true', help='Do sampling when generation.')
299
+ parser.add_argument("--train_batch_size", default=self.train_batch_size, type=int,
300
+ help="Batch size per GPU/CPU for training.")
301
+ parser.add_argument(
302
+ "--eval_batch_size", default=self.eval_batch_size, type=int, help="Batch size per GPU/CPU for evaluation."
303
+ )
304
+ parser.add_argument("--learning_rate", default=self.learning_rate, type=float,
305
+ help="The initial learning rate for Adam.")
306
+ parser.add_argument(
307
+ "--accumulate_grad_batches",
308
+ type=int,
309
+ default=self.accumulate_grad_batches,
310
+ help="Number of updates steps to accumulate before performing a backward/update pass.",
311
+ )
312
+ parser.add_argument("--weight_decay", default=0.0, type=float, help="Weight decay if we apply some.")
313
+ parser.add_argument("--adam_epsilon", default=1e-8, type=float, help="Epsilon for Adam optimizer.")
314
+ parser.add_argument("--gradient_clip_val", default=1.0, type=float, help="Max gradient norm.")
315
+ parser.add_argument(
316
+ "--num_train_epochs", default=self.num_train_epochs, type=int,
317
+ help="Total number of training epochs to perform."
318
+ )
319
+ parser.add_argument(
320
+ "--max_steps",
321
+ default=-1,
322
+ type=int,
323
+ help="If > 0: set total number of training steps to perform. Override num_train_epochs.",
324
+ )
325
+ parser.add_argument("--warmup_steps", default=0, type=int, help="Linear warmup over warmup_steps.")
326
+
327
+ parser.add_argument("--gpus", default=None, help='-1 means train on all gpus')
328
+ parser.add_argument("--seed", type=int, default=42, help="random seed for initialization")
329
+ parser.add_argument(
330
+ "--fp16",
331
+ action="store_true",
332
+ help="Whether to use 16-bit (mixed) precision (through NVIDIA apex) instead of 32-bit",
333
+ )
334
+ parser.add_argument("--threads", type=int, default=1,
335
+ help="multiple threads for converting example to features")
336
+ self.args = parser.parse_args()
337
+
338
+ self.model = GenIEModel(self.args)
339
+ self.model.load_state_dict(torch.load(self.args.load_ckpt, map_location=self.model.device)['state_dict'])
340
+
341
+ def pred(self,input):
342
+ x = torch.stack([torch.LongTensor(u) for u in input])
343
+ return self.model.pred(x)
344
+
345
+ print('Loading data...')
346
+ dm1 = DataModule4('aida_ontology_cleaned.csv')
347
+ dm2 = DataModuleW('aida_ontology_fj-w-2.csv')
348
+ dm3 = DataModuleW('aida_ontology_fj-w-3.csv')
349
+ dm4 = DataModule4('aida_ontology_fj-5.csv')
350
+
351
+ print('Loading Model 1...')
352
+ runner1 = Runner('checkpoints/gen-RAMS-1-span/epoch=2-v1.ckpt')
353
+ print('Loading Model 2...')
354
+ runner2 = Runner('checkpoints/gen-RAMS-2-span/epoch=2-v0.ckpt')
355
+ print('Loading Model 3...')
356
+ runner3 = Runner('checkpoints/gen-RAMS-3-span/epoch=2-v0.ckpt')
357
+ print('Loading Model 4...')
358
+ runner4 = Runner('checkpoints/gen-RAMS-4-span/epoch=2-v0.ckpt')
359
+
360
+ def handle(sentences,trigger, temp=3, evt_type='contact.prevarication.broadcast'):
361
+ x, argnames = eval('dm{}.prepare_data(sentences,evt_type,trigger)'.format(temp+1))
362
+ ys = eval('runner{}.pred(x)'.format(temp+1))
363
+ print(ys)
364
+ results = []
365
+ for y in ys:
366
+ while ' ' in y:
367
+ y = y.replace(' ', ' ')
368
+ result = y.strip(' ').split(' ')
369
+ results.append(result)
370
+ print(results)
371
+ argss = []
372
+ temp = 'trigger: ' + trigger
373
+ argss.append(temp)
374
+ # print(argnames)
375
+ for n,template in enumerate(argnames['template']):
376
+ template = template.split(' ')
377
+ # print(template)
378
+ args = []
379
+ for i, w in enumerate(template):
380
+ if '<arg' in w:
381
+ m = re.match(r'evt\d+arg\d+(\w+)', argnames[re.match(r'<(\w+)>', w).group(1)])
382
+ if m:
383
+ label = m.group(1)
384
+ if results[n][i] == '<arg>':
385
+ args.append(label+': None')
386
+ else:
387
+ args.append(label+': '+results[n][i])
388
+ argss.append(', '.join(args))
389
+ #print(argss)
390
+ if len(argnames['template']) == 1:
391
+ temp = argss[1].split(',')
392
+ rs = []
393
+ rs.append(argss[0])
394
+ for i in temp:
395
+ rs.append(i)
396
+ argss = rs
397
+ return '\n'.join(argss)
398
+
399
+ if __name__ == "__main__":
400
+ # trigger = 'deceive'
401
+ # sentences = """We are ashamed of them . " However , Mutko stopped short of admitting the doping scandal was state sponsored . " We are very sorry that athletes who tried to deceive us , and the world , were not caught sooner . We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values , " he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio"""
402
+ # print(handle(sentences, trigger))
403
+
404
+ dm_key = list(dm1.ontology_dict.keys())
405
+ print(len(dm_key))
406
+ def get_tmp(index,evt_type):
407
+ if index is None or evt_type is None:
408
+ return ''
409
+ input_template = eval("dm{}.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']".format(index+1))
410
+ return '\n'.join(input_template)
411
+
412
+ with gr.Blocks() as demo:
413
+ with gr.Row().style(equal_height=False):
414
+ with gr.Column(variant="panel"):
415
+ stens = gr.Text(label='文档')
416
+ evt_type = gr.Dropdown(choices=dm_key, label='事件类型')
417
+ trigger = gr.Text(label='触发词')
418
+ temp = gr.Dropdown(choices=['基础模板', '简单子模板', '融入语义信息的子模板', '融入论元信息的子模板'],
419
+ type='index', value='基础模板', label='模板')
420
+
421
+ output_tmp = gr.Text(label='模板内容')
422
+ btn = gr.Button("Run")
423
+ input_examples = gr.Examples(examples=[["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "基础模板","contact.prevarication.broadcast"],["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "简单子模板", "contact.prevarication.broadcast"],["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "融入语义信息的子模板", "contact.prevarication.broadcast"],["We are ashamed of them.\" However , Mutko stopped short of admitting the doping scandal was state sponsored . \"We are very sorry that athletes who tried to deceive us, and the world, were not caught sooner.We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values, \" he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio","deceive", "融入论元信息的子模板", "contact.prevarication.broadcast"]],inputs=[stens, trigger, temp, evt_type])
424
+
425
+ #btn = gr.Button("Run")
426
+ with gr.Column(variant="panel"):
427
+ result = gr.Text(label='输出论元生成结果')
428
+ evt_type.change(get_tmp,inputs=[temp,evt_type],outputs=[output_tmp])
429
+ temp.change(get_tmp,inputs=[temp,evt_type],outputs=[output_tmp])
430
+ btn.click(fn=handle, inputs=[stens,trigger,temp,evt_type], outputs=[result])
431
+ demo.launch(server_name='0.0.0.0',server_port=6006,share=True)
span_1_preprocessed_data1/test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d39562f7f85a43c97f2bd0ef9c7470656d555377da15cf34e03404993c850f3d
3
+ size 3045986
span_1_preprocessed_data1/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d59722f2d8c512844a2995fdebd15b687581fde11b714ee49e4dc19922fd9f8f
3
+ size 25648444
span_1_preprocessed_data1/val.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38da46ab63668fb37a8592573e0562e48245c6d81335c78d40dc957ea161ec79
3
+ size 3226018
span_2_preprocessed_data1/test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ece6b9edc106e02298fb1105d7f3972f46b23b307503c3470b2d24e156bb930
3
+ size 12522576
span_2_preprocessed_data1/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8efdc975af0cccee3658c564154129919e12d546ef0638439e10959930ed48a8
3
+ size 105370045
span_2_preprocessed_data1/val.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62b955d1868f0e7cafa614129d48599f707cc332b648da7cd8942d875e0d1e33
3
+ size 13318850
span_3_preprocessed_data1/test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2be2da47452d07bc53cb6be56f3d0ad770e213b42bab143b95d990047b2f8ead
3
+ size 12603278
span_3_preprocessed_data1/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82b7ab52100a6c3573f94ec4271469d30d047d5389a42ef97a957b0d1a4c8b32
3
+ size 106039983
span_3_preprocessed_data1/val.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a9a4da7025f405380ee4451d44215838c3207b761d1aefbf3f022c34c7e8049
3
+ size 13403704
span_4_preprocessed_data1/test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b6ba5486138269e29be526d6a42a5eab956851f2b06bc638dcbe6342c8278fd
3
+ size 12599344
span_4_preprocessed_data1/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94d2580d63a3bcc3860b2ba831f37cddbec554245911efeb74c0a5a2283181c6
3
+ size 106010729
span_4_preprocessed_data1/val.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7645dbb2d4ea9a8b87312017c0b0c2b29c04b6a25ae49c44b76a47d495cd238
3
+ size 13401304
src/genie/convert_gen_to_output5.py CHANGED
@@ -86,9 +86,9 @@ def check_coref(ex, arg_span, gold_spans):
86
  if __name__ == '__main__':
87
  parser = argparse.ArgumentParser()
88
  parser.add_argument('--gen-file',type=str, default='checkpoints/gen-new-tokenization-pred/sample_predictions.jsonl')
89
- parser.add_argument('--test-file', type=str,default='data/RAMS_1.0/data/test_head.jsonlines')
90
  parser.add_argument('--output-file',type=str, default='test_output.jsonl')
91
- parser.add_argument('--ontology-file',type=str, default='aida_ontology_new.csv')
92
  parser.add_argument('--head-only',action='store_true',default=False)
93
  parser.add_argument('--coref', action='store_true', default=False)
94
  args = parser.parse_args()
@@ -98,7 +98,7 @@ if __name__ == '__main__':
98
  nlp.tokenizer = WhitespaceTokenizer(nlp.vocab)
99
  # read ontology 读取事件本体 模板文件中的内容
100
  ontology_dict = {}
101
- with open('aida_ontology_fj-w-2.csv', 'r') as f:
102
  for lidx, line in enumerate(f):
103
  if lidx == 0: # header
104
  continue
 
86
  if __name__ == '__main__':
87
  parser = argparse.ArgumentParser()
88
  parser.add_argument('--gen-file',type=str, default='checkpoints/gen-new-tokenization-pred/sample_predictions.jsonl')
89
+ parser.add_argument('--test-file', type=str,default='data/RAMS_1.0/data/test.jsonlines')
90
  parser.add_argument('--output-file',type=str, default='test_output.jsonl')
91
+ parser.add_argument('--ontology-file',type=str, default='aida_ontology_fj-5.csv')
92
  parser.add_argument('--head-only',action='store_true',default=False)
93
  parser.add_argument('--coref', action='store_true', default=False)
94
  args = parser.parse_args()
 
98
  nlp.tokenizer = WhitespaceTokenizer(nlp.vocab)
99
  # read ontology 读取事件本体 模板文件中的内容
100
  ontology_dict = {}
101
+ with open('aida_ontology_fj-5.csv', 'r') as f:
102
  for lidx, line in enumerate(f):
103
  if lidx == 0: # header
104
  continue
src/genie/data_module4.py CHANGED
@@ -147,8 +147,8 @@ class RAMSDataModule(pl.LightningDataModule):
147
 
148
 
149
  def prepare_data(self):
150
- if not os.path.exists('span_templates_preprocessed_data1'):
151
- os.makedirs('span_templates_preprocessed_data1')
152
 
153
  ontology_dict = self.load_ontology()
154
 
@@ -156,7 +156,7 @@ class RAMSDataModule(pl.LightningDataModule):
156
 
157
  for split, f in [('train', self.hparams.train_file), ('val', self.hparams.val_file),
158
  ('test', self.hparams.test_file)]:
159
- with open(f, 'r') as reader, open('span_templates_preprocessed_data1/{}.jsonl'.format(split), 'w') as writer:
160
  for lidx, line in enumerate(reader):
161
  ex = json.loads(line.strip())
162
  input_template, output_template, context = self.create_gold_gen(ex, ontology_dict,
@@ -194,7 +194,7 @@ class RAMSDataModule(pl.LightningDataModule):
194
  writer.write(json.dumps(processed_ex) + "\n")
195
 
196
  def train_dataloader(self):
197
- dataset = IEDataset('span_templates_preprocessed_data1/train.jsonl')
198
 
199
  dataloader = DataLoader(dataset,
200
  pin_memory=True, num_workers=2,
@@ -204,7 +204,7 @@ class RAMSDataModule(pl.LightningDataModule):
204
  return dataloader
205
 
206
  def val_dataloader(self):
207
- dataset = IEDataset('span_templates_preprocessed_data1/val.jsonl')
208
 
209
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
210
  collate_fn=my_collate,
@@ -212,7 +212,7 @@ class RAMSDataModule(pl.LightningDataModule):
212
  return dataloader
213
 
214
  def test_dataloader(self):
215
- dataset = IEDataset('span_templates_preprocessed_data1/test.jsonl')
216
 
217
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
218
  collate_fn=my_collate,
@@ -231,7 +231,6 @@ if __name__ == '__main__':
231
  parser.add_argument('--mark-trigger', action='store_true', default=True)
232
  args = parser.parse_args()
233
 
234
- print("data_module1.pyaaaaaaaaaaaaaaa")
235
  dm = RAMSDataModule(args=args)
236
  dm.prepare_data()
237
 
 
147
 
148
 
149
  def prepare_data(self):
150
+ if not os.path.exists('span_4_preprocessed_data1'):
151
+ os.makedirs('span_4_preprocessed_data1')
152
 
153
  ontology_dict = self.load_ontology()
154
 
 
156
 
157
  for split, f in [('train', self.hparams.train_file), ('val', self.hparams.val_file),
158
  ('test', self.hparams.test_file)]:
159
+ with open(f, 'r') as reader, open('span_4_preprocessed_data1/{}.jsonl'.format(split), 'w') as writer:
160
  for lidx, line in enumerate(reader):
161
  ex = json.loads(line.strip())
162
  input_template, output_template, context = self.create_gold_gen(ex, ontology_dict,
 
194
  writer.write(json.dumps(processed_ex) + "\n")
195
 
196
  def train_dataloader(self):
197
+ dataset = IEDataset('span_4_preprocessed_data1/train.jsonl')
198
 
199
  dataloader = DataLoader(dataset,
200
  pin_memory=True, num_workers=2,
 
204
  return dataloader
205
 
206
  def val_dataloader(self):
207
+ dataset = IEDataset('span_4_preprocessed_data1/val.jsonl')
208
 
209
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
210
  collate_fn=my_collate,
 
212
  return dataloader
213
 
214
  def test_dataloader(self):
215
+ dataset = IEDataset('span_4_preprocessed_data1/test.jsonl')
216
 
217
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
218
  collate_fn=my_collate,
 
231
  parser.add_argument('--mark-trigger', action='store_true', default=True)
232
  args = parser.parse_args()
233
 
 
234
  dm = RAMSDataModule(args=args)
235
  dm.prepare_data()
236
 
src/genie/data_module_w.py CHANGED
@@ -128,7 +128,7 @@ class RAMSDataModule(pl.LightningDataModule):
128
 
129
  def load_ontology(self):
130
  ontology_dict = {}
131
- with open('aida_ontology_fj-w-2.csv', 'r') as f:
132
  for lidx, line in enumerate(f):
133
  if lidx == 0: # header
134
  continue
@@ -157,8 +157,8 @@ class RAMSDataModule(pl.LightningDataModule):
157
 
158
 
159
  def prepare_data(self):
160
- if not os.path.exists('head_what_preprocessed_data'):
161
- os.makedirs('head_what_preprocessed_data')
162
 
163
  ontology_dict = self.load_ontology()
164
 
@@ -166,7 +166,7 @@ class RAMSDataModule(pl.LightningDataModule):
166
 
167
  for split, f in [('train', self.hparams.train_file), ('val', self.hparams.val_file),
168
  ('test', self.hparams.test_file)]:
169
- with open(f, 'r') as reader, open('head_what_preprocessed_data/{}.jsonl'.format(split), 'w') as writer:
170
  for lidx, line in enumerate(reader):
171
  ex = json.loads(line.strip())
172
  input_template, output_template, context = self.create_gold_gen(ex, ontology_dict,
@@ -204,7 +204,7 @@ class RAMSDataModule(pl.LightningDataModule):
204
  writer.write(json.dumps(processed_ex) + "\n")
205
 
206
  def train_dataloader(self):
207
- dataset = IEDataset('head_what_preprocessed_data/train.jsonl')
208
 
209
  dataloader = DataLoader(dataset,
210
  pin_memory=True, num_workers=2,
@@ -214,7 +214,7 @@ class RAMSDataModule(pl.LightningDataModule):
214
  return dataloader
215
 
216
  def val_dataloader(self):
217
- dataset = IEDataset('head_what_preprocessed_data/val.jsonl')
218
 
219
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
220
  collate_fn=my_collate,
@@ -222,7 +222,7 @@ class RAMSDataModule(pl.LightningDataModule):
222
  return dataloader
223
 
224
  def test_dataloader(self):
225
- dataset = IEDataset('head_what_preprocessed_data/test.jsonl')
226
 
227
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
228
  collate_fn=my_collate,
@@ -235,7 +235,7 @@ if __name__ == '__main__':
235
  parser = argparse.ArgumentParser()
236
  parser.add_argument('--train-file', type=str, default='data/RAMS_1.0/data/train.jsonlines')
237
  parser.add_argument('--val-file', type=str, default='data/RAMS_1.0/data/dev.jsonlines')
238
- parser.add_argument('--test-file', type=str, default='data/RAMS_1.0/data/test_head.jsonlines')
239
  parser.add_argument('--train_batch_size', type=int, default=2)
240
  parser.add_argument('--eval_batch_size', type=int, default=4)
241
  parser.add_argument('--mark-trigger', action='store_true', default=True)
 
128
 
129
  def load_ontology(self):
130
  ontology_dict = {}
131
+ with open('aida_ontology_fj-w-3.csv', 'r') as f:
132
  for lidx, line in enumerate(f):
133
  if lidx == 0: # header
134
  continue
 
157
 
158
 
159
  def prepare_data(self):
160
+ if not os.path.exists('span_3_preprocessed_data1'):
161
+ os.makedirs('span_3_preprocessed_data1')
162
 
163
  ontology_dict = self.load_ontology()
164
 
 
166
 
167
  for split, f in [('train', self.hparams.train_file), ('val', self.hparams.val_file),
168
  ('test', self.hparams.test_file)]:
169
+ with open(f, 'r') as reader, open('span_3_preprocessed_data1/{}.jsonl'.format(split), 'w') as writer:
170
  for lidx, line in enumerate(reader):
171
  ex = json.loads(line.strip())
172
  input_template, output_template, context = self.create_gold_gen(ex, ontology_dict,
 
204
  writer.write(json.dumps(processed_ex) + "\n")
205
 
206
  def train_dataloader(self):
207
+ dataset = IEDataset('span_3_preprocessed_data1/train.jsonl')
208
 
209
  dataloader = DataLoader(dataset,
210
  pin_memory=True, num_workers=2,
 
214
  return dataloader
215
 
216
  def val_dataloader(self):
217
+ dataset = IEDataset('span_3_preprocessed_data1/val.jsonl')
218
 
219
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
220
  collate_fn=my_collate,
 
222
  return dataloader
223
 
224
  def test_dataloader(self):
225
+ dataset = IEDataset('span_3_preprocessed_data1/test.jsonl')
226
 
227
  dataloader = DataLoader(dataset, pin_memory=True, num_workers=2,
228
  collate_fn=my_collate,
 
235
  parser = argparse.ArgumentParser()
236
  parser.add_argument('--train-file', type=str, default='data/RAMS_1.0/data/train.jsonlines')
237
  parser.add_argument('--val-file', type=str, default='data/RAMS_1.0/data/dev.jsonlines')
238
+ parser.add_argument('--test-file', type=str, default='data/RAMS_1.0/data/test.jsonlines')
239
  parser.add_argument('--train_batch_size', type=int, default=2)
240
  parser.add_argument('--eval_batch_size', type=int, default=4)
241
  parser.add_argument('--mark-trigger', action='store_true', default=True)
src/genie/model.py CHANGED
@@ -1,5 +1,6 @@
1
  import os
2
- import argparse
 
3
  import torch
4
  import logging
5
  import json
@@ -116,7 +117,7 @@ class GenIEModel(pl.LightningModule):
116
  doc_key = batch['doc_key'] # list
117
  tgt_token_ids = batch['tgt_token_ids']
118
 
119
- return (doc_key, sample_output, tgt_token_ids)
120
 
121
  def test_epoch_end(self, outputs):
122
  # evaluate F1
@@ -131,7 +132,21 @@ class GenIEModel(pl.LightningModule):
131
  }
132
  writer.write(json.dumps(pred)+'\n')
133
 
134
- return {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
 
137
  def configure_optimizers(self):
 
1
  import os
2
+ import argparse
3
+ from sys import prefix
4
  import torch
5
  import logging
6
  import json
 
117
  doc_key = batch['doc_key'] # list
118
  tgt_token_ids = batch['tgt_token_ids']
119
 
120
+ return (doc_key, sample_output, tgt_token_ids)
121
 
122
  def test_epoch_end(self, outputs):
123
  # evaluate F1
 
132
  }
133
  writer.write(json.dumps(pred)+'\n')
134
 
135
+ return {}
136
+
137
+ def pred(self, batch):
138
+ if self.hparams.sample_gen:
139
+ sample_output = self.model.generate(batch, do_sample=True,
140
+ top_k=20, top_p=0.95, max_length=30, num_return_sequences=1,
141
+ num_beams=1,
142
+ )
143
+ else:
144
+ sample_output = self.model.generate(batch, do_sample=False,
145
+ max_length=30, num_return_sequences=1, num_beams=1,
146
+ )
147
+
148
+ sample_output = sample_output.reshape(batch.size(0), 1, -1)
149
+ return [self.tokenizer.decode(sample.squeeze(0), skip_special_tokens=True) for sample in sample_output]
150
 
151
 
152
  def configure_optimizers(self):
src/runner.py ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import difflib
2
+ import os
3
+ import json
4
+ from tqdm import tqdm
5
+ from glob import glob
6
+ #
7
+ # if not os.path.exists('./evttgr2type.json'):
8
+ # for file_name in glob('data/RAMS_1.0/data/test.jsonlines'):
9
+ # dic = {}
10
+ # with open(file_name,'r',encoding='utf-8') as f:
11
+ # lines = f.readlines()
12
+ # for line in tqdm(lines):
13
+ # linej = json.loads(line.strip())
14
+ # evt_triggers = linej['evt_triggers']
15
+ # # print(evt_triggers)
16
+ # sentences = linej['sentences']
17
+ # # print(sentences)
18
+ # sentences_uni = []
19
+ # for s in sentences:
20
+ # sentences_uni += s
21
+ # print(' '.join(sentences_uni))
22
+ # triggers = ' '.join(sentences_uni[evt_triggers[0][0]:evt_triggers[0][1]+1])
23
+ # evt_type = evt_triggers[0][2][0][0]
24
+ # if triggers in dic:
25
+ # if dic[triggers] != evt_type:
26
+ # print('一个触发词有不同的事件类型: {} {} {}'.format(triggers,evt_type,dic[triggers]))
27
+ # dic[triggers] = evt_type
28
+ # print(evt_type, triggers)
29
+ # exit()
30
+
31
+ import argparse
32
+ import jsonlines
33
+ import torch
34
+
35
+ from src.genie.data import my_collate
36
+ from src.genie.data_module_w import RAMSDataModule
37
+ from src.genie.model import GenIEModel
38
+
39
+ import gradio as gr
40
+
41
+ import re
42
+ from transformers import BartTokenizer
43
+
44
+ MAX_LENGTH = 424
45
+ MAX_TGT_LENGTH = 72
46
+ DOC_STRIDE = 256
47
+
48
+ class DataModule4():
49
+ def __init__(self, ontology_file):
50
+ super().__init__()
51
+ self.ontology_file = ontology_file
52
+ self.tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
53
+ self.tokenizer.add_tokens([' <arg>', ' <tgr>'])
54
+ self.ontology_dict = self.load_ontology()
55
+
56
+ def create_gold_gen(self, context_words, evt_type, trigger):
57
+ # 设置三个总列表、存放输入模板、输出模板
58
+ INPUT = []
59
+ CONTEXT = []
60
+ input_template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
61
+ i = len(input_template)
62
+ input_list = []
63
+ for x in range(i):
64
+ str = re.sub(r'<arg\d>', '<arg>', input_template[x])
65
+ input_list.append(str)
66
+ # 其中input_list种存放的是 原始数据中<arg1> 全部替换为 <arg> 之后的模板 下一步应该进行分词
67
+ temp = []
68
+ for x in range(i):
69
+ space_tokenized_template = input_list[x].split(' ')
70
+ temp.append(space_tokenized_template)
71
+ # 其中temp中存放的都是分词后的模板 下一步对temp中的所有元素进行tokenize
72
+ tokenized_input_template = []
73
+ for x in range(len(temp)):
74
+ for w in temp[x]:
75
+ tokenized_input_template.extend(self.tokenizer.tokenize(w, add_prefix_space=True))
76
+ INPUT.append(tokenized_input_template)
77
+ tokenized_input_template = []
78
+ context_words = context_words.split(' ')
79
+ trigger_words = trigger.split(' ')
80
+ trigger_span_start = context_words.index(trigger_words[0])
81
+ trigger_span_end = context_words.index(trigger_words[-1])
82
+ # 触发词之前的单词
83
+ prefix = self.tokenizer.tokenize(' '.join(context_words[:trigger_span_start]), add_prefix_space=True)
84
+ # 触发词短语
85
+ tgt = self.tokenizer.tokenize(trigger, add_prefix_space=True)
86
+ # 触发词之后的单词
87
+ suffix = self.tokenizer.tokenize(' '.join(context_words[trigger_span_end+1:]), add_prefix_space=True)
88
+ context = prefix + [' <tgr>', ] + tgt + [' <tgr>', ] + suffix
89
+ # context = self.tokenizer.tokenize(' '.join(context_words), add_prefix_space=True)
90
+
91
+ # 将context放入CONTEXT中
92
+ for w in range(i):
93
+ CONTEXT.append(context)
94
+ return INPUT, CONTEXT
95
+
96
+ def load_ontology(self):
97
+ ontology_dict = {}
98
+ with open(self.ontology_file, 'r') as f:
99
+ for lidx, line in enumerate(f):
100
+ if lidx == 0: # header
101
+ continue
102
+ fields = line.strip().split(',')
103
+ if len(fields) < 2:
104
+ break
105
+ evt_type = fields[0]
106
+ if evt_type in ontology_dict.keys():
107
+ args = fields[2:]
108
+ ontology_dict[evt_type]['template'].append(fields[1])
109
+ for i, arg in enumerate(args):
110
+ if arg != '':
111
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
112
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
113
+ else:
114
+ ontology_dict[evt_type] = {}
115
+ args = fields[2:]
116
+ ontology_dict[evt_type]['template'] = []
117
+ ontology_dict[evt_type]['template'].append(fields[1])
118
+ for i, arg in enumerate(args):
119
+ if arg != '':
120
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
121
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
122
+
123
+ return ontology_dict
124
+
125
+ def prepare_data(self, sentences, evt_type, trigger):
126
+ input_template, context = self.create_gold_gen(sentences, evt_type, trigger)
127
+ length = len(input_template)
128
+ # print(input_template)
129
+ # print(context)
130
+ results = []
131
+ for i in range(length):
132
+ input_tokens = self.tokenizer.encode_plus(input_template[i], context[i],
133
+ add_special_tokens=True,
134
+ add_prefix_space=True,
135
+ max_length=MAX_LENGTH,
136
+ truncation='only_second',
137
+ padding='max_length')
138
+ # input_ids 单词在词典中的编码
139
+ results.append(input_tokens['input_ids'])
140
+ temp = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]
141
+ return results, temp
142
+
143
+ class DataModuleW():
144
+ def __init__(self, ontology_file):
145
+ super().__init__()
146
+ self.ontology_file = ontology_file
147
+ self.tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
148
+ self.tokenizer.add_tokens([' <arg>', ' <tgr>'])
149
+ self.ontology_dict = self.load_ontology()
150
+
151
+ def create_gold_gen(self, context_words, evt_type, trigger):
152
+ # 设置三个总列表、存放输入模板、输出模板
153
+ INPUT = []
154
+ CONTEXT = []
155
+ input_template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
156
+ i = len(input_template)
157
+ input_list = []
158
+ for x in range(i):
159
+ str = re.sub('<trg>', trigger, input_template[x])
160
+ str = re.sub('<trg>', trigger, str)
161
+ input_list.append(str)
162
+ # 其中input_list种存放的是 原始数据中<arg1> 全部替换为 <arg> 之后的模板 下一步应该进行分词
163
+ temp = []
164
+ for x in range(i):
165
+ space_tokenized_template = input_list[x].split(' ')
166
+ temp.append(space_tokenized_template)
167
+ # 其中temp中存放的都是分词后的模板 下一步对temp中的所有元素进行tokenize
168
+ tokenized_input_template = []
169
+ for x in range(len(temp)):
170
+ for w in temp[x]:
171
+ tokenized_input_template.extend(self.tokenizer.tokenize(w, add_prefix_space=True))
172
+ INPUT.append(tokenized_input_template)
173
+ tokenized_input_template = []
174
+ template = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']
175
+ for y in range(len(template)):
176
+ template[y] = re.sub('<trg>', trigger, template[y])
177
+
178
+ context = self.tokenizer.tokenize(context_words, add_prefix_space=True)
179
+ # 将context放入CONTEXT中
180
+ for w in range(i):
181
+ CONTEXT.append(context)
182
+
183
+ return INPUT, CONTEXT
184
+
185
+ def load_ontology(self):
186
+ ontology_dict = {}
187
+ with open(self.ontology_file, 'r') as f:
188
+ for lidx, line in tqdm(enumerate(f)):
189
+ if lidx == 0: # header
190
+ continue
191
+ fields = line.strip().split(',')
192
+ if len(fields) < 2:
193
+ break
194
+ evt_type = fields[0]
195
+ if evt_type in ontology_dict.keys():
196
+ args = fields[2:]
197
+ ontology_dict[evt_type]['template'].append(fields[1])
198
+ for i, arg in enumerate(args):
199
+ if arg != '':
200
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
201
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
202
+ else:
203
+ ontology_dict[evt_type] = {}
204
+ args = fields[2:]
205
+ ontology_dict[evt_type]['template'] = []
206
+ ontology_dict[evt_type]['template'].append(fields[1])
207
+ for i, arg in enumerate(args):
208
+ if arg != '':
209
+ ontology_dict[evt_type]['arg{}'.format(i + 1)] = arg
210
+ ontology_dict[evt_type][arg] = 'arg{}'.format(i + 1)
211
+
212
+ return ontology_dict
213
+
214
+ def prepare_data(self, sentences, evt_type, trigger):
215
+ input_template, context = self.create_gold_gen(sentences, evt_type, trigger)
216
+ length = len(input_template)
217
+ # print(input_template)
218
+ # print(output_template)
219
+ # print(context)
220
+ results = []
221
+ for i in range(length):
222
+ input_tokens = self.tokenizer.encode_plus(input_template[i], context[i],
223
+ add_special_tokens=True,
224
+ add_prefix_space=True,
225
+ max_length=MAX_LENGTH,
226
+ truncation='only_second',
227
+ padding='max_length')
228
+ # input_ids 单词在词典中的编码
229
+ results.append(input_tokens['input_ids'])
230
+ temp = self.ontology_dict[evt_type.replace('n/a', 'unspecified')]
231
+ return results, temp
232
+
233
+ class Runner():
234
+ def __init__(self, load_ckpt = 'checkpoints/gen-RAMS-what-new-span/epoch=2-v0.ckpt'):
235
+ model = 'gen'
236
+ self.ckpt_name = 'gen-RAMS-pred'
237
+ self.load_ckpt = load_ckpt
238
+ self.dataset = 'RAMS'
239
+ self.eval_only = True
240
+ self.train_file = 'data/RAMS_1.0/data/train.jsonlines'
241
+ self.val_file = 'data/RAMS_1.0/data/dev.jsonlines'
242
+ self.test_file = 'data/RAMS_1.0/data/test.jsonlines'
243
+ self.train_batch_size = 2
244
+ self.eval_batch_size = 4
245
+ self.learning_rate = 3e-5
246
+ self.accumulate_grad_batches = 4
247
+ self.num_train_epochs = 3
248
+
249
+ parser = argparse.ArgumentParser()
250
+
251
+ # Required parameters
252
+ parser.add_argument(
253
+ "--model",
254
+ type=str,
255
+ default=model
256
+ )
257
+ parser.add_argument(
258
+ "--dataset",
259
+ type=str,
260
+ default=self.dataset
261
+ )
262
+ parser.add_argument('--tmp_dir', type=str)
263
+ parser.add_argument(
264
+ "--ckpt_name",
265
+ default=self.ckpt_name,
266
+ type=str,
267
+ help="The output directory where the model checkpoints and predictions will be written.",
268
+ )
269
+ parser.add_argument(
270
+ "--load_ckpt",
271
+ default=self.load_ckpt,
272
+ type=str,
273
+ )
274
+ parser.add_argument(
275
+ "--train_file",
276
+ default=self.train_file,
277
+ type=str,
278
+ help="The input training file. If a data dir is specified, will look for the file there"
279
+ + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
280
+ )
281
+ parser.add_argument(
282
+ "--val_file",
283
+ default=self.val_file,
284
+ type=str,
285
+ help="The input evaluation file. If a data dir is specified, will look for the file there"
286
+ + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
287
+ )
288
+ parser.add_argument(
289
+ '--test_file',
290
+ type=str,
291
+ default=self.test_file,
292
+ )
293
+ parser.add_argument('--input_dir', type=str, default=None)
294
+ parser.add_argument('--coref_dir', type=str, default='data/kairos/coref_outputs')
295
+ parser.add_argument('--use_info', action='store_true', default=False,
296
+ help='use informative mentions instead of the nearest mention.')
297
+ parser.add_argument('--mark_trigger', action='store_true')
298
+ parser.add_argument('--sample-gen', action='store_true', help='Do sampling when generation.')
299
+ parser.add_argument("--train_batch_size", default=self.train_batch_size, type=int,
300
+ help="Batch size per GPU/CPU for training.")
301
+ parser.add_argument(
302
+ "--eval_batch_size", default=self.eval_batch_size, type=int, help="Batch size per GPU/CPU for evaluation."
303
+ )
304
+ parser.add_argument("--learning_rate", default=self.learning_rate, type=float,
305
+ help="The initial learning rate for Adam.")
306
+ parser.add_argument(
307
+ "--accumulate_grad_batches",
308
+ type=int,
309
+ default=self.accumulate_grad_batches,
310
+ help="Number of updates steps to accumulate before performing a backward/update pass.",
311
+ )
312
+ parser.add_argument("--weight_decay", default=0.0, type=float, help="Weight decay if we apply some.")
313
+ parser.add_argument("--adam_epsilon", default=1e-8, type=float, help="Epsilon for Adam optimizer.")
314
+ parser.add_argument("--gradient_clip_val", default=1.0, type=float, help="Max gradient norm.")
315
+ parser.add_argument(
316
+ "--num_train_epochs", default=self.num_train_epochs, type=int,
317
+ help="Total number of training epochs to perform."
318
+ )
319
+ parser.add_argument(
320
+ "--max_steps",
321
+ default=-1,
322
+ type=int,
323
+ help="If > 0: set total number of training steps to perform. Override num_train_epochs.",
324
+ )
325
+ parser.add_argument("--warmup_steps", default=0, type=int, help="Linear warmup over warmup_steps.")
326
+
327
+ parser.add_argument("--gpus", default=None, help='-1 means train on all gpus')
328
+ parser.add_argument("--seed", type=int, default=42, help="random seed for initialization")
329
+ parser.add_argument(
330
+ "--fp16",
331
+ action="store_true",
332
+ help="Whether to use 16-bit (mixed) precision (through NVIDIA apex) instead of 32-bit",
333
+ )
334
+ parser.add_argument("--threads", type=int, default=1,
335
+ help="multiple threads for converting example to features")
336
+ self.args = parser.parse_args()
337
+
338
+ self.model = GenIEModel(self.args)
339
+ self.model.load_state_dict(torch.load(self.args.load_ckpt, map_location=self.model.device)['state_dict'])
340
+
341
+ def pred(self,input):
342
+ x = torch.stack([torch.LongTensor(u) for u in input])
343
+ return self.model.pred(x)
344
+
345
+ print('Loading data...')
346
+ dm1 = DataModule4('aida_ontology_cleaned.csv')
347
+ dm2 = DataModuleW('aida_ontology_fj-w-2.csv')
348
+ dm3 = DataModuleW('aida_ontology_fj-w-3.csv')
349
+ dm4 = DataModule4('aida_ontology_fj-5.csv')
350
+
351
+ print('Loading Model 1...')
352
+ runner1 = Runner('checkpoints/gen-RAMS-1-span/epoch=2-v1.ckpt')
353
+ print('Loading Model 2...')
354
+ runner2 = Runner('checkpoints/gen-RAMS-2-span/epoch=2-v0.ckpt')
355
+ print('Loading Model 3...')
356
+ runner3 = Runner('checkpoints/gen-RAMS-3-span/epoch=2-v0.ckpt')
357
+ print('Loading Model 4...')
358
+ runner4 = Runner('checkpoints/gen-RAMS-4-span/epoch=2-v0.ckpt')
359
+
360
+ def handle(sentences,trigger, temp=3, evt_type='contact.prevarication.broadcast'):
361
+ x, argnames = eval('dm{}.prepare_data(sentences,evt_type,trigger)'.format(temp+1))
362
+ ys = eval('runner{}.pred(x)'.format(temp+1))
363
+ print(ys)
364
+ results = []
365
+ for y in ys:
366
+ while ' ' in y:
367
+ y = y.replace(' ', ' ')
368
+ result = y.strip(' ').split(' ')
369
+ results.append(result)
370
+ print(results)
371
+ argss = []
372
+ for n,template in enumerate(argnames['template']):
373
+ template = template.split(' ')
374
+ # print(template)
375
+ args = []
376
+ for i, w in enumerate(template):
377
+ if '<arg' in w:
378
+ m = re.match(r'evt\d+arg\d+(\w+)', argnames[re.match(r'<(\w+)>', w).group(1)])
379
+ if m:
380
+ label = m.group(1)
381
+ if results[n][i] == '<arg>':
382
+ args.append(label+': None')
383
+ else:
384
+ args.append(label+': '+results[n][i])
385
+ argss.append(', '.join(args))
386
+ return '\n'.join(argss)
387
+
388
+ if __name__ == "__main__":
389
+ # trigger = 'deceive'
390
+ # sentences = """We are ashamed of them . " However , Mutko stopped short of admitting the doping scandal was state sponsored . " We are very sorry that athletes who tried to deceive us , and the world , were not caught sooner . We are very sorry because Russia is committed to upholding the highest standards in sport and is opposed to anything that threatens the Olympic values , " he said . English former heptathlete and Athens 2004 bronze medallist Kelly Sotherton was unhappy with Mutko 's plea for Russia 's ban to be lifted for Rio"""
391
+ # print(handle(sentences, trigger))
392
+
393
+ dm_key = list(dm1.ontology_dict.keys())
394
+ print(len(dm_key))
395
+ def get_tmp(index,evt_type):
396
+ if index is None or evt_type is None:
397
+ return ''
398
+ input_template = eval("dm{}.ontology_dict[evt_type.replace('n/a', 'unspecified')]['template']".format(index+1))
399
+ return '\n'.join(input_template)
400
+
401
+ with gr.Blocks() as demo:
402
+ with gr.Row().style(equal_height=False):
403
+ with gr.Column(variant="panel"):
404
+ stens = gr.Text(label='文档')
405
+ evt_type = gr.Dropdown(choices=dm_key, label='事件类型')
406
+ trigger = gr.Text(label='触发词')
407
+ temp = gr.Dropdown(choices=['基础模板', '简单子模板', '融入语义信息的子模板', '融入论元信息的子模板'],
408
+ type='index', value='基础模板', label='模板')
409
+ output_tmp = gr.Text(label='模板内容')
410
+ btn = gr.Button("Run")
411
+ with gr.Column(variant="panel"):
412
+ result = gr.Text(label='输出')
413
+ evt_type.change(get_tmp,inputs=[temp,evt_type],outputs=[output_tmp])
414
+ temp.change(get_tmp,inputs=[temp,evt_type],outputs=[output_tmp])
415
+ btn.click(fn=handle, inputs=[stens,trigger,temp,evt_type], outputs=[result])
416
+ demo.launch(server_name='0.0.0.0',server_port=6006,share=True)
test_rams.sh CHANGED
@@ -5,12 +5,12 @@ CKPT_NAME=gen-RAMS
5
  MODEL=gen
6
 
7
  python train.py --model=$MODEL --ckpt_name=$CKPT_NAME-pred \
8
- --load_ckpt=checkpoints/$CKPT_NAME-what-head/epoch=2-v0.ckpt \
9
  --dataset=RAMS \
10
  --eval_only \
11
  --train_file=data/RAMS_1.0/data/train.jsonlines \
12
  --val_file=data/RAMS_1.0/data/dev.jsonlines \
13
- --test_file=data/RAMS_1.0/data/test_head.jsonlines \
14
  --train_batch_size=2 \
15
  --eval_batch_size=4 \
16
  --learning_rate=3e-5 \
@@ -19,18 +19,18 @@ python train.py --model=$MODEL --ckpt_name=$CKPT_NAME-pred \
19
 
20
 
21
  #span eval
22
- #python src/genie/convert_gen_to_output5.py --gen-file=checkpoints/$CKPT_NAME-pred/predictions.jsonl \
23
- #--output-file=checkpoints/$CKPT_NAME-pred/span_output.jsonl
24
 
25
- #python data/RAMS_1.0/scorer/scorer.py -g=data/RAMS_1.0/data/test.jsonlines -p=checkpoints/$CKPT_NAME-pred/span_output.jsonl \
26
- #--reuse_gold_format --do_all > checkpoints/$CKPT_NAME-pred/span_metrics.txt
27
 
28
  # head eval
29
- python src/genie/convert_gen_to_output5.py --gen-file=checkpoints/$CKPT_NAME-pred/predictions.jsonl \
30
- --output-file=checkpoints/$CKPT_NAME-pred/output.jsonl --head-only
31
 
32
- python data/RAMS_1.0/scorer/scorer.py -g=data/RAMS_1.0/data/test_head.jsonlines -p=checkpoints/$CKPT_NAME-pred/output.jsonl \
33
- --reuse_gold_format --do_all > checkpoints/$CKPT_NAME-pred/head_metrics.txt
34
 
35
  # head + coref eval
36
  #python genie/convert_gen_to_output.py --gen-file=checkpoints/$CKPT_NAME-pred/predictions.jsonl \
 
5
  MODEL=gen
6
 
7
  python train.py --model=$MODEL --ckpt_name=$CKPT_NAME-pred \
8
+ --load_ckpt=checkpoints/$CKPT_NAME-4-span/epoch=2-v0.ckpt \
9
  --dataset=RAMS \
10
  --eval_only \
11
  --train_file=data/RAMS_1.0/data/train.jsonlines \
12
  --val_file=data/RAMS_1.0/data/dev.jsonlines \
13
+ --test_file=data/RAMS_1.0/data/test.jsonlines \
14
  --train_batch_size=2 \
15
  --eval_batch_size=4 \
16
  --learning_rate=3e-5 \
 
19
 
20
 
21
  #span eval
22
+ python src/genie/convert_gen_to_output5.py --gen-file=checkpoints/$CKPT_NAME-pred/predictions.jsonl \
23
+ --output-file=checkpoints/$CKPT_NAME-pred/span_output.jsonl
24
 
25
+ python data/RAMS_1.0/scorer/scorer.py -g=data/RAMS_1.0/data/test.jsonlines -p=checkpoints/$CKPT_NAME-pred/span_output.jsonl \
26
+ --reuse_gold_format --do_all > checkpoints/$CKPT_NAME-pred/span_metrics.txt
27
 
28
  # head eval
29
+ # python src/genie/convert_gen_to_output5.py --gen-file=checkpoints/$CKPT_NAME-pred/predictions.jsonl \
30
+ # --output-file=checkpoints/$CKPT_NAME-pred/output.jsonl --head-only
31
 
32
+ # python data/RAMS_1.0/scorer/scorer.py -g=data/RAMS_1.0/data/test_head.jsonlines -p=checkpoints/$CKPT_NAME-pred/output.jsonl \
33
+ # --reuse_gold_format --do_all > checkpoints/$CKPT_NAME-pred/head_metrics.txt
34
 
35
  # head + coref eval
36
  #python genie/convert_gen_to_output.py --gen-file=checkpoints/$CKPT_NAME-pred/predictions.jsonl \
train.py CHANGED
@@ -14,7 +14,7 @@ from pytorch_lightning.utilities.seed import seed_everything
14
 
15
 
16
 
17
- from src.genie.data_module_w import RAMSDataModule
18
  from src.genie.ACE_data_module import ACEDataModule
19
  from src.genie.KAIROS_data_module import KAIROSDataModule
20
  from src.genie.model import GenIEModel
 
14
 
15
 
16
 
17
+ from src.genie.data_module4 import RAMSDataModule
18
  from src.genie.ACE_data_module import ACEDataModule
19
  from src.genie.KAIROS_data_module import KAIROSDataModule
20
  from src.genie.model import GenIEModel
train_rams.sh CHANGED
@@ -2,11 +2,11 @@
2
  set -e
3
  set -x
4
 
5
- python train.py --model=gen --ckpt_name='gen-RAMS-what-head' \
6
  --dataset=RAMS \
7
  --train_file=data/RAMS_1.0/data/train.jsonlines \
8
  --val_file=data/RAMS_1.0/data/dev.jsonlines \
9
- --test_file=data/RAMS_1.0/data/test_head.jsonlines \
10
  --train_batch_size=2 \
11
  --eval_batch_size=4 \
12
  --learning_rate=3e-5 \
 
2
  set -e
3
  set -x
4
 
5
+ python train.py --model=gen --ckpt_name='gen-RAMS-4-span' \
6
  --dataset=RAMS \
7
  --train_file=data/RAMS_1.0/data/train.jsonlines \
8
  --val_file=data/RAMS_1.0/data/dev.jsonlines \
9
+ --test_file=data/RAMS_1.0/data/test.jsonlines \
10
  --train_batch_size=2 \
11
  --eval_batch_size=4 \
12
  --learning_rate=3e-5 \