MoonNLP is a high-performance, Wasm-native, extensible Natural Language Processing (NLP) library implemented in pure MoonBit. It fills the gap in the MoonBit ecosystem for text tokenization, statistical language models, text classification, and text similarity metrics.
MoonNLP
MoonNLP 是一个使用纯 MoonBit 语言编写的高性能、面向 WebAssembly 原生、易于扩展的自然语言处理(NLP)核心库。它填补了 MoonBit 生态在文本分词、统计语言模型、文本分类及相似度计算等底层基础算法上的空白,为跨平台的网页端、云端及 Native 应用提供高效、开箱即用的自然语言处理基础设施。
MoonNLP is a high-performance, Wasm-native, extensible Natural Language Processing (NLP) library implemented in pure MoonBit. It fills the gap in the MoonBit ecosystem for text tokenization, statistical language models, text classification, and text similarity metrics.
项目特色 | Key Features
项目结构 | Directory Structure
快速上手 | Quick Start
1. 中文分词 (Word Segmentation)
2. 关键词提取 (TF-IDF Keyword Extraction)
3. 朴素贝叶斯分类器 (Naive Bayes Classifier)
编译、运行与测试 | Build, Run and Test
本项目遵循 MoonBit 官方工具链标准:
开源协议与合规声明 | Open Source License & Compliance
本项目采用 Apache License 2.0 授权许可协议。
人机协作开发回顾 (Human-AI Co-creation Retrospective)
本项目作为 2026 MoonBit 国产基础软件生态开源大赛 (OSC2026) 的参赛作品,完全由参赛开发者与 AI 编码助手 (Gemini/Antigravity) 合作完成。人机协作形式分工如下:
fn[T] Type::meth格式);人类进行局部测试和边界微调。size(),not(),f!(..)及a..b范围)进行修正,最终达成 100% 编译通过且 0 编译器警告的高标准工程目标。