NLP
MachineLP
成功收获成果,失败收获智慧,投入收获快乐!
展开
-
[ES] es 搜索的高级功能:搜索并按照不同字段sore权重计算得分排序
电商搜索中一个通用搜索语句:GET /_search{ "query": { "function_score": { "query": { "bool": { "should": [ { "match_phrase": { "title": { ...原创 2020-08-03 11:05:05 · 2432 阅读 · 0 评论 -
[TextMatch框架] 基于召回和排序的文本搜索
git clone https://github.com/MachineLP/TextMatchcd TextMatchexport PYTHONPATH=${PYTHONPATH}:../TextMatchpython tests/core_test/text_search_test.pytests/core_test/text_search_test.pyimport sysfrom textmatch.core.text_match import TextMatchfrom text原创 2020-07-19 17:13:21 · 665 阅读 · 0 评论 -
[TextMatch框架] QA Match (QA匹配)
run examplesgit clone https://github.com/MachineLP/TextMatchcd TextMatchexport PYTHONPATH=${PYTHONPATH}:../TextMatchpython tests/core_test/qa_match_test.pyqa matchimport sysfrom textmatch.core.qa_match import QMatch, AMatch, SemanticMatchtest_dic原创 2020-07-18 21:13:06 · 731 阅读 · 0 评论 -
[TextMatch框架] 基于faiss的搜索
run examplesgit clone https://github.com/MachineLP/TextMatchcd TextMatchexport PYTHONPATH=${PYTHONPATH}:../TextMatchpython tests/tools_test/faiss_test.pytests/tools_test/faiss_test.pyimport sysimport json import timeimport faissimport numpy as原创 2020-07-18 21:06:43 · 547 阅读 · 0 评论 -
[文本纠错] pycorrector框架训练
深度模型使用说明Install全自动安装:pip install pycorrector半自动安装:git clone https://github.com/shibing624/pycorrector.gitcd pycorrectorpython setup.py install通过以上两种方法的任何一种完成安装都可以。如果不想安装,可以下载github源码包,安装下面依赖再使用。安装依赖kenlm安装pip install https://github.com/kpu/k原创 2020-06-27 18:14:54 · 5319 阅读 · 1 评论 -
[文本纠错] pycorrector框架测试
pycorrector:https://github.com/shibing624/pycorrectorpycorrector中文文本纠错工具。音似、形似错字(或变体字)纠正,可用于中文拼音、笔画输入法的错误纠正。python3.6开发。pycorrector依据语言模型检测错别字位置,通过拼音音似特征、笔画五笔编辑距离特征及语言模型困惑度特征纠正错别字。Question中文文本纠错任务,常见错误类型包括:谐音字词,如 配副眼睛-配副眼镜混淆音字词,如 流浪织女-牛郎织女字词顺序颠倒,如原创 2020-06-27 18:05:05 · 2794 阅读 · 0 评论 -
[TextMatch框架] 生成词云
TextMatchTextMatch is a semantic matching model library for QA & text search … It’s easy to train models and to export representation vectors.[TextMatch框架] : 文本匹配/文本分类/文本embedding/文本聚类/文本检索(bow/ifidf/ngramtf-df/bert/albert/bm25/…/nn/gbdt/xgb/kmeans原创 2020-06-20 10:29:26 · 258 阅读 · 0 评论 -
[TextMatch框架] 简介
TextMatchTextMatch is a semantic matching model library for QA & text search … It’s easy to train models and to export representation vectors.run examplesgit clone https://github.com/MachineLP/TextMatchcd TextMatchexport PYTHONPATH=${PYTHONPATH}:.原创 2020-06-12 21:55:05 · 1744 阅读 · 0 评论 -
[TextMatch框架] server
TextMatchTextMatch is a semantic matching model library for QA & text search … It’s easy to train models and to export representation vectors.TextMatch/server模块包含 :(基于MLFlow的server)model_server.pyimport osimport sysimport timeimport p...原创 2020-06-12 17:11:03 · 389 阅读 · 0 评论 -
[TextMatch框架] tests
TextMatchTextMatch is a semantic matching model library for QA & text search … It’s easy to train models and to export representation vectors.TextMatch/tests模块包含 :(1)core_test qa_match_test.py text_embedding_test.py(2)model...原创 2020-06-12 17:09:45 · 292 阅读 · 0 评论 -
[TextMatch框架] train model
TextMatchTextMatch is a semantic matching model library for QA & text search … It’s easy to train models and to export representation vectors.原创 2020-06-12 17:08:37 · 429 阅读 · 0 评论 -
[TextMatch框架] models
TextMatchTextMatch is a semantic matching model library for QA & text search … It’s easy to train models and to export representation vectors.textmatch/models模块包含 :(1)text_classifier:文本分类任务。(2)text_embedding:文本提取embedding向量,主要有bow、tfidf、n...原创 2020-06-12 17:07:00 · 207 阅读 · 0 评论 -
[TextMatch框架] Run examples
TextMatchTextMatch is a semantic matching model library for QA & text search … It’s easy to train models and to export representation vectors.Let’s Run examples !下面先来简单的运行一个样例:git clone https://github.com/MachineLP/TextMatchcdTextMatch...原创 2020-05-17 22:40:51 · 315 阅读 · 0 评论 -
[文本语义相似] 基于bm25算法
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于bm25算法。代码如下:import mathimport jiebafrom utils import utils# 测试文本text = '''自然语言处理是计算机科学领域...原创 2020-05-17 22:37:24 · 936 阅读 · 1 评论 -
[文本语义相似] 基于bert的余弦距离(bert4keras实现)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于bert的余弦距离计算相似度。...原创 2020-05-04 12:25:29 · 3828 阅读 · 1 评论 -
[文本语义相似] 基于ngram-tf-idf的余弦距离(gensim实现)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于bow的余弦距离计算相似度。基于gensim的方式如下:import os...原创 2020-05-04 09:31:30 · 533 阅读 · 0 评论 -
[文本语义相似] 基于tf-idf的余弦距离(gensim实现)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于bow的余弦距离计算相似度。基于gensim的方式如下:import osi...原创 2020-05-04 09:25:23 · 652 阅读 · 0 评论 -
[文本语义相似] 基于bow的余弦距离(gensim实现)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于bow的余弦距离计算相似度。基于gensim的方式如下:import osi...原创 2020-05-04 09:18:53 · 552 阅读 · 0 评论 -
[文本语义相似] 基于ngram-tf-idf的余弦距离(sklearn实现)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于ngram-tf-idf的余弦距离计算相似度。本节将介绍两种实现:基于sklearn 和...原创 2020-04-29 22:42:03 · 850 阅读 · 0 评论 -
[文本语义相似] 基于tf-idf的余弦距离(sklearn实现)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于tf-idf的余弦距离计算相似度。本节将介绍两种实现:基于sklearn 和 基于gen...原创 2020-04-29 22:36:54 · 842 阅读 · 0 评论 -
[文本语义相似] 基于bow的余弦距离(sklearn实现)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于bow的余弦距离计算相似度。...原创 2020-04-29 20:16:56 · 497 阅读 · 0 评论 -
[文本语义相似] 基于Word2Vec的wmdistance (Word Mover Distance)
文本相似在问答系统中有很重要的应用,如基于知识的问答系统(Knowledge-based QA),基于文档的问答系统(Documen-based QA),以及基于FAQ的问答系统(Community-QA)等。像对于问题的内容,需要进行相似度匹配,从而选择出与问题最接近,同时最合理的答案。本节介绍基于Word2Vec的wmdistance需要知识:(1)Word2Vec(2...原创 2020-04-29 20:08:46 · 1542 阅读 · 2 评论