Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
Libraries:
Datasets
pandas
License:
sileod commited on
Commit
2ba3399
1 Parent(s): 46cf64b

Update disrpt.py

Browse files
Files changed (1) hide show
  1. disrpt.py +2 -2
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
- sentence['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')
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('-')