Python - 计算文本搜索相关性分数的库

标签 python mysql text-search

我的想法是实现类似于MySQL MATCH/AGAINST关键字的执行。

您知道计算文本搜索相关性得分的 Python 库吗?

如果答案不令人满意,我将使用 Python 连接器连接到 MySQL。

最佳答案

看看 PyLucene http://lucene.apache.org/pylucene/

import os, sys, unittest, lucene
lucene.initVM()

baseDir = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.append(baseDir)

import lia.searching.ScoreTest
from lucene import System

System.setProperty("index.dir", os.path.join(baseDir, 'index'))
unittest.main(lia.searching.ScoreTest)

您可以在 http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/LuceneInAction/ 找到更多示例和 lia

关于Python - 计算文本搜索相关性分数的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3392303/

相关文章:

MySQL 索引大于存储的数据

php - 对 MySQL 列和 PHP 数组进行排序

php - php源代码中的similar_text

json - 如何使用 BleveSearch 获得精确的短语匹配?

具有多个循环的 Python 列表理解

python - wxPython:ProgressDialog 崩溃

php - 如何使用 "if then"排序逻辑编写 WordPress 元查询

javascript - 在 JS 中查找字符串中的关键字

python - 交互式列表框 Tkinter

python - 如何从套装中获得一些元素?