Examples of QueryEngine


Examples of it.unimi.di.big.mg4j.query.QueryEngine

    final SimpleParser queryParser = new SimpleParser(indexMap.keySet(),
        indexMap.firstKey(), null);

    final Reference2ReferenceMap<Index, Object> index2Parser = new Reference2ReferenceOpenHashMap<>();

        queryEngine = new QueryEngine(queryParser, new DocumentIteratorBuilderVisitor(indexMap,
                index2Parser, indexMap.get(indexMap.firstKey()),
                Query.MAX_STEMMING), indexMap);

    queryEngine.score(new Scorer[]{scorer}, new double[]{1});
View Full Code Here

Examples of it.unimi.dsi.mg4j.query.QueryEngine

   
    /* To run a query in a simple way we need a query engine. The engine requires a parser
     * (which in turn requires the set of index names and a default index), a document iterator
     * builder, which needs the index map, a default index, and a limit on prefix query
     * expansion, and finally the index map. */
    QueryEngine engine = new QueryEngine(
      new SimpleParser( indexMap.keySet(), "text", termProcessors ),
      new DocumentIteratorBuilderVisitor( indexMap, text, 1000 ),
      indexMap
     
    );

    /* Optionally, we can score the results. Here we use a state-of-art ranking
     * function, BM25, which requires document sizes. */
    engine.score( new BM25Scorer() );
   
    /* Optionally, we can weight the importance of each index. To do so, we have to pass a map,
     * and again we use the handy fastutil constructor. Note that setting up a BM25F scorer
     * would give much better results, but we want to keep it simple. */
    engine.setWeights( new Reference2DoubleOpenHashMap<Index>( new Index[] { text, title }, new double[] { 1, 2 } ) );
   
    /* Optionally, we can use an interval selector to get intervals representing matches. */
    engine.intervalSelector = new IntervalSelector();
   
    /* We are ready to run our query. We just need a list to store its results. The list is made
     * of DocumentScoreInfo objects, which comprise a document id, a score, and possibly an
     * info field that is generic. Here the info field is a map from indices to arrays
     * of selected intervals. This part will be empty if we do not set an interval selector. */
    ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index, SelectedInterval[]>>> result =
      new ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index,SelectedInterval[]>>>();

    /* The query engine can return any subsegment of the results of a query. Here we grab the first 20 results. */
    engine.process( arg[ 1 ], 0, 20, result );
   
    for( DocumentScoreInfo<Reference2ObjectMap<Index, SelectedInterval[]>> dsi : result ) {
      System.out.println( dsi.document + " " + dsi.score );
    }
  }
View Full Code Here

Examples of ivory.sqe.retrieval.QueryEngine

    "78", "0.2855","77", "0.1152","35", "0.0021","36", "0.0028","33", "0.354","39", "0.0542","38", "0.0","43", "0.0723","42", "0.2187","41", "0.0712","40", "0.0","82", "0.173","83", "0.1171","80", "0.0968","87", "0.2274","84", "0.3617","85", "0.06","67", "0.1404","66", "0.0118","69", "0.0","68", "0.6597","23", "0.1503","26", "0.0056","28", "0.4382","29", "0.1725","2", "0.1554","30", "0.1201","6", "0.0755","5", "0.0024","32", "0.1401","70", "0.0015","9", "0.1323","71", "0.4966","72", "0.3776","73", "7.0E-4","74", "0.0384","75", "0.0041","76", "0.3721","59", "0.0329","58", "0.0956","57", "0.1211","19", "0.2074","56", "0.1257","18", "0.0","15", "0.2479","16", "0.0552","12", "0.0476","64", "0.4514","65", "0.4463","62", "0.4401","63", "0.0063","99", "0.3902","61", "0.0106","100", "0.1015","98", "0.3637","49", "0.0","97", "0.0062","48", "2.0E-4","96", "0.0306","95", "7.0E-4","94", "0.1811","45", "0.1176","93", "0.1338","44", "0.026","92", "0.212","47", "0.0","91", "0.6703","46", "0.2169","90", "0.0233","51", "0.0","52", "0.1413","53", "0.1198","54", "0.1988",
  };

  public EnZh_NTCIR8() {
    super();
    qe = new QueryEngine();
  }
View Full Code Here

