yongjielv commited on
Commit
c87ba14
·
verified ·
1 Parent(s): 828d8d5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +95 -38
README.md CHANGED
@@ -24,13 +24,21 @@ The audio samples are sourced from well-known open-source datasets, including se
24
 
25
  ## Dataset statistics
26
  ### Semantic Editing
 
27
  | Task Types\ # samples \ Language | Zh deletion | Zh insertion | Zh substitution | En deletion | En insertion | En substitution |
28
  | -------------------------------- | ----------: | -----------: | --------------: | ----------: | -----------: | --------------: |
29
  | Index-based | 186 | 180 | 36 | 138 | 100 | 67 |
30
  | Content-based | 95 | 110 | 289 | 62 | 99 | 189 |
31
  | Total | 281 | 290 | 325 | 200 | 199 | 256 |
32
 
33
- *Index-based* instruction: specifies an operation on content at positions $i$ to $j$. (e.g. delete the characters or words from index 3 to 12)
 
 
 
 
 
 
 
34
 
35
  *Content-based*: targets specific characters or words for editing. (e.g. insert 'hello' before 'world')
36
  ### Acoustic Editing
@@ -42,6 +50,13 @@ The audio samples are sourced from well-known open-source datasets, including se
42
  | Emotion Conversion | 84 | 72 |
43
  | Volume Conversion | 50 | 50 |
44
  ## Evaluation Metrics
 
 
 
 
 
 
 
45
  ### Semantic Editing
46
  For the deletion, insertion, and substitution tasks, we evaluate the performance using four key metrics:
47
  + Word Error Rate (WER) of the Edited Region (wer)
@@ -49,44 +64,86 @@ For the deletion, insertion, and substitution tasks, we evaluate the performance
49
  + Edit Operation Accuracy (acc)
50
  + Speaker Similarity (sim)
51
 
52
- These metrics can be calculated by running the following command:
53
- ```bash
54
- # run pip install -r requirements.txt first
55
- bash eval_scripts/semantic/run_eval.sh /path/contains/edited/audios
56
- ```
57
- NOTE: the directory passed to the above script should have the structure as follows:
58
- ```
59
- .
60
- ├── del
61
- └── edit_del_basic
62
- ├── eval_result
63
- │ ├── hyp.txt
64
- │ ├── input_wavs
65
- │ ├── origin_wavs
66
- │ ├── ref.txt
67
- │ ├── test.jsonl
68
- │ ├── test_parse.jsonl # This is need to run the evaluation script
69
- │ ├── test.yaml
70
- │ └── tts/ # This is the directory contains the edited wavs
71
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
- Examples of test_parse.jsonl:
74
- ``` json
75
- {"uid": "00107947-00000092", "input_wav_path": "wavs/00107947-00000092.wav","output_wav_path": "edited_wavs/00107947-00000092.wav", "instruction": "Please recognize the language of this speech and transcribe it. And delete '随着经济的发'.\n", "asr_label": "随着经济的发展食物浪费也随之增长", "asr_text": "随着经济的发展食物浪费也随之增长", "edited_text_label": "展食物浪费也随之增长", "edited_text": "<edit></edit>展食物浪费也随之增长", "origin_speech_url": null,}
76
 
