Saturday 15 August 2015

Cosine scoring in whoosh, python -


I have implemented some Python code that runs the search whoosh using BM 25 and were all fine, but now I'm trying to change the cosine of the scoring system, making me get this error:

ix.searcher in Tifaidif file "Tifaidiafghepa", line 18, (Waiting = Josh .Scoring.cocine)) as the explorer: attribute: error: 'cosine' in 'module' object Oi is characterized

If I cosine imports am

  whoosh.scoring import cosine   

I get it Is:

  file "TFIDF.py", line 4, & lt; Module & gt; Cosine import Whoosh.scoring import Irrr: Name cosine   

Below is my code:

  import whoosh whoosh.scoring import whoosh the cosine Whoosh.scoring import .fields from those who whoosh.qparser import * whoosh.index import whoosh.query import * open_dir # Index path lab3dir = "../lab3/Aula3_1/" ix = open_dir (lab3dir + "indexdir ") # index is generated in the previous lab Diff Kosiin (Kweritims): list = [] dict = {} # dict com ID DOC e Sinilided ix.searcher (weighting = whoosh.scoring.Cosine ()) as finder : Query = QueryParser ("Content" Ri ", ix.schema, group = OrGroup). Purs (U (querytimes)) = resultor finder Calculation (results) for search (query, range = 100), r: list.append (r ["id"]) print r, results.score (i) dict [r ["id"]] = results. Score (i) return word   

any ideology ???

Thank you!

The document I believe is what you are seeing is wrong as you have found See the documentation () or source code () for the options available in

No comments:

Post a Comment