leizongmin / leizongmin/node-segment

是否有参数可以指定分词时,不作联想组合,只返回最小词组?

Open
#11 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.2k
Forks
132
PR merge metrics
No merged PRs in 30d

Description

分词模块自动联想合并词组本来是挺好的,但是作为拼音的依赖模块,这个功能反而带来了麻烦。
这种不确定性导致词组拼音库极大的增加,如果可以不做联想,返回最小词组(成语例外)就比较好处理了。比如:

文本 实际结果 期望结果
香港特别行政区 香港特别行政区 香港, 特别, 行政, 区
重庆市 重庆市 重庆, 市
重庆市政府 重庆市, 政府 重庆, 市, 政府
重庆市区 重庆, 市区 重庆, 市区
重庆市民 重庆, 市民 重庆, 市民

注:最小词组也许不准确,比如成语可以继续拆分,应该优先返回成语。

不同的使用场景可以要求不同,比如对于拼音来说,拆分成『最小』、准确的词组会比较好;而对于语义分析坑能联想会较好。

期待你的意见 😃

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the segmentation module's current phrase-merging behavior and reproduce the examples in the issue. Define how an optional mode should return minimal word groups while preserving idioms, and verify that the existing associative behavior remains available for other use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.