My short description for my project.
Project description
nlp-qa-tfidf
介绍
tfidf 余弦短文本求相似度
package
gensim jieba pandas
实例化参数
Tfidf = Tfidf(stopwords_file="", work_dir="", work_file_prefix="")
#stopwords_file 停用词文件 可不填 包里自带有
#work_dir 工作目录 模型存储的路径,不填则在当前项目根目录下 建议填
#work_file_prefix 文件名字前缀, 不填则训练的模型名字为 _.model 可以填时间戳,或者用户id,建议填写 不然模型会相互覆盖
模型训练
# QA 场景
# 问题列表
question_list = [
"test1-question","test2-question","test3-question"
]
# 答案列表
answer_list = [
"test1-answer","test2-answer","test3-answer"
]
Tfidf = Tfidf(stopwords_file="", work_dir="", work_file_prefix="")
# 训练模型并保存
Tfidf.save_model(question_list=question_list,answer_list=answer_list)
# 输入问题,并去计算相似度
Tfidf.run(question="test question")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nlp-tfidf-1.5.6.tar.gz
(18.9 kB
view hashes)
Built Distribution
Close
Hashes for nlp_tfidf-1.5.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a3c47d48749b092232f594d930e30966ad9496ca2b188cc85d1dcc0933fe41e |
|
MD5 | 1c549d528e9462a66736ae2b97bc4765 |
|
BLAKE2b-256 | 77bf238aed3a99af9148173ac4efaed8d40757f4bf525c51f618450ae8ec1ff7 |