-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
添加新规则报错,_pywrapfst.FstOpError: Operation failed #159
Labels
good first issue
Good for newcomers
Comments
谢谢,已经修改为:
重新执行后似乎在输出时有问题,麻烦看看~
似乎代码已经正确识别并转换了,但在输出时出了bug |
保留空格,不要删除空格 |
非常感谢,已经解决,确认一下,报错原因是解析时verbalizer无法匹配前面tagger留的空格导致的是吗 |
不是,是因为tagger和verblizer之间还有一个tokenparser,他要靠空格来parse https://github.com/wenet-e2e/WeTextProcessing/blob/master/tn/token_parser.py#L120-L136 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你好,我尝试为ITN加入新的基本规则,运行后报错, 麻烦看看能否解决,谢谢!:
其中,添加了WeTextProcessing/itn/chinese/data/dataflow/flow.tsv如下:
另添加了WeTextProcessing/itn/chinese/rules/dataflow.py如下:
同时,修改了WeTextProcessing/itn/chinese/inverse_normalizer.py 的内容如下:
最后运行python -m itn --text "八兆流量" --overwrite_cache后报错如下,
(wenetITN) liuhangchen@G08:~/WeNetITN/WeTextProcessing$ python -m itn --text "八兆流量" --overwrite_cache
dataflow { value: "8" dataflow: "M" } char { value: "流" } char { value: "量" }
ERROR: StringFstToOutputLabels: Invalid start state
Traceback (most recent call last):
File "/storage1/liuhangchen/anaconda3/envs/wenetITN/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/storage1/liuhangchen/anaconda3/envs/wenetITN/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/storage1/liuhangchen/WeNetITN/WeTextProcessing/itn/main.py", line 4, in
main()
File "/storage1/liuhangchen/WeNetITN/WeTextProcessing/itn/main.py", line 53, in main
print(normalizer.normalize(args.text))
File "/storage1/liuhangchen/WeNetITN/WeTextProcessing/tn/processor.py", line 96, in normalize
return self.verbalize(self.tag(input))
File "/storage1/liuhangchen/WeNetITN/WeTextProcessing/tn/processor.py", line 93, in verbalize
return shortestpath(lattice, nshortest=1, unique=True).string()
File "extensions/_pynini.pyx", line 462, in _pynini.Fst.string
File "extensions/_pynini.pyx", line 507, in _pynini.Fst.string
_pywrapfst.FstOpError: Operation failed
The text was updated successfully, but these errors were encountered: