Initial commit: FunASR Speech Recognition Toolkit
Update API Documentation / build-api-docs (push) Has been cancelled
Update API Documentation / build-api-docs (push) Has been cancelled
Add complete FunASR codebase including models, runtime, and documentation.
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Apache 2.0
|
||||
|
||||
import sys
|
||||
|
||||
with open(sys.argv[1], "r") as fread:
|
||||
print("0 0 <blank> <eps>")
|
||||
nodeX = 1
|
||||
for entry in fread.readlines():
|
||||
entry = entry.replace("\n", "").strip()
|
||||
fields = entry.split(" ")
|
||||
phone = fields[0]
|
||||
if phone == "<eps>" or phone == "<blank>":
|
||||
continue
|
||||
if "#" in phone:
|
||||
print(str(0) + " " + str(0) + " " + "<eps>" + " " + phone)
|
||||
else:
|
||||
print(str(0) + " " + str(nodeX) + " " + phone + " " + phone)
|
||||
print(str(nodeX) + " " + str(nodeX) + " " + phone + " <eps>")
|
||||
print(str(nodeX) + " " + str(0) + " " + "<eps> <eps>")
|
||||
nodeX += 1
|
||||
print("0")
|
||||
Reference in New Issue
Block a user