77
- {"uid": "00010823-00000019", "input_wav_path": "wavs/00010823-00000019.wav", "output_wav_path": "edited_wavs/00010823-00000019.wav", "instruction": "Please recognize the language of this speech and transcribe it. And delete the characters or words from index 4 to index 10.\n", "asr_label": "我们将为全球城市的可持续发展贡献力量", "asr_text": "我们将为全球城市的可持续发展贡献力量", "edited_text_label": "我们将持续发展贡献力量", "edited_text": "我们将<edit></edit>持续发展贡献力量", "origin_speech_url": null}
78
- ```
79
  ### Acoustic Editing
80
- For the acoustic editing tasks, we use WER and SPK-SIM as the primary evaluation metrics. These two metrics can be calculated by running the following commands:
81
- ```bash
82
- bash eval_scripts/acoustic/cal_wer_sim.sh /path/contains/edited/audios
83
- ```
84
 
85
- Additionally, for the dialect and emotion conversion tasks, we assess the conversion accuracy by leveraging a large language model (LLM) through API calls.
86
- ```bash
87
- # dialect conversion accuracy
88
- python eval_scripts/acoustic/pyscripts/dialect_api.py --output_dir <保存评测结果的根目录> --generated_audio_dir <存放已生成音频文件的目录路径>
89
- # emotion conversion accuracy
90
- # fisrt, run: bash eval_scripts/acoustic/cal_wer_sim.sh /path/contains/edited/audios
91
- python pyscripts/emo_acc.py
92
- ```
 
 
 
 
 
 
24
 
25
  ## Dataset statistics
26
  ### Semantic Editing
27
+ #### full version
28
  | Task Types\ # samples \ Language | Zh deletion | Zh insertion | Zh substitution | En deletion | En insertion | En substitution |
29
  | -------------------------------- | ----------: | -----------: | --------------: | ----------: | -----------: | --------------: |
30
  | Index-based | 186 | 180 | 36 | 138 | 100 | 67 |
31
  | Content-based | 95 | 110 | 289 | 62 | 99 | 189 |
32
  | Total | 281 | 290 | 325 | 200 | 199 | 256 |
33
 
34
+ #### basic version
35
+ | Task Types\ # samples \ Language | Zh deletion | Zh insertion | Zh substitution | En deletion | En insertion | En substitution |
36
+ | -------------------------------- | ----------: | -----------: | --------------: | ----------: | -----------: | --------------: |
37
+ | Index-based | 92 | 65 | 29 | 47 | 79 | 29 |
38
+ | Content-based | 78 | 105 | 130 | 133 | 81 | 150 |
39
+ | Total | 170 | 170 | 159 | 180 | 160 | 179 |
40
+
41
+ *Index-based* instruction: specifies an operation on content at positions *i* to *j*. (e.g. delete the characters or words from index 3 to 12)
42
 
43
  *Content-based*: targets specific characters or words for editing. (e.g. insert 'hello' before 'world')
44
  ### Acoustic Editing
 
50
  | Emotion Conversion | 84 | 72 |
51
  | Volume Conversion | 50 | 50 |
52
  ## Evaluation Metrics
53
+ ### Environment Preparation
54
+ ```bash
55
+ git clone https://github.com/inclusionAI/Ming-Freeform-Audio-Edit.git
56
+ cd Ming-Freeform-Audio-Edit
57
+ pip install -r requirements.txt
58
+ ```
59
+ **Note**: Please download the audio and meta files from [HuggingFace](https://huggingface.co/datasets/inclusionAI/Ming-Freeform-Audio-Edit-Benchmark/tree/main) or [ModelScope](https://modelscope.cn/datasets/inclusionAI/Ming-Freeform-Audio-Edit-Benchmark/files) and put the `wavs` and `meta` directories under `Ming-Freeform-Audio-Edit`
60
  ### Semantic Editing
61
  For the deletion, insertion, and substitution tasks, we evaluate the performance using four key metrics:
62
  + Word Error Rate (WER) of the Edited Region (wer)
 
64
  + Edit Operation Accuracy (acc)
65
  + Speaker Similarity (sim)
66
 
67
+ 1. If you have organized the directories contain edited waveforms like below:
68
+ ```
69
+ eval_path
70
+ |
71
+ ├── del
72
+ │ └── edit_del_basic
73
+ │ └── tts/ # This is the actual directory contains the edited wavs
74
+ ├── ins
75
+ │ └── edit_ins_basic
76
+ └── tts/ # This is the actual directory contains the edited wavs
77
+ ├── sub
78
+ └── edit_sub_basic
79
+ └── tts/ # This is the actual directory contains the edited wavs
80
+ ```
81
+ Then you can run the following command to get those metrics:
82
+ ```bash
83
+ cd Ming-Freeform-Audio-Edit/eval_scripts
84
+ bash run_eval_semantic.sh eval_path \
85
+ whisper_path \
86
+ paraformer_path \
87
+ wavlm_path \
88
+ eval_mode \
89
+ lang
90
+ ```
91
+ Here is a brief description of the parameters for the script above:
92
+ + `eval_path`: The top-level directory containing subdirectories for each editing task
93
+ + `whisper_path`:Path to the Whisper model, which is used to calculate WER for English audio. You can download it from [here](https://huggingface.co/openai/whisper-large-v3).
94
+ + `paraformer_path`:Path to the Paraformer model, which is used to calculate WER for Chinese audio. You can download it from [here](https://huggingface.co/funasr/paraformer-zh).
95
+ + `wavlm_path`: Path to the WavLM model, which is used to calculate speaker similarity. You can download it from [here](https://drive.google.com/file/d/1-aE1NfzpRCLxA4GUxX9ITI3F9LlbtEGP/view).
96
+ + `eval_mode`: Used to specify which version of the evaluation set to use. Choose between `basic` and `open`
97
+ + `lang`: supported language, choose between `zh` and `en`
98
+
99
+ 2. If your directory for the edited audio is not organized in the format described above, you can run the following commands.
100
+ ```bash
101
+ cd eval_scripts
102
+ # get wer, wer.noedit
103
+ bash cal_wer_edit.sh meta_file \
104
+ wav_dir \
105
+ lang \
106
+ num_jobs \
107
+ res_dir \
108
+ task_type \
109
+ eval_mode \
110
+ whisper_path \
111
+ paraformer_path \
112
+ edit_cat # use `semantic` here
113
+ # get sim
114
+ bash cal_sim_edit.sh meta_file \
115
+ wav_dir \
116
+ wavlm_path \
117
+ num_jobs \
118
+ res_dir \
119
+ lang
120
+ ```
121
+ Here is a brief description of the parameters for the script above:
122
+ + `meta_file`: The absolute path to the meta file for the corresponding task (e.g., `meta_en_deletion_basic.csv` or `meta_en_deletion.csv`).
123
+ + `wav_dir`: The directory containing the edited audio files (the WAV files should be located directly in this directory).
124
+ + `lang`: `zh` or `en`
125
+ + `num_jobs`: number of process.
126
+ + `res_dir`: The directory to save the metric results.
127
+ + `task_type`: `del`, `ins` or `sub`
128
+ + `eval_mode`: The same as the above.
129
+ + `whisper_path`: The same as the above
130
+ + `paraformer_path`: The same as the above
131
+ + `edit_cat`: `semantic` or `acoustic`
132
 
 
 
 
133
 
 
 
134
  ### Acoustic Editing
135
+ For the acoustic editing tasks, we use WER and SPK-SIM as the primary evaluation metrics.
 
 
 
136
 
137
+ 1. If the directory for the edited audio is structured, you can run the following command.
138
+ ```bash
139
+ cd Ming-Freeform-Audio-Edit/eval_scripts
140
+ bash run_eval_acoustic.sh eval_path \
141
+ whisper_path \
142
+ paraformer_path \
143
+ wavlm_path \
144
+ eval_mode \
145
+ lang
146
+ ```
147
+ 2. Otherwise, you can run commands similar to the one for the semantic tasks, with the `edit_cat` parameter set to `acoustic`.
148
+
149
+ Additionally, for the dialect and emotion conversion tasks, we assess the conversion accuracy by leveraging a large language model (LLM) through API calls, refer to `eval_scripts/run_eval_acoustic.sh` for more details.