【问题标题】:Python - Library that compute relevance score for text searchPython - 计算文本搜索相关性分数的库
【发布时间】:2011-03-24 11:12:33
【问题描述】:

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

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

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

【问题讨论】:

    标签: python mysql text-search


    【解决方案1】:

    看看 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-29
      • 1970-01-01
      • 2011-06-17
      • 2021-07-22
      • 1970-01-01
      相关资源
      最近更新 更多