mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-04 14:44:18 +00:00
Update prepare_for_bpe_model.py
This commit is contained in:
parent
7e798c21c7
commit
d15605f660
@ -40,7 +40,7 @@ def get_args():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--text",
|
"--text",
|
||||||
type=str,
|
type=str,
|
||||||
help="WenetSpeech training transcript.",
|
help="Training transcript.",
|
||||||
)
|
)
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
@ -56,7 +56,7 @@ def main():
|
|||||||
transcript_path = lang_dir / "transcript_chars.txt"
|
transcript_path = lang_dir / "transcript_chars.txt"
|
||||||
|
|
||||||
with open(text, "r", encoding="utf-8") as fin:
|
with open(text, "r", encoding="utf-8") as fin:
|
||||||
with open(transcript_path, "w", encoding="utf-8") as fout:
|
with open(transcript_path, "w+", encoding="utf-8") as fout:
|
||||||
for line in tqdm(fin):
|
for line in tqdm(fin):
|
||||||
fout.write(tokenize_by_CJK_char(line) + "\n")
|
fout.write(tokenize_by_CJK_char(line) + "\n")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user