Fix underscore in conformer models
This commit is contained in:
@@ -203,12 +203,14 @@ def test_funasr(audio_file, lang):
|
|||||||
# paraformer模型会一个字一个字输出,中间夹太多空格会影响1-cer的结果
|
# paraformer模型会一个字一个字输出,中间夹太多空格会影响1-cer的结果
|
||||||
if lang == "zh":
|
if lang == "zh":
|
||||||
text = text.replace(" ", "")
|
text = text.replace(" ", "")
|
||||||
|
text = text.replace("_", " ")
|
||||||
elif model_type == "conformer":
|
elif model_type == "conformer":
|
||||||
res = model.generate(
|
res = model.generate(
|
||||||
input=segment_path,
|
input=segment_path,
|
||||||
batch_size_s=300
|
batch_size_s=300
|
||||||
)
|
)
|
||||||
text = res[0]["text"]
|
text = res[0]["text"]
|
||||||
|
text = text.replace("_", " ")
|
||||||
# elif model_type == "uni_asr":
|
# elif model_type == "uni_asr":
|
||||||
# if i == 0:
|
# if i == 0:
|
||||||
# os.remove(segment_path)
|
# os.remove(segment_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user