Skip to main content

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


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.6.7.tar.gz (20.0 kB view details)

Uploaded Source

Built Distributions

nlp_tfidf-1.6.7-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

nlp_tfidf-1.6.7-py2.py3-none-any.whl (17.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file nlp_tfidf-1.6.7.tar.gz.

File metadata

  • Download URL: nlp_tfidf-1.6.7.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for nlp_tfidf-1.6.7.tar.gz
Algorithm Hash digest
SHA256 93e81954357656fc720becc41f8ceffc9e29311b515a7013d06a00b66279ef31
MD5 d12fc9a2f5cf96c397db84cae8055678
BLAKE2b-256 6e89c2678ad192f07d84da0d3625152675f69ac3a9843343f732ca1c83f2aa34

See more details on using hashes here.

File details

Details for the file nlp_tfidf-1.6.7-py3-none-any.whl.

File metadata

  • Download URL: nlp_tfidf-1.6.7-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for nlp_tfidf-1.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bc348521fb46599773924c044cc8dd653f862c4c3487115da6a79072b198fc11
MD5 2c6042ee94fcc168863a894b70ae442b
BLAKE2b-256 2b85a4a35548c66079832f8678339be2215f97f4b79bee375c190dce08927caa

See more details on using hashes here.

File details

Details for the file nlp_tfidf-1.6.7-py2.py3-none-any.whl.

File metadata

  • Download URL: nlp_tfidf-1.6.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for nlp_tfidf-1.6.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ac21d68f60aec1132995f161a374f0f1c01eb768333ec57799149efd804ff2ac
MD5 baea081ff04b26431bf344fd8485c885
BLAKE2b-256 94d61c7758381f066c09b4a2e5c8ff36a77c4e6a547617d35403f22f6210d3a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page