Update disrpt.py
Browse files
disrpt.py
CHANGED
@@ -94,13 +94,13 @@ def parse_conll_stream(file_stream):
|
|
94 |
for line in file_stream:
|
95 |
line = line.strip()
|
96 |
if line.startswith("#"):
|
97 |
-
|
98 |
if not line:
|
99 |
if sentence['id']:
|
100 |
yield sentence
|
101 |
sentence = {name: [] for name in names}
|
102 |
continue
|
103 |
-
token_data = line.split('\t')
|
104 |
for name, value in zip(names, token_data):
|
105 |
if name=='id' and '-' in value:
|
106 |
mwe_id=value.split('-')
|
|
|
94 |
for line in file_stream:
|
95 |
line = line.strip()
|
96 |
if line.startswith("#"):
|
97 |
+
doc_id=line.split('=')[-1].strip()
|
98 |
if not line:
|
99 |
if sentence['id']:
|
100 |
yield sentence
|
101 |
sentence = {name: [] for name in names}
|
102 |
continue
|
103 |
+
token_data = line.split('\t') + [doc_id]
|
104 |
for name, value in zip(names, token_data):
|
105 |
if name=='id' and '-' in value:
|
106 |
mwe_id=value.split('-')
|