Examples of ivory.sqe.retrieval.QueryEngine

    "35", "0.1661","36", "0.0022","33", "0.0198","34", "0.0059","39", "0.324","37", "0.3725","38", "0.0068","43", "0.0","42", "0.4007","41", "0.3236","40", "0.5037","67", "0.5584","66", "0.2819","69", "0.5405","68", "0.2965","26", "0.0037","27", "0.2963","28", "0.0021","29", "0.5275","30", "0.7243","32", "0.3655","31", "0.042","70", "0.5104","71", "0.2278","72", "0.0276","73", "0.248","74", "0.0159","75", "0.1714","59", "0.7359","58", "0.1171","57", "0.0971","56", "0.3585","55", "0.616","64", "6.0E-4","65", "0.5153","62", "0.0509","63", "0.0783","60", "0.7071","61", "0.0885","49", "0.7933","48", "0.7146","45", "0.0731","44", "0.171","47", "0.3368","46", "0.2876","51", "0.0186","52", "0.0617","53", "0.0038","54", "0.0409","50", "0.7403"
  };

  public EnAr_TREC02() {
    super();
    qe = new QueryEngine();
  }
View Full Code Here

Examples of ivory.sqe.retrieval.QueryEngine

    "338", "0.0336","339", "0.4941","332", "0.0","333", "0.8719","330", "0.6","331", "0.2255","336", "0.5","337", "0.6051","334", "0.4261","335", "0.37","349", "0.3297","302", "0.2168","301", "0.4115","304", "0.2738","303", "0.2342","341", "0.4332","306", "0.0442","305", "0.1813","342", "0.0641","343", "0.1029","308", "0.2852","344", "0.3045","307", "0.1168","345", "0.3336","346", "0.0499","309", "0.0134","347", "0.0647","348", "0.5605","340", "0.1798","318", "0.4432","319", "0.5609","316", "0.3711","317", "0.0334","314", "0.0666","315", "0.1825","312", "0.2237","313", "0.2365","310", "0.0033","311", "0.0668","327", "0.225","328", "0.4386","329", "0.7745","323", "0.0775","324", "0.0","325", "0.0104","326", "0.0","320", "0.0707","321", "0.4164","350", "0.4197","322", "0.1389",
  };

  public EnFr_CLEF06() {
    super();
    qe = new QueryEngine();
  }
View Full Code Here

Examples of ivory.sqe.retrieval.QueryEngine

    "78", "0.2855","77", "0.1152","35", "0.0021","36", "0.0028","33", "0.354","39", "0.0542","38", "0.0","43", "0.0723","42", "0.2187","41", "0.0712","40", "0.0","82", "0.173","83", "0.1171","80", "0.0968","87", "0.2274","84", "0.3617","85", "0.06","67", "0.1404","66", "0.0118","69", "0.0","68", "0.6597","23", "0.1503","26", "0.0056","28", "0.4382","29", "0.1725","2", "0.1554","30", "0.1201","6", "0.0755","32", "0.1401","5", "0.0024","70", "0.0015","9", "0.1323","71", "0.4966","72", "0.3776","73", "7.0E-4","74", "0.0384","75", "0.0041","76", "0.3721","59", "0.0329","58", "0.0956","57", "0.1211","19", "0.2074","56", "0.1257","18", "0.0","15", "0.2479","16", "0.0552","12", "0.0476","64", "0.4514","65", "0.4463","62", "0.4401","63", "0.0063","99", "0.3902","61", "0.0106","100", "0.1015","98", "0.3637","49", "0.0","97", "0.0062","48", "2.0E-4","96", "0.0306","95", "7.0E-4","94", "0.1811","45", "0.1176","93", "0.1338","44", "0.026","92", "0.212","47", "0.0","91", "0.6703","46", "0.2169","90", "0.0233","51", "0.0","52", "0.1413","53", "0.1198","54", "0.1988",
  };
 
  public EnZh_NTCIR8() {
    super();
    qe = new QueryEngine();
  }
View Full Code Here

Examples of ivory.sqe.retrieval.QueryEngine

    "35", "0.1661","36", "0.0022","33", "0.0198","34", "0.0059","39", "0.324","37", "0.3725","38", "0.0068","43", "0.0","42", "0.4007","41", "0.3236","40", "0.5037","67", "0.5584","66", "0.2819","69", "0.5405","68", "0.2965","26", "0.0037","27", "0.2963","28", "0.0021","29", "0.5275","30", "0.7243","32", "0.3655","31", "0.042","70", "0.5104","71", "0.2278","72", "0.0276","73", "0.248","74", "0.0159","75", "0.1714","59", "0.7359","58", "0.1171","57", "0.0971","56", "0.3585","55", "0.616","64", "6.0E-4","65", "0.5153","62", "0.0509","63", "0.0783","60", "0.7071","61", "0.0885","49", "0.7933","48", "0.7146","45", "0.0731","44", "0.171","47", "0.3368","46", "0.2876","51", "0.0186","52", "0.0617","53", "0.0038","54", "0.0409","50", "0.7403"
  };

  public EnAr_TREC02() {
    super();
    qe = new QueryEngine();
  }
