Spaces:
Runtime error
Runtime error
Delete preprocess.py
Browse files- preprocess.py +0 -25
preprocess.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
import argparse
|
2 |
-
import text
|
3 |
-
from utils import load_filepaths_and_text
|
4 |
-
|
5 |
-
if __name__ == '__main__':
|
6 |
-
parser = argparse.ArgumentParser()
|
7 |
-
parser.add_argument("--out_extension", default="cleaned")
|
8 |
-
parser.add_argument("--text_index", default=2, type=int)
|
9 |
-
parser.add_argument("--filelists", nargs="+", default=["E:/uma_voice/output_train.txt", "E:/uma_voice/output_val.txt"])
|
10 |
-
parser.add_argument("--text_cleaners", nargs="+", default=["japanese_cleaners"])
|
11 |
-
|
12 |
-
args = parser.parse_args()
|
13 |
-
|
14 |
-
|
15 |
-
for filelist in args.filelists:
|
16 |
-
print("START:", filelist)
|
17 |
-
filepaths_and_text = load_filepaths_and_text(filelist)
|
18 |
-
for i in range(len(filepaths_and_text)):
|
19 |
-
original_text = filepaths_and_text[i][args.text_index]
|
20 |
-
cleaned_text = text._clean_text(original_text, args.text_cleaners)
|
21 |
-
filepaths_and_text[i][args.text_index] = cleaned_text
|
22 |
-
|
23 |
-
new_filelist = filelist + "." + args.out_extension
|
24 |
-
with open(new_filelist, "w", encoding="utf-8") as f:
|
25 |
-
f.writelines(["|".join(x) + "\n" for x in filepaths_and_text])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|