Skip to main content

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")

Metadata

Release files for nlp-tfidf 1.6.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nlp-tfidf 1.6.7
File Size Uploaded
nlp_tfidf-1.6.7.tar.gz 20.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for nlp-tfidf 1.6.7
File Interpreter ABI Platform
nlp_tfidf-1.6.7-py3-none-any.whl Python 3 none any Details
nlp_tfidf-1.6.7-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 55.8 kB

Release files / nlp_tfidf-1.6.7.tar.gz

Download URL nlp_tfidf-1.6.7.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
93e81954357656fc720becc41f8ceffc9e29311b515a7013d06a00b66279ef31
BLAKE2b-256 checksum
How to use checksums
6e89c2678ad192f07d84da0d3625152675f69ac3a9843343f732ca1c83f2aa34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18

Release files / nlp_tfidf-1.6.7-py3-none-any.whl

Download URL nlp_tfidf-1.6.7-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc348521fb46599773924c044cc8dd653f862c4c3487115da6a79072b198fc11
BLAKE2b-256 checksum
How to use checksums
2b85a4a35548c66079832f8678339be2215f97f4b79bee375c190dce08927caa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18

Release files / nlp_tfidf-1.6.7-py2.py3-none-any.whl

Download URL nlp_tfidf-1.6.7-py2.py3-none-any.whl
Size 17.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ac21d68f60aec1132995f161a374f0f1c01eb768333ec57799149efd804ff2ac
BLAKE2b-256 checksum
How to use checksums
94d61c7758381f066c09b4a2e5c8ff36a77c4e6a547617d35403f22f6210d3a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18

Release history Release notifications | RSS feed

This release

1.6.7 This release

3 release files

1.6.6

3 release files

1.6.5

2 release files

1.6.1

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.1

2 release files

1.5

2 release files

1.3

2 release files

1.2

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page