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>

编辑推荐精选

Vora

Vora

免费创建高清无水印Sora视频

Vora是一个免费创建高清无水印Sora视频的AI工具

Refly.AI

Refly.AI

最适合小白的AI自动化工作流平台

无需编码,轻松生成可复用、可变现的AI自动化工作流

酷表ChatExcel

酷表ChatExcel

大模型驱动的Excel数据处理工具

基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。

AI工具酷表ChatExcelAI智能客服AI营销产品使用教程
TRAE编程

TRAE编程

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

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

AI工具TraeAI IDE协作生产力转型热门
AIWritePaper论文写作

AIWritePaper论文写作

AI论文写作指导平台

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

AI辅助写作AI工具AI论文工具论文写作智能生成大纲数据安全AI助手热门
博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

AI办公办公工具AI工具博思AIPPTAI生成PPT智能排版海量精品模板AI创作热门
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

iTerms

iTerms

企业专属的AI法律顾问

iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。

SimilarWeb流量提升

SimilarWeb流量提升

稳定高效的流量提升解决方案,助力品牌曝光

稳定高效的流量提升解决方案,助力品牌曝光

Sora2视频免费生成

Sora2视频免费生成

最新版Sora2模型免费使用,一键生成无水印视频

最新版Sora2模型免费使用,一键生成无水印视频

下拉加载更多