pythainlp

pythainlp

Python实现的泰语自然语言处理库

PyThaiNLP是一个专注于泰语的Python自然语言处理库,提供丰富的功能如分词、词性标注、拼写检查等。支持Python 3.7+,可通过pip安装。这个开源项目被广泛应用于工业和研究领域,为泰语NLP任务提供支持。PyThaiNLP具有命令行接口,支持额外功能的可选安装。

PyThaiNLP自然语言处理泰语Python开源Github开源项目
<div align="center"> <img src="https://avatars0.githubusercontent.com/u/32934255?s=200&v=4"/> <h1>PyThaiNLP:Python中的泰语自然语言处理</h1> <a href="https://www.repostatus.org/#active"><img alt="项目状态:活跃 – 该项目已达到稳定、可用状态,并正在积极开发中。" src="https://yellow-cdn.veclightyear.com/0a4dffa0/54a85189-a389-4394-a60f-ba84e9a83645.svg"/></a> <a href="https://pypi.python.org/pypi/pythainlp"><img alt="pypi" src="https://yellow-cdn.veclightyear.com/0a4dffa0/acef9ed8-db81-4c84-a70a-032ad00b2743.svg"/></a> <a href="https://www.python.org/downloads/release/python-370/"><img alt="Python 3.8" src="https://yellow-cdn.veclightyear.com/0a4dffa0/7533723f-0e57-4843-9745-88bfe9bf6340.svg"/></a> <a href="https://opensource.org/licenses/Apache-2.0"><img alt="许可证" src="https://yellow-cdn.veclightyear.com/0a4dffa0/f91ba516-c409-408e-8903-1c56548c7681.svg"/></a> <a href="https://github.com/PyThaiNLP/pythainlp/actions/workflows/test.ymlp"><img alt="单元测试和代码覆盖率" src="https://yellow-cdn.veclightyear.com/0a4dffa0/296b779e-2cf8-46fc-bb57-db6affc5fa8f.svg"/></a> <a href="https://www.codacy.com/gh/PyThaiNLP/pythainlp/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=PyThaiNLP/pythainlp&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/5821a0de122041c79999bbb280230ffb"/></a> <a href="https://coveralls.io/github/PyThaiNLP/pythainlp?branch=dev"><img alt="覆盖率状态" src="https://yellow-cdn.veclightyear.com/0a4dffa0/e5d7e798-7a63-4835-8931-bc36b0acc2f3.svg?branch=dev"/></a> <a href="https://colab.research.google.com/github/PyThaiNLP/tutorials/blob/master/source/notebooks/pythainlp_get_started.ipynb"><img alt="Google Colab 徽章" src="https://badgen.net/badge/Launch%20Quick%20Start%20Guide/on%20Google%20Colab/blue?icon=terminal"/></a> <a href="https://zenodo.org/badge/latestdoi/61813823"><img alt="DOI" src="https://yellow-cdn.veclightyear.com/0a4dffa0/de73614d-5bfe-46a4-9615-18ce21147b49.svg"/></a> <a href="https://matrix.to/#/#thainlp:matrix.org" rel="noopener" target="_blank"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/16aa4270-903b-4177-aa00-8aa67e31a807.svg" alt="在Matrix上聊天"></a> </div>

PyThaiNLP是一个用于文本处理和语言分析的Python包,类似于NLTK,但专注于泰语。

PyThaiNLP是一个用于自然语言处理的Python库,类似于NLTK,但专注于泰语。详细信息请参阅泰语版README_TH.MD

新闻

现在,您可以联系或向PyThaiNLP团队提出任何问题。<a href="https://matrix.to/#/#thainlp:matrix.org" rel="noopener" target="_blank"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/16aa4270-903b-4177-aa00-8aa67e31a807.svg" alt="在Matrix上聊天"></a>

版本描述状态
5.0.4稳定版更新日志
dev5.1版本候选版更新日志

入门指南

功能

