Revised Rhythm Prediction Function, test=tts

pull/2548/head
WongLaw 3 years ago
parent 4fe6c0dc99
commit cb37edb8f5

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
# Punctuation Restoration with IWLST2012-Zh # Rhythm Prediction with CSMSC and AiShell3
## Get Started ## Get Started
### Data Preprocessing ### Data Preprocessing
@ -20,60 +20,6 @@
## Pretrained Model ## Pretrained Model
The pretrained model can be downloaded here: The pretrained model can be downloaded here:
[ernie_linear_p3_iwslt2012_zh_ckpt_0.1.1.zip](https://paddlespeech.bj.bcebos.com/text/ernie_linear_p3_iwslt2012_zh_ckpt_0.1.1.zip) [snapshot_iter_2600.pdz](https://paddlespeech.bj.bcebos.com/Rhy_Prediction/snapshot_iter_2600.pdz)
[ernie-3.0-base.tar.gz](https://paddlespeech.bj.bcebos.com/punc_restore/ernie-3.0-base.tar.gz) And you should put it into `exp/ YOUR EXP /checkpoints` folder.
[ernie-3.0-medium.tar.gz](https://paddlespeech.bj.bcebos.com/punc_restore/ernie-3.0-medium.tar.gz)
[ernie-3.0-micro.tar.gz](https://paddlespeech.bj.bcebos.com/punc_restore/ernie-3.0-micro.tar.gz)
[ernie-mini.tar.gz](https://paddlespeech.bj.bcebos.com/punc_restore/ernie-mini.tar.gz)
[ernie-nano.tar.gz](https://paddlespeech.bj.bcebos.com/punc_restore/ernie-nano.tar.gz)
[ernie-tiny.tar.gz](https://paddlespeech.bj.bcebos.com/punc_restore/ernie-tiny.tar.gz)
### Test Result
- Ernie 1.0
| |COMMA | PERIOD | QUESTION | OVERALL|
|:-----:|:-----:|:-----:|:-----:|:-----:|
|Precision |0.510955 |0.526462 |0.820755 |0.619391|
|Recall |0.517433 |0.564179 |0.861386 |0.647666|
|F1 |0.514173 |0.544669 |0.840580 |0.633141|
- Ernie-tiny
| |COMMA | PERIOD | QUESTION | OVERALL|
|:-----:|:-----:|:-----:|:-----:|:-----:|
|Precision |0.733177 |0.721448 |0.754717 |0.736447|
|Recall |0.380740 |0.524646 |0.733945 |0.546443|
|F1 |0.501204 |0.607506 |0.744186 |0.617632|
- Ernie-3.0-base-zh
| |COMMA | PERIOD | QUESTION | OVERALL|
|:-----:|:-----:|:-----:|:-----:|:-----:|
|Precision |0.805947 |0.764160 |0.858491 |0.809532|
|Recall |0.399070 |0.567978 |0.850467 |0.605838|
|F1 |0.533817 |0.651623 |0.854460 |0.679967|
- Ernie-3.0-medium-zh
| |COMMA | PERIOD | QUESTION | OVERALL|
|:-----:|:-----:|:-----:|:-----:|:-----:|
|Precision |0.730829 |0.699164 |0.707547 |0.712514|
|Recall |0.388196 |0.533286 |0.797872 |0.573118|
|F1 |0.507058 |0.605062 |0.750000 |0.620707|
- Ernie-3.0-mini-zh
| |COMMA | PERIOD | QUESTION | OVERALL|
|:-----:|:-----:|:-----:|:-----:|:-----:|
|Precision |0.757433 |0.708449 |0.707547 |0.724477|
|Recall |0.355752 |0.506977 |0.735294 |0.532674|
|F1 |0.484121 |0.591015 |0.721154 |0.598763|
- Ernie-3.0-micro-zh
| |COMMA | PERIOD | QUESTION | OVERALL|
|:-----:|:-----:|:-----:|:-----:|:-----:|
|Precision |0.733959 |0.679666 |0.726415 |0.713347|
|Recall |0.332742 |0.483487 |0.712963 |0.509731|
|F1 |0.457896 |0.565033 |0.719626 |0.580852|
- Ernie-3.0-nano-zh
| |COMMA | PERIOD | QUESTION | OVERALL|
|:-----:|:-----:|:-----:|:-----:|:-----:|
|Precision |0.693271 |0.682451 |0.754717 |0.710146|
|Recall |0.327784 |0.491968 |0.666667 |0.495473|
|F1 |0.445114 |0.571762 |0.707965 |0.574947|

File diff suppressed because it is too large Load Diff

@ -1,12 +1,20 @@
#!/bin/bash #!/bin/bash
if [ ! -f 000001-010000.txt ]; then
wget https://paddlespeech.bj.bcebos.com/Rhy_Prediction/000001-010000.txt
fi
if [ ! -f label_train-set.txt ]; then
wget https://paddlespeech.bj.bcebos.com/Rhy_Prediction/label_train-set.txt
fi
aishell_data=$1 aishell_data=$1
biaobei_data=$2 csmsc_data=$2
processed_path=$3 processed_path=$3
python3 ./local/pre_for_sp_biaobei.py \ python3 ./local/pre_for_sp_csmsc.py \
--data=${biaobei_data} \ --data=${csmsc_data} \
--processed_path=${processed_path} --processed_path=${processed_path}
python3 ./local/pre_for_sp_aishell.py \ python3 ./local/pre_for_sp_aishell.py \

@ -26,7 +26,7 @@ def pre_and_write(data, file):
def main(): def main():
parser = argparse.ArgumentParser(description="Train a FastSpeech2 model.") parser = argparse.ArgumentParser(description="Train a Rhy prediction model.")
parser.add_argument("--data", type=str, default="label_train-set.txt") parser.add_argument("--data", type=str, default="label_train-set.txt")
parser.add_argument( parser.add_argument(
"--processed_path", type=str, default="../data/rhy_predict") "--processed_path", type=str, default="../data/rhy_predict")

@ -24,7 +24,7 @@ def pre_and_write(data, file):
def main(): def main():
parser = argparse.ArgumentParser(description="Train a FastSpeech2 model.") parser = argparse.ArgumentParser(description="Train a Rhy prediction model.")
parser.add_argument("--data", type=str, default="label_train-set.txt") parser.add_argument("--data", type=str, default="label_train-set.txt")
parser.add_argument( parser.add_argument(
"--processed_path", type=str, default="../data/rhy_predict") "--processed_path", type=str, default="../data/rhy_predict")

@ -3,11 +3,11 @@ set -e
source path.sh source path.sh
gpus=1 gpus=1
stage=3 stage=0
stop_stage=3 stop_stage=0
aishell_data=label_train-set.txt aishell_data=label_train-set.txt
biaobei_data=000001-010000.txt csmsc_data=000001-010000.txt
processed_path=data/rhy_predict processed_path=data/rhy_predict
conf_path=conf/default.yaml conf_path=conf/default.yaml
@ -22,7 +22,7 @@ source ${MAIN_ROOT}/utils/parse_options.sh || exit 1
if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
# prepare data # prepare data
./local/data.sh ${aishell_data} ${biaobei_data} ${processed_path} ./local/data.sh ${aishell_data} ${csmsc_data} ${processed_path}
fi fi
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then

Loading…
Cancel
Save