File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
users/zeyer/datasets/utils Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,8 @@ def run(self):
115
115
print ("RETURNN vocab:" , vocab )
116
116
vocab = Vocabulary .create_vocab (** vocab )
117
117
else :
118
- vocab = None
118
+ assert dataset .labels [self .data_key ]
119
+ vocab = Vocabulary .create_vocab_from_labels (dataset .labels [self .data_key ])
119
120
120
121
# noinspection PyBroadException
121
122
try :
@@ -153,10 +154,7 @@ def run(self):
153
154
f" dataset tag { dataset .get_tag (seq_idx )!r} != seq list tag { seq_list [seq_idx ]!r} "
154
155
)
155
156
data = dataset .get_data (seq_idx , self .data_key )
156
- if vocab :
157
- s = vocab .get_seq_labels (data )
158
- else :
159
- s = dataset .serialize_data (self .data_key , data )
157
+ s = vocab .get_seq_labels (data )
160
158
for old , new in self .raw_replacement_list :
161
159
s = s .replace (old , new )
162
160
if self .raw_final_strip :
You can’t perform that action at this time.
0 commit comments