From 5d5888af8ec0e327f7cad41ddf5887d0eaf678dc Mon Sep 17 00:00:00 2001 From: TianYuan Date: Wed, 31 Aug 2022 20:23:17 +0800 Subject: [PATCH] fix tone, update readme (#2335) --- examples/other/g2p/README.md | 4 ++-- paddlespeech/t2s/frontend/tone_sandhi.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/other/g2p/README.md b/examples/other/g2p/README.md index 882943504..85c9535d1 100644 --- a/examples/other/g2p/README.md +++ b/examples/other/g2p/README.md @@ -12,13 +12,13 @@ Run the command below to get the results of the test. ./run.sh ``` -The `avg WER` of g2p is: 0.024169315564825305 +The `avg WER` of g2p is: 0.024075726733983775 ```text ,--------------------------------------------------------------------. | ./exp/g2p/text.g2p | |--------------------------------------------------------------------| | SPKR | # Snt # Wrd | Corr Sub Del Ins Err S.Err | - | Sum/Avg| 9996 299181 | 97.6 2.4 0.0 0.0 2.4 49.2 | + | Sum/Avg| 9996 299181 | 97.6 2.4 0.0 0.0 2.4 49.0 | `--------------------------------------------------------------------' ``` diff --git a/paddlespeech/t2s/frontend/tone_sandhi.py b/paddlespeech/t2s/frontend/tone_sandhi.py index ee3aa84ad..9fff4272c 100644 --- a/paddlespeech/t2s/frontend/tone_sandhi.py +++ b/paddlespeech/t2s/frontend/tone_sandhi.py @@ -84,9 +84,7 @@ class ToneSandhi(): if j - 1 >= 0 and item == word[j - 1] and pos[0] in {"n", "v", "a"}: finals[j] = finals[j][:-1] + "5" ge_idx = word.find("个") - if (len(word) > 1 and word[-1] in "吧呢啊呐噻嘛吖嗨呐哦哒滴哩哟喽啰耶喔诶") or ( - len(word) > 1 and word[-2] in '好是帅酷棒衰烂臭狗糗' and - word[-1] == '额') or (len(word) == 1 and word[-1] in "额嗯"): + if len(word) >= 1 and word[-1] in "吧呢啊呐噻嘛吖嗨呐哦哒滴哩哟喽啰耶喔诶": finals[-1] = finals[-1][:-1] + "5" elif len(word) >= 1 and word[-1] in "的地得": finals[-1] = finals[-1][:-1] + "5"