评估翻译错误率的简单库
pyter的Python项目详细描述
比重瓶
pyter是一个简单的翻译错误率评估命令。
目前正在开发中。
安装
pip install pyter
或者签出存储库:
git clone git://github.com/aflc/pyter.git cd pyter pip install -e .
用法
在python代码中(python2.x大小写)
导入
>>> import pyter
为了得到一个ter分数,假设句和参考句都必须有一个单词表。
>>> ref = u'SAUDI ARABIA denied THIS WEEK information published in the AMERICAN new york times'.split() >>> hyp = u'THIS WEEK THE SAUDIS denied information published in the new york times'.split() >>> '%.3f' % pyter.ter(hyp, ref) '0.308'
如果要使用基于字符的匹配,请编写这样的代码。
>>> ref = list(u"Pythonは、より素早く、効果的にシステムとの統合が可能なプログラミング言語です。") >>> hyp = list(u"Pythonは、より迅速に動作するとより効果的にシステムを統合できるプログラミング言語です。") >>> '%.3f' % pyter.ter(hyp, ref) '0.357'
命令行界面
请键入:
pyter --help
发布说明
- v0.2.2.1
- 错误修复版本
- v0.2.2
- 修正1,无效记分。
- v0.2.1
- 新的cli界面
- 重构整个代码
- 此版本与以前的版本不兼容。
- v0.2
- 用缓存版本替换普通的基于dp的编辑距离。性能有点提高。
- v0.1.1
- 小修复,并注册到pypi
- v0.1
- 初始版本
许可证
它是根据麻省理工学院的许可证发行的。
Copyright (c) 2011 Hiroyuki Tanaka
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.