跳转到主要内容

用于读取ARPA n-gram模型的库。

项目描述

Python ARPA包

Python库,用于读取ARPA n-gram模型。

设置

Python 3.4+

PyPI Python Versions PyPI Version

为了安装Python 3版本

$ pip install --user -U arpa

Python 2.7

PyPI Python Versions PyPI Version

为了安装Python 2.7版本

$ pip install --user -U arpa-backport

用法

可以直接导入此包

import arpa  # Python 3.4+
# OR
import arpa_backport as arpa  # Python 2.7

models = arpa.loadf("foo.arpa")
lm = models[0]  # ARPA files may contain several models.

# probability p(end|in, the)
lm.p("in the end")
lm.log_p("in the end")

# sentence score w/ sentence markers
lm.s("This is the end .")
lm.log_s("This is the end .")

# sentence score w/o sentence markers
lm.s("This is the end .", sos=False, eos=False)
lm.log_s("This is the end .", sos=False, eos=False)

开发

Travis Documentation Status Coverage Status

欢迎贡献!
编写错误报告或发送拉取请求。
其他 贡献者 之前已经这样做。

许可证

版权(c)2015-2018 斯坦芬·菲舍尔
源代码在 MIT许可证 下可用。
有关更多信息,请参阅 LICENSE

历史记录

本项目所有显著更改都将记录在此文件中。
本项目遵循 语义版本控制
您也应该 维护变更日志

下一个版本

新增

变更

已弃用

修复

删除

安全

0.1.0b4 - 2018-12-12

0.1.0b3 - 2018-12-06

0.1.0b2 - 2018-04-28

0.1.0b1 - 2015-09-13

0.1.0a6 - 2015-07-24

0.1.0a5 - 2015-07-19

0.1.0a4 - 2015-07-14

0.1.0a3 - 2015-07-10

0.1.0a2 - 2015-07-05

0.1.0a1 - 2015-07-05

首次发布在PyPI上。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分发

arpa-0.1.0b4.tar.gz (26.9 kB 查看哈希值)

上传时间

构建分发

arpa-0.1.0b4-py3-none-any.whl (9.6 kB 查看哈希值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面