fukuball / jieba-php

"結巴"中文分詞:做最好的 PHP 中文分詞、中文斷詞組件。 / "Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best PHP Chinese word segmentation module.

Home Page:http://jieba-php.fukuball.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

这个有词频分析和数据输出么?

wolf8210137 opened this issue · comments

我想要在一个句子中,取出前3个使用频率最高的名词,或者说最重要的前三个词。单纯的分词实现不了。不知道jieba-php有分词功能么?

@wolf8210137 有關鍵詞提取功能,使用 TF/IDF 演算法,請見 Readme 功能 3):關鍵詞提取

commented

cut可以加一个返回完整的分词带idf和词性的数组的选项吗, 返回结果类似这样
array(21) {
[0]=>
array(2) {
["word"]=>
string(3) "这"
["idf"]=>
double(8) 1.22223333
["tag"]=>
string(1) "r"
}....
}
用google的simhash算法做文章的相似度比较,需要文章的全部分词的权重,同时做情感分析需要分词的词性
也就是说,在cut的返回结果里把idf和词性也都带上就好了@fukuball

是可以花時間加上這樣的功能,看有沒有人要幫忙,或是等我有空 XD