Examples of WeightedIntDocVector


Examples of ivory.core.data.document.WeightedIntDocVector

  }
 
  private WeightedIntDocVector findIntDocVector(int docno, int startFrom, FileSystem fs, String dir) {
    SequenceFile.Reader reader;
    IntWritable key = new IntWritable();
    WeightedIntDocVector value = new WeightedIntDocVector();
    try {
      FileStatus[] paths = fs.listStatus(new Path(dir));
      System.err.println("length " + paths.length);
      for (FileStatus path : paths) {
        if (!path.getPath().getName().contains("part"))  continue;
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

    Configuration conf = IntegrationUtils.getBespinConfiguration();
    FileSystem fs = FileSystem.get(conf);

    SequenceFile.Reader reader;
    IntWritable key = new IntWritable();
    WeightedIntDocVector value = new WeightedIntDocVector();

    reader = new SequenceFile.Reader(fs,
        new Path(galagoIndex + "/wt-int-doc-vectors/part-00002"), fs.getConf());
    reader.next(key, value);
    verifyIntDocVector(galagoIntDocVector1, value);
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

    Configuration conf = IntegrationUtils.getBespinConfiguration();
    FileSystem fs = FileSystem.get(conf);

    SequenceFile.Reader reader;
    IntWritable key = new IntWritable();
    WeightedIntDocVector value = new WeightedIntDocVector();

    reader = new SequenceFile.Reader(fs,
        new Path(opennlpIndex + "/wt-int-doc-vectors/part-00002"), fs.getConf());
    reader.next(key, value);
    System.out.println("opennlpInt1\n"+value);
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

        Reporter reporter) throws IOException {
      Long time = System.currentTimeMillis();
      for(int i=0;i<vectors.size();i++){
        IntWritable sampleDocno = (IntWritable)vectors.get(i).getLeftElement();

        WeightedIntDocVector fromSample = (WeightedIntDocVector)vectors.get(i).getRightElement();
        float cs = CLIRUtils.cosine(docvector.getWeightedTerms(), fromSample.getWeightedTerms());
        if(cs >= threshold){
          output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(cs,docno.get()));
        }
      }
      sLogger.info("Finished in "+(System.currentTimeMillis()-time));
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

        for(MapIF.Entry e : vectorWeights.entrySet()){
          float score = vectorWeights.get(e.getKey());
          vectorWeights.put(e.getKey(), score/sum2);
        }
      }
      WeightedIntDocVector weightedVector = new WeightedIntDocVector (docLen, vectorWeights);
      output.collect(mDocno, weightedVector);
      reporter.incrCounter(Docs.Total, 1);
    }
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

    public void map(IntWritable docno, WeightedIntDocVector docvector,
        OutputCollector<IntWritable, PairOfFloatInt> output, Reporter reporter) throws IOException {
      for (int i = 0; i < vectors.size(); i++) {
        IntWritable sampleDocno = (IntWritable) vectors.get(i).getLeftElement();

        WeightedIntDocVector fromSample = (WeightedIntDocVector) vectors.get(i).getRightElement();
        float cs = CLIRUtils.cosine(docvector.getWeightedTerms(), fromSample.getWeightedTerms());

        if (cs >= threshold) {
          output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(cs, docno.get()));
        }
      }
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

    public void map(IntWritable docno, WeightedIntDocVector docvector,
        OutputCollector<IntWritable, PairOfFloatInt> output, Reporter reporter) throws IOException {
      for (int i = 0; i < vectors.size(); i++) {
        IntWritable sampleDocno = (IntWritable) vectors.get(i).getLeftElement();

        WeightedIntDocVector fromSample = (WeightedIntDocVector) vectors.get(i).getRightElement();
        float cs = CLIRUtils.cosine(docvector.getWeightedTerms(), fromSample.getWeightedTerms());

        if (cs >= threshold) {
          output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(cs, docno.get()));
        }
      }
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

    Configuration conf = IntegrationUtils.getBespinConfiguration();
    FileSystem fs = FileSystem.get(conf);

    SequenceFile.Reader reader;
    IntWritable key = new IntWritable();
    WeightedIntDocVector value = new WeightedIntDocVector();

    reader = new SequenceFile.Reader(fs.getConf(),
        SequenceFile.Reader.file(new Path(enwikiEn + "/test_wt-int-doc-vectors/part-00000")));
    reader.next(key, value);
    verifyIntDocVector(enIntDocVector1, value);
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

    Configuration conf = IntegrationUtils.getBespinConfiguration();
    FileSystem fs = FileSystem.get(conf);

    SequenceFile.Reader reader;
    IntWritable key = new IntWritable();
    WeightedIntDocVector value = new WeightedIntDocVector();

    reader = new SequenceFile.Reader(fs.getConf(),
        SequenceFile.Reader.file(new Path(dewikiEn + "/test_wt-int-doc-vectors/part-00000")));
    reader.next(key, value);
    verifyIntDocVector(deIntDocVector1, value);
View Full Code Here

Examples of ivory.core.data.document.WeightedIntDocVector

    Configuration conf = IntegrationUtils.getBespinConfiguration();
    FileSystem fs = FileSystem.get(conf);

    SequenceFile.Reader reader;
    IntWritable key = new IntWritable();
    WeightedIntDocVector value = new WeightedIntDocVector();

    reader = new SequenceFile.Reader(fs.getConf(),
        SequenceFile.Reader.file(new Path(galagoIndex + "/test_wt-int-doc-vectors/part-00000")));
    reader.next(key, value);
    System.out.println("galagoInt1\n"+key+";"+value);
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.