1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-12 13:10:25 +08:00

优化 TextRanker

This commit is contained in:
源文雨
2022-11-30 12:56:04 +08:00
parent 21cdb2e863
commit a8d1e81f73
3 changed files with 16 additions and 15 deletions

View File

@@ -1,13 +1,11 @@
package analyse_test
package analyse
import (
"fmt"
"github.com/fumiama/jieba/analyse"
)
func Example_extractTags() {
var t analyse.TagExtracter
var t TagExtracter
t.LoadDictionary("../dict.txt")
t.LoadIdf("idf.txt")
@@ -22,8 +20,11 @@ func Example_extractTags() {
}
func Example_textRank() {
var t analyse.TextRanker
t.LoadDictionary("../dict.txt")
t, err := LoadDictionary("../dict.txt")
if err != nil {
panic(err)
}
sentence := "此外公司拟对全资子公司吉林欧亚置业有限公司增资4.3亿元增资后吉林欧亚置业注册资本由7000万元增加到5亿元。吉林欧亚置业主要经营范围为房地产开发及百货零售等业务。目前在建吉林欧亚城市商业综合体项目。2013年实现营业收入0万元实现净利润-139.13万元。"
result := t.TextRank(sentence, 10)