Package de.julielab.genemapper
Class GeneMapper
- java.lang.Object
-
- de.julielab.genemapper.GeneMapper
-
public class GeneMapper extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPP_NAMEstatic booleanLEGACY_INDEX_SUPPORTstatic booleanTEST_MODE
-
Constructor Summary
Constructors Constructor Description GeneMapper(Configuration config, MappingCore mappingCore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearLexicalRankingModel()voidclearSemanticRankingModel()ConfigurationgetConfiguration()MappingCoregetMappingCore()de.julielab.geneexpbase.genemodel.DocumentMappingResultmap(de.julielab.geneexpbase.genemodel.GeneDocument document)de.julielab.geneexpbase.genemodel.DocumentMappingResultmap(de.julielab.geneexpbase.genemodel.GeneDocument doc, de.julielab.geneexpbase.configuration.Parameters parameterMap)de.julielab.geneexpbase.genemodel.DocumentMappingResultmap(de.julielab.geneexpbase.genemodel.GeneDocument document, de.julielab.geneexpbase.configuration.Parameters parameterMap, Stats stats)de.julielab.geneexpbase.genemodel.DocumentMappingResultmap(de.julielab.geneexpbase.genemodel.GeneDocument document, Stats stats)de.julielab.geneexpbase.genemodel.MentionMappingResultmap(de.julielab.geneexpbase.genemodel.GeneMention searchTerm, org.apache.lucene.search.BooleanQuery contextQuery, String documentContext)Actual mapping method.List<de.julielab.geneexpbase.candidateretrieval.SynHit>map(String searchTerm, org.apache.lucene.search.BooleanQuery contextQuery)A wrapper to the main mapping function.de.julielab.geneexpbase.genemodel.MentionMappingResultmap(String term, org.apache.lucene.search.BooleanQuery contextQuery, String documentContext)Convenience method mostly used for tests.ArrayList<de.julielab.geneexpbase.candidateretrieval.SynHit>mapTopN(String searchTerm, int topN)This mapping returns a list of SynHits.voidsetMappingCore(MappingCore mappingCore)
-
-
-
Field Detail
-
APP_NAME
public static final String APP_NAME
- See Also:
- Constant Field Values
-
LEGACY_INDEX_SUPPORT
public static final boolean LEGACY_INDEX_SUPPORT
- See Also:
- Constant Field Values
-
TEST_MODE
public static boolean TEST_MODE
-
-
Constructor Detail
-
GeneMapper
@Inject public GeneMapper(Configuration config, MappingCore mappingCore)
-
-
Method Detail
-
map
public List<de.julielab.geneexpbase.candidateretrieval.SynHit> map(String searchTerm, org.apache.lucene.search.BooleanQuery contextQuery) throws GeneMapperException
A wrapper to the main mapping function. This one does not require an organism to be specified and does thus completely organism-agnostic search (currently used basically for backward compatibility to BC evaluation).- Parameters:
searchTerm-contextQuery-- Returns:
- the SynHits that apply to the given searchTerm
- Throws:
ExceptionGeneMapperException
-
map
public de.julielab.geneexpbase.genemodel.MentionMappingResult map(de.julielab.geneexpbase.genemodel.GeneMention searchTerm, org.apache.lucene.search.BooleanQuery contextQuery, String documentContext) throws GeneMapperExceptionActual mapping method. This mapping functions has semantic disambiguation as well. First it checks for general, organism-specific hits (getCandidates). If organisms is given (i.e. is not null or not empty) semantic disambiguation is performed with this organism list.- Parameters:
searchTerm- the term to do the mapping forcontextQuery- the term's context (i.e. the document/abstract where it was found in)documentContext-- Returns:
- ArrayList with SynHits
- Throws:
ExceptionGeneMapperException
-
map
public de.julielab.geneexpbase.genemodel.DocumentMappingResult map(de.julielab.geneexpbase.genemodel.GeneDocument document) throws GeneMapperException- Throws:
GeneMapperException
-
mapTopN
public ArrayList<de.julielab.geneexpbase.candidateretrieval.SynHit> mapTopN(String searchTerm, int topN) throws IOException, de.julielab.geneexpbase.candidateretrieval.GeneCandidateRetrievalException
This mapping returns a list of SynHits. No semantic disambiguation is done here. TopN hits with the highest (lucene) scores are returned. Not needed for actual mapping but used for generating training material for MaxEntScorer.- Parameters:
searchTerm- the term to be mappedtopN- number of hits to be returned- Throws:
de.julielab.geneexpbase.candidateretrieval.GeneCandidateRetrievalExceptionIOException
-
getMappingCore
public MappingCore getMappingCore()
-
setMappingCore
public void setMappingCore(MappingCore mappingCore)
-
map
public de.julielab.geneexpbase.genemodel.MentionMappingResult map(String term, org.apache.lucene.search.BooleanQuery contextQuery, String documentContext) throws GeneMapperException
Convenience method mostly used for tests. The term will be wrapped into aGeneMention. However, no offset information or other data about the original gene mention will be known, of course.- Parameters:
term-contextQuery-documentContext-- Returns:
- Throws:
ExceptionGeneMapperException
-
getConfiguration
public Configuration getConfiguration()
-
map
public de.julielab.geneexpbase.genemodel.DocumentMappingResult map(de.julielab.geneexpbase.genemodel.GeneDocument document, Stats stats) throws GeneMapperException- Throws:
GeneMapperException
-
map
public de.julielab.geneexpbase.genemodel.DocumentMappingResult map(de.julielab.geneexpbase.genemodel.GeneDocument document, de.julielab.geneexpbase.configuration.Parameters parameterMap, Stats stats) throws GeneMapperException- Throws:
GeneMapperException
-
map
public de.julielab.geneexpbase.genemodel.DocumentMappingResult map(de.julielab.geneexpbase.genemodel.GeneDocument doc, de.julielab.geneexpbase.configuration.Parameters parameterMap) throws GeneMapperException- Throws:
GeneMapperException
-
clearLexicalRankingModel
public void clearLexicalRankingModel()
-
clearSemanticRankingModel
public void clearSemanticRankingModel()
-
-