MCPcopy Index your code
hub / github.com/jindongwang/transferlearning / token2text

Function token2text

code/ASR/Adapter/utils.py:194–203  ·  view source on GitHub ↗
(tokens, bpemodel=None)

Source from the content-addressed store, hash-verified

192 return wer, n_sub, n_ins, n_del, n_cor
193
194def token2text(tokens, bpemodel=None):
195 if bpemodel:
196 text = bpemodel.decode_pieces(tokens)
197 else:
198 text = (
199 " ".join(tokens)
200 .replace(" ", "")
201 .replace("<space>", " ")
202 ) # sclite does not consider the number of spaces when splitting
203 return text
204def recognize_and_evaluate(dataloader, model, args, model_path=None, wer=False, write_to_json=False):
205 if model_path:
206 torch_load(model_path, model)

Callers 1

recognize_and_evaluateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected