changed chunk generation
Browse files- ref_seg_ger.py +4 -4
ref_seg_ger.py
CHANGED
@@ -215,10 +215,10 @@ class RefSeg(datasets.GeneratorBasedBuilder):
|
|
215 |
for i, row in df.iterrows():
|
216 |
|
217 |
#tokenized_input = row['token'].split(' ')
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
tokenized_input, offsets = zip(*
|
222 |
tokenized_input = list(tokenized_input)
|
223 |
if len(tokenized_input) > 1:
|
224 |
if row['tag'] == 'B':
|
|
|
215 |
for i, row in df.iterrows():
|
216 |
|
217 |
#tokenized_input = row['token'].split(' ')
|
218 |
+
tkn = self.TOKENIZER.pre_tokenize_str(row['token'])
|
219 |
+
if not tkn:
|
220 |
+
continue
|
221 |
+
tokenized_input, offsets = zip(*tkn)
|
222 |
tokenized_input = list(tokenized_input)
|
223 |
if len(tokenized_input) > 1:
|
224 |
if row['tag'] == 'B':
|