Class SemanticContextIndex

    • Field Summary

      Fields 
      Modifier and Type Field Description
      org.apache.lucene.search.IndexSearcher searcher  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      de.julielab.geneexpbase.candidateretrieval.SynHit doDisambiguation​(List<de.julielab.geneexpbase.candidateretrieval.SynHit> filteredCandidates, org.apache.lucene.search.Query query)
      does semantic disambiguation, takes best one
      de.julielab.geneexpbase.candidateretrieval.SynHit doDisambiguation​(List<de.julielab.geneexpbase.candidateretrieval.SynHit> filteredCandidates, org.apache.lucene.search.Query query, double minContextScore)
      does semantic disambiguation, takes best one if its semantic score is above or equals minScore threshold
      de.julielab.geneexpbase.candidateretrieval.SynHit doSeparateDisambiguation​(ArrayList<de.julielab.geneexpbase.candidateretrieval.SynHit> disambigList, String context, double minContextScore)
      does semantic disambiguation on each SynHit separately, takes best one if its semantic score is above or equals minScore threshold
      org.apache.lucene.search.TopDocs getContextForSynHits​(List<de.julielab.geneexpbase.candidateretrieval.SynHit> hits, Map<String,​de.julielab.geneexpbase.candidateretrieval.SynHit> id2Hit, org.apache.lucene.search.Query query)  
      org.apache.lucene.search.IndexSearcher getSemanticIndexSearcher()  
      org.apache.lucene.search.BooleanQuery makeContextQuery​(String context)  
      org.apache.lucene.search.Query makeQuery​(String[] allowedIDs, org.apache.lucene.search.Query query)  
      org.apache.lucene.search.BooleanQuery makeQuery​(String allowedID, org.apache.lucene.search.BooleanQuery contextQuery)  
      org.apache.lucene.search.BooleanQuery makeSeparateQuery​(String id, String context)
      generates a boolean query from the context and a single ids: the id has to match and the context is combined by OR.
      Map<String,​String> retrieveGeneContexts​(List<de.julielab.geneexpbase.candidateretrieval.SynHit> candidates)  
    • Field Detail

      • searcher

        public org.apache.lucene.search.IndexSearcher searcher
    • Method Detail

      • doDisambiguation

        public de.julielab.geneexpbase.candidateretrieval.SynHit doDisambiguation​(List<de.julielab.geneexpbase.candidateretrieval.SynHit> filteredCandidates,
                                                                                  org.apache.lucene.search.Query query)
                                                                           throws IOException
        does semantic disambiguation, takes best one
        Throws:
        IOException
      • doDisambiguation

        public de.julielab.geneexpbase.candidateretrieval.SynHit doDisambiguation​(List<de.julielab.geneexpbase.candidateretrieval.SynHit> filteredCandidates,
                                                                                  org.apache.lucene.search.Query query,
                                                                                  double minContextScore)
                                                                           throws IOException
        does semantic disambiguation, takes best one if its semantic score is above or equals minScore threshold
        Throws:
        IOException
      • getContextForSynHits

        public org.apache.lucene.search.TopDocs getContextForSynHits​(List<de.julielab.geneexpbase.candidateretrieval.SynHit> hits,
                                                                     Map<String,​de.julielab.geneexpbase.candidateretrieval.SynHit> id2Hit,
                                                                     org.apache.lucene.search.Query query)
                                                              throws IOException
        Throws:
        IOException
      • makeContextQuery

        public org.apache.lucene.search.BooleanQuery makeContextQuery​(String context)
                                                               throws IOException
        Throws:
        IOException
      • makeQuery

        public org.apache.lucene.search.Query makeQuery​(String[] allowedIDs,
                                                        org.apache.lucene.search.Query query)
                                                 throws IOException
        Throws:
        IOException
      • makeQuery

        public org.apache.lucene.search.BooleanQuery makeQuery​(String allowedID,
                                                               org.apache.lucene.search.BooleanQuery contextQuery)
                                                        throws IOException
        Parameters:
        allowedID - -- only one id is passed
        contextQuery - -- the context query
        Returns:
        BooleanQuery
        Throws:
        IOException
      • doSeparateDisambiguation

        public de.julielab.geneexpbase.candidateretrieval.SynHit doSeparateDisambiguation​(ArrayList<de.julielab.geneexpbase.candidateretrieval.SynHit> disambigList,
                                                                                          String context,
                                                                                          double minContextScore)
                                                                                   throws IOException
        does semantic disambiguation on each SynHit separately, takes best one if its semantic score is above or equals minScore threshold
        Throws:
        IOException
      • makeSeparateQuery

        public org.apache.lucene.search.BooleanQuery makeSeparateQuery​(String id,
                                                                       String context)
                                                                throws IOException
        generates a boolean query from the context and a single ids: the id has to match and the context is combined by OR.

        TODO requires testing!

        Throws:
        IOException
      • getSemanticIndexSearcher

        public org.apache.lucene.search.IndexSearcher getSemanticIndexSearcher()