PyThaiNLP 为泰语提供标准的语言分析和标准的泰语区域设置实用功能。 这些功能中的一部分也可以通过命令行界面使用(在 shell 中运行 thainlp)。

部分功能列表:

  • 方便的字符和词类,如泰语辅音(pythainlp.thai_consonants)、元音(pythainlp.thai_vowels)、数字(pythainlp.thai_digits)和停用词(pythainlp.corpus.thai_stopwords)-- 类似于 string.lettersstring.digitsstring.punctuation 等常量
  • 不同级别的语言单位分割:句子(sent_tokenize)、词(word_tokenize)和亚词(subword_tokenize
  • 词性标注(pos_tag
  • 拼写建议和纠正(spellcorrect
  • 语音算法和音译(soundextransliterate
  • 排序(按字典顺序)(collate
  • 数字读音(num_to_thaiwordbahttext
  • 日期时间格式化(thai_strftime
  • 泰英键盘切换错误修复(eng_to_thaithai_to_eng

安装

pip install --upgrade pythainlp

这将安装 PyThaiNLP 的最新稳定版本。

安装不同版本:

  • 稳定版:pip install --upgrade pythainlp
  • 预发布版(即将就绪):pip install --upgrade --pre pythainlp
  • 开发版(可能会导致问题):pip install https://github.com/PyThaiNLP/pythainlp/archive/dev.zip

安装选项

某些功能,如泰语 WordNet,可能需要额外的包。要安装这些要求,请在 pythainlp 后面立即指定一组 [name]

pip install pythainlp[extra1,extra2,...]

可能的 extras

  • full(安装所有内容)
  • attacut(支持 attacut,一个快速准确的分词器)
  • benchmarks(用于词分割基准测试
  • icu(支持 ICU,国际组件 Unicode,用于音译和分词)
  • ipa(支持 IPA,国际音标字母,用于音译)
  • ml(支持用于分类的 ULMFiT 模型)
  • thai2fit(用于泰语词向量)
  • thai2rom(用于机器学习罗马化)
  • wordnet(用于泰语 WordNet API)

有关依赖项详细信息,请查看 setup.py 中的 extras 变量。

数据目录

  • 一些额外的数据,如词列表和语言模型,可能会在运行时自动下载。
  • PyThaiNLP 默认将这些数据缓存在 ~/pythainlp-data 目录下。
  • 可以通过指定环境变量 PYTHAINLP_DATA_DIR 来更改数据目录。
  • 查看数据目录(db.json):https://github.com/PyThaiNLP/pythainlp-corpus

命令行界面

可以通过命令行使用 thainlp 命令来使用 PyThaiNLP 的某些功能。

例如,显示数据集目录:

thainlp data catalog

显示使用方法:

thainlp help

许可证

许可证
PyThaiNLP 源代码和笔记本Apache 软件许可证 2.0
PyThaiNLP 创建的语料库、数据集和文档知识共享零 1.0 通用公共领域贡献许可证 (CC0)
PyThaiNLP 创建的语言模型知识共享署名 4.0 国际公共许可证 (CC-by)
PyThaiNLP 中可能包含的其他语料库和模型参见 语料库许可证

为 PyThaiNLP 做贡献

  • 请 fork 并创建 pull request :)
  • 有关样式指南和其他信息,包括我们使用的算法参考,请参阅我们的贡献页面。

谁在使用 PyThaiNLP?

您可以阅读INTHEWILD.md

引用

如果您在项目或出版物中使用了PyThaiNLP,请按以下方式引用该库:

Wannaphong Phatthiyaphaibun, Korakot Chaovavanich, Charin Polpanumas, Arthit Suriyawongkul, Lalita Lowphansirikul, & Pattarawat Chormai. (2016, Jun 27). PyThaiNLP: Thai Natural Language Processing in Python. Zenodo. http://doi.org/10.5281/zenodo.3519354

或使用BibTeX条目:

@misc{pythainlp, title = "{P}y{T}hai{NLP}: {T}hai Natural Language Processing in {P}ython", author = "Phatthiyaphaibun, Wannaphong and Chaovavanich, Korakot and Polpanumas, Charin and Suriyawongkul, Arthit and Lowphansirikul, Lalita and Chormai, Pattarawat", month = jun, year = "2016", doi = {10.5281/zenodo.3519354}, publisher = {Zenodo}, url = {http://doi.org/10.5281/zenodo.3519354} }

我们的NLP-OSS 2023论文:

Wannaphong Phatthiyaphaibun, Korakot Chaovavanich, Charin Polpanumas, Arthit Suriyawongkul, Lalita Lowphansirikul, Pattarawat Chormai, Peerat Limkonchotiwat, Thanathip Suntorntip, and Can Udomcharoenchaikit. 2023. PyThaiNLP: Thai Natural Language Processing in Python. In Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023), pages 25–36, Singapore, Singapore. Empirical Methods in Natural Language Processing.

及其BibTeX条目:

@inproceedings{phatthiyaphaibun-etal-2023-pythainlp, title = "{P}y{T}hai{NLP}: {T}hai Natural Language Processing in {P}ython", author = "Phatthiyaphaibun, Wannaphong and Chaovavanich, Korakot and Polpanumas, Charin and Suriyawongkul, Arthit and Lowphansirikul, Lalita and Chormai, Pattarawat and Limkonchotiwat, Peerat and Suntorntip, Thanathip and Udomcharoenchaikit, Can", editor = "Tan, Liling and Milajevs, Dmitrijs and Chauhan, Geeticka and Gwinnup, Jeremy and Rippeth, Elijah", booktitle = "Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023)", month = dec, year = "2023", address = "Singapore, Singapore", publisher = "Empirical Methods in Natural Language Processing", url = "https://aclanthology.org/2023.nlposs-1.4", pages = "25--36", abstract = "We present PyThaiNLP, a free and open-source natural language processing (NLP) library for Thai language implemented in Python. It provides a wide range of software, models, and datasets for Thai language. We first provide a brief historical context of tools for Thai language prior to the development of PyThaiNLP. We then outline the functionalities it provided as well as datasets and pre-trained language models. We later summarize its development milestones and discuss our experience during its development. We conclude by demonstrating how industrial and research communities utilize PyThaiNLP in their work. The library is freely available at https://github.com/pythainlp/pythainlp.", }

赞助商

标志描述
VISTEC-depa Thailand Artificial Intelligence Research Institute自2019年起,我们的贡献者Korakot Chaovavanich和Lalita Lowphansirikul得到了VISTEC-depa Thailand Artificial Intelligence Research Institute的支持。
MacStadium我们从MacStadium获得了免费的Mac Mini M1支持,用于运行CI构建。

<div align="center"> 用❤️制作 | PyThaiNLP团队💻 | "我们构建泰语NLP" 🇹🇭 </div>
<div align="center"> <strong>我们只有一个官方仓库:https://github.com/PyThaiNLP/pythainlp,另一个镜像仓库在https://gitlab.com/pythainlp/pythainlp</strong> </div> <div align="center"> <strong>请注意,如果您使用除GitHub和GitLab上的这两个官方仓库以外的镜像仓库中的代码,可能会遇到恶意软件。</strong> </div>

编辑推荐精选

商汤小浣熊

商汤小浣熊

最强AI数据分析助手

小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。

imini AI

imini AI

像人一样思考的AI智能体

imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。

Keevx

Keevx

AI数字人视频创作平台

Keevx 一款开箱即用的AI数字人视频创作平台,广泛适用于电商广告、企业培训与社媒宣传,让全球企业与个人创作者无需拍摄剪辑,就能快速生成多语言、高质量的专业视频。

即梦AI

即梦AI

一站式AI创作平台

提供 AI 驱动的图片、视频生成及数字人等功能,助力创意创作

扣子-AI办公

扣子-AI办公

AI办公助手,复杂任务高效处理

AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!

TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
下拉加载更多