https://github.com/hetao29/segment
https://github.com/hetao29/segment
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/hetao29/segment
- Owner: hetao29
- License: mit
- Created: 2023-11-03T10:59:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-03T12:46:38.000Z (over 1 year ago)
- Last Synced: 2025-01-24T15:41:41.221Z (3 months ago)
- Language: Go
- Size: 9.76 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 说明
基于[sego](https://github.com/huichen/sego)的golang的开源的中文分词系统,特点:
1. docker / docker swarm / k8s 部署
2. 支持多个自定义词库
3. rest api接口进行分词,也支持实时reload词库操作## Docker & Swarm/Composer
```bash
docker pull hetao29/segment:latest
```## 编译
```bash
make build
```## 运行
```bash
make start
```## 测试
```bash
make test
```
结果
```json
{"message":"pong","words":["关于","幼教","体系","组织","结构调整","结构","调整","等","的","通知"]}curl "http://127.0.0.1:8020/words?key=外国钱币硬币银铌世界纸钞爱藏"
{"message":"pong","words":["外国","钱币","硬币","银","铌","世界","纸钞","爱","藏"]}curl "http://127.0.0.1:8020/words?key=矮人火枪地狱兽残酷角斗士的军刺"
{"message":"pong","words":["矮人","火枪","地狱兽","地狱","残酷","角斗士","角斗","的","军","刺"]}
```
## 词性说明https://github.com/fxsjy/jieba