Package edu.isi.karma.semantictypes.tfIdf

Examples of edu.isi.karma.semantictypes.tfIdf.Searcher


    // check if semantic label already exists
    Document labelDoc = null; // document corresponding to existing semantic label if exists
    if (indexDirectoryExists()) {
      try {
        // check if semantic label already exists in index
        Searcher searcher = new Searcher(indexDirectory,
            Indexer.LABEL_FIELD_NAME);
        try {
          labelDoc = searcher.getDocumentForLabel(label);
        } finally {
          searcher.close();
        }
      } catch (Exception e) {
        // Ignore, the searcher might not work if index is empty.
      }
    }
View Full Code Here


        sb.append(ex);
        sb.append(" ");
      }
     
      try {
        Searcher predictor = new Searcher(indexDirectory,
            Indexer.CONTENT_FIELD_NAME);
        try {
          List<SemanticTypeLabel> result = predictor.getTopK(numPredictions, sb.toString());
          logger.debug("Got " + result.size() + " predictions");
          return result;
        } finally {
          predictor.close();
        }
      } catch (ParseException | IOException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

TOP

Related Classes of edu.isi.karma.semantictypes.tfIdf.Searcher

Copyright © 2018 www.massapicom. 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.