Exemple #1
0
 /// <summary>
 /// post query engine ctor
 /// </summary>
 /// <param name="indexer"></param>
 public PostQueryEngine(ref Indexer indexer)
 {
     searcher = new Searcher(ref indexer, 3);
     ranker   = new Ranker(ref indexer, ref searcher, 1.2, 40, 0.5);
     //opt = new Optimizer(ref indexer);
     //opt.Optimize(Properties.Settings.Default.postingFiles+"\\qrels.txt");
 }
Exemple #2
0
        public int compareResults(ObservableDictionary <int, List <string> > QueriesResults)
        {
            int recall   = 0;
            int hasTitle = 0;

            foreach (int queryResult in QueriesResults.Keys)
            {
                //Ranker.top50Results(
                int qrecall = 0;
                foreach (string docNo in (Ranker.top50Results(QueriesResults[queryResult])))
                {
                    if (qrelsDictionary[queryResult].ContainsKey(docNo) && qrelsDictionary[queryResult][docNo] == 1)
                    {
                        qrecall++;
                    }
                }
                //Debug.WriteLine("Query ID: "+queryResult+" , Relevant: "+qrecall);
                recall += qrecall;
            }
            return(recall);
        }