Skip to content

Commit 128a607

Browse files
committed
Parser: First pass of Processors parser
- Can now parse Processors `mention.json` files, but at the moment only the first dependency graph is read/drawn. - Bugfix: WordClusters would sometimes overlap other entities if they had really long labels. - Demo: HTTP port for demo server now configurable via the PORT environment variable - Cleaned up some dead code
1 parent 67bd759 commit 128a607

File tree

16 files changed

+2425
-2175
lines changed

16 files changed

+2425
-2175
lines changed

demo/data/test-processors.json

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
{
2+
"documents": {
3+
"-1180172198": {
4+
"sentences": [
5+
{
6+
"words": ["Gonzo", "married", "Camilla", "."],
7+
"startOffsets": [0, 6, 14, 21],
8+
"endOffsets": [5, 13, 21, 22],
9+
"tags": ["NNP", "VBD", "NNP", "."],
10+
"lemmas": ["Gonzo", "marry", "Camilla", "."],
11+
"entities": ["O", "O", "PERSON", "O"],
12+
"norms": ["O", "O", "O", "O"],
13+
"chunks": ["B-NP", "B-VP", "B-NP", "O"],
14+
"graphs": {
15+
"stanford-basic": {
16+
"edges": [
17+
{
18+
"source": 1,
19+
"destination": 0,
20+
"relation": "nsubj"
21+
},
22+
{
23+
"source": 1,
24+
"destination": 2,
25+
"relation": "dobj"
26+
},
27+
{
28+
"source": 1,
29+
"destination": 3,
30+
"relation": "punct"
31+
}
32+
],
33+
"roots": [1]
34+
},
35+
"stanford-collapsed": {
36+
"edges": [
37+
{
38+
"source": 1,
39+
"destination": 0,
40+
"relation": "nsubj"
41+
},
42+
{
43+
"source": 1,
44+
"destination": 2,
45+
"relation": "dobj"
46+
},
47+
{
48+
"source": 1,
49+
"destination": 3,
50+
"relation": "punct"
51+
}
52+
],
53+
"roots": [1]
54+
}
55+
}
56+
}
57+
]
58+
}
59+
},
60+
"mentions": [
61+
{
62+
"type": "TextBoundMention",
63+
"id": "T:648733472",
64+
"text": "Camilla",
65+
"labels": ["Person", "PossiblePerson", "Entity"],
66+
"tokenInterval": {
67+
"start": 2,
68+
"end": 3
69+
},
70+
"characterStartOffset": 14,
71+
"characterEndOffset": 21,
72+
"sentence": 0,
73+
"document": "-1180172198",
74+
"keep": true,
75+
"foundBy": "ner-person"
76+
},
77+
{
78+
"type": "EventMention",
79+
"id": "E:1351231268",
80+
"text": "Gonzo married Camilla",
81+
"labels": ["Marry"],
82+
"trigger": {
83+
"type": "TextBoundMention",
84+
"id": "T:1627076846",
85+
"text": "married",
86+
"labels": ["Marry"],
87+
"tokenInterval": {
88+
"start": 1,
89+
"end": 2
90+
},
91+
"characterStartOffset": 6,
92+
"characterEndOffset": 13,
93+
"sentence": 0,
94+
"document": "-1180172198",
95+
"keep": true,
96+
"foundBy": "marry-syntax-1"
97+
},
98+
"arguments": {
99+
"spouse": [
100+
{
101+
"type": "TextBoundMention",
102+
"id": "T:1618195043",
103+
"text": "Gonzo",
104+
"labels": ["Person", "PossiblePerson", "Entity"],
105+
"tokenInterval": {
106+
"start": 0,
107+
"end": 1
108+
},
109+
"characterStartOffset": 0,
110+
"characterEndOffset": 5,
111+
"sentence": 0,
112+
"document": "-1180172198",
113+
"keep": true,
114+
"foundBy": "ner-person"
115+
},
116+
{
117+
"type": "TextBoundMention",
118+
"id": "T:648733472",
119+
"text": "Camilla",
120+
"labels": ["Person", "PossiblePerson", "Entity"],
121+
"tokenInterval": {
122+
"start": 2,
123+
"end": 3
124+
},
125+
"characterStartOffset": 14,
126+
"characterEndOffset": 21,
127+
"sentence": 0,
128+
"document": "-1180172198",
129+
"keep": true,
130+
"foundBy": "ner-person"
131+
}
132+
]
133+
},
134+
"paths": {
135+
"spouse": {
136+
"T:1618195043": [
137+
{
138+
"source": 1,
139+
"destination": 0,
140+
"relation": "nsubj"
141+
}
142+
],
143+
"T:648733472": [
144+
{
145+
"source": 1,
146+
"destination": 2,
147+
"relation": "dobj"
148+
}
149+
]
150+
}
151+
},
152+
"tokenInterval": {
153+
"start": 0,
154+
"end": 3
155+
},
156+
"characterStartOffset": 0,
157+
"characterEndOffset": 21,
158+
"sentence": 0,
159+
"document": "-1180172198",
160+
"keep": true,
161+
"foundBy": "marry-syntax-1"
162+
},
163+
{
164+
"type": "TextBoundMention",
165+
"id": "T:1618195043",
166+
"text": "Gonzo",
167+
"labels": ["Person", "PossiblePerson", "Entity"],
168+
"tokenInterval": {
169+
"start": 0,
170+
"end": 1
171+
},
172+
"characterStartOffset": 0,
173+
"characterEndOffset": 5,
174+
"sentence": 0,
175+
"document": "-1180172198",
176+
"keep": true,
177+
"foundBy": "ner-person"
178+
}
179+
]
180+
}

0 commit comments

Comments
 (0)