View Full Code Here

Examples of ivory.sqe.retrieval.QueryEngine

    "338", "0.0336","339", "0.4941","332", "0.0","333", "0.8719","330", "0.6","331", "0.2255","336", "0.5","337", "0.6051","334", "0.4261","335", "0.37","349", "0.3297","302", "0.2168","301", "0.4115","304", "0.2738","303", "0.2342","306", "0.0442","341", "0.4332","305", "0.1813","342", "0.0641","308", "0.2852","343", "0.1029","307", "0.1168","344", "0.3045","345", "0.3336","309", "0.0134","346", "0.0499","347", "0.0647","348", "0.5605","340", "0.1798","318", "0.4432","319", "0.5609","316", "0.3711","317", "0.0334","314", "0.0666","315", "0.1825","312", "0.2237","313", "0.2365","310", "0.0033","311", "0.0668","327", "0.225","328", "0.4386","329", "0.7745","323", "0.0775","324", "0.0","325", "0.0104","326", "0.0","320", "0.0707","350", "0.4197","321", "0.4164","322", "0.1389",
  };
 
  public EnFr_CLEF06() {
    super();
    qe = new QueryEngine();
  }
View Full Code Here

Examples of ivory.sqe.retrieval.QueryEngine

        ivory.app.BuildIndex.class.getCanonicalName(), libjars,
        "-index=" + index, "-indexPartitions=10", "-positionalIndexIP" };

    IntegrationUtils.exec(Joiner.on(" ").join(args));

    QueryEngine qr = new QueryEngine();

    for (int heuristic=0; heuristic<=2; heuristic++) {
      conf = RunQueryEngine.parseArgs(new String[] {
          "-index=" + index,
          "-queries_path=" + index + "/title_en-" + LANGUAGE + "-trans10-filtered.xml",
          "-run=en-" + LANGUAGE + ".interp",
          "-query_type=mtN",
          "-doc_lang=" + LANGUAGE + "",
          "-query_lang=en",
          "-doc_tokenizer=" + index + "/" + LANGUAGE + "-token.bin",
          "-query_tokenizer=" + index + "/en-token.bin",
          "-query_vocab=" + index + "/vocab.en-" + LANGUAGE + ".en",
          "-doc_vocab=" + index + "/vocab.en-" + LANGUAGE + "." + LANGUAGE + "",
          "-f2eProbs=" + index + "/ttable.en-" + LANGUAGE + "",
          "-LexProbThreshold=0.005",
          "-CumProbThreshold=0.95"
          "-mt_weight=0.3",
          "-grammar_weight=0.4",
          "-bitext_weight=0.3",
          "-token_weight=1",
          "-phrase_weight=0",
          "-kBest=10",
          "-doc_stemmed_stopwordlist=" + index + "/" + LANGUAGE + ".stop.stemmed",
          "-query_stemmed_stopwordlist=" + index + "/en.stop.stemmed",
          "--one2many=" + heuristic, "--is_stemming", "--is_doc_stemmed"
      }, fs, conf);

      long start = System.currentTimeMillis();
      qr.init(conf, fs);
      qr.runQueries(conf);
      long end = System.currentTimeMillis();

      System.err.println("Total query time for heuristic " + heuristic + ":" + (end - start) + "ms");
    }
    ivory.regression.sigir2013.cdec.EnZh_NTCIR8.initialize();
    ivory.regression.sigir2013.cdec.EnZh_NTCIR8.verifyAllResults(qr.getModels(), qr.getAllResults(), qr.getDocnoMapping(),
        new Qrels("data/" + PATH + "/qrels." + PATH+ ".txt"));

    System.err.println("Done!");
  }
View Full Code Here

Examples of net.fortytwo.ripple.query.QueryEngine

        // TODO: shutDown on failure
        model = new SesameModel(sailConfig.getSail());

        StackEvaluator eval = new LazyStackEvaluator();
        QueryEngine queryEngine = new QueryEngine(model, eval, System.out, System.err);

        queryPipe = new QueryPipe(queryEngine, results);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.