开源软件名称:tf-idf-keyword
开源软件地址:https://gitee.com/apple12345656/tf-idf-keyword
开源软件介绍:
基于TF-IDF的中文关键词提取requirements默认环境python3,需要结巴分词器的支持 IDF(逆文档频率)生成用法: $ python gen_idf.py -i <inputdir> -o <outputfile> -i <inputdir> : 语料库目录,程序会扫描目录下的所有文件-o <outputfile> : 保存idf到指定文件
TF-IDF关键词提取用法: $ python tfidf.py -i <idffile> -d <document> -t <topK> -i <idffile> : idf文件路径-d <document> : 所需处理文档路径-t <topK> : 返回topK结果
示例$ python tfidf.py -i idf.txt -d test.txt -t 20 返回结果: 核处理器服务器系统核心封装系列插槽核心主频产品伊斯坦布尔英特尔功耗多处理器低仅折合浮点运算性能构建吹起 注:该repo中提供的idf.txt由清华NLP组的新闻数据集训练获得。 |
请发表评论