public class ConceptSimilarityServiceImpl extends Object implements ConceptSimilarityService
ConceptSimilarityService.SimilarityMetricEnum
Constructor and Description |
---|
ConceptSimilarityServiceImpl() |
Modifier and Type | Method and Description |
---|---|
Object[] |
getBestLCS(Set<String> lcses,
boolean intrinsicIC,
Map<String,Double> conceptFilter)
get the best lcs
|
Object[] |
getBestLCS(Set<String> lcses,
Map<String,Double> icMap) |
net.sf.ehcache.CacheManager |
getCacheManager() |
ClassifierEvaluationDao |
getClassifierEvaluationDao() |
ConceptDao |
getConceptDao() |
ConceptGraph |
getConceptGraph() |
String |
getConceptGraphName() |
String |
getConceptSetName() |
String |
getCorpusName() |
Map<String,BitSet> |
getCuiTuiMap()
cui - tui map.
|
int |
getDepth(String concept) |
double |
getIC(String concept,
boolean intrinsicICMap) |
int |
getLCS(String concept1,
String concept2,
Set<String> lcses,
List<LCSPath> lcsPaths)
get the lcs(s) for the specified concepts
|
net.sf.ehcache.Cache |
getLcsCache() |
String |
getLcsImputedType() |
PageRankService |
getPageRankService() |
Map<ConceptSimilarityService.SimilarityMetricEnum,SimilarityMetric> |
getSimilarityMetricMap() |
org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
List<String> |
getTuiList()
list of tuis that corresponds to bitset indices
|
void |
init() |
void |
initCuiTuiMapFromCorpus()
load cui-tui for the specified corpus from the MRSTY table
|
boolean |
isPreload() |
int |
lcs(String concept1,
String concept2,
List<LCSPath> lcsPaths) |
double |
loadConceptFilter(String label,
int rankCutoff,
Map<String,Double> conceptFilter)
For the given label and cutoff, get the corresponding concepts whose
propagated ig meets the threshold.
|
static void |
main(String[] args) |
void |
setCacheManager(net.sf.ehcache.CacheManager cacheManager) |
void |
setClassifierEvaluationDao(ClassifierEvaluationDao classifierEvaluationDao) |
void |
setConceptDao(ConceptDao conceptDao) |
void |
setConceptGraphName(String conceptGraphName) |
void |
setConceptSetName(String conceptSetName) |
void |
setCorpusName(String corpusName) |
void |
setLcsCache(net.sf.ehcache.Cache lcsCache) |
void |
setLcsImputedType(String lcsImputedType) |
void |
setPageRankService(PageRankService pageRankService) |
void |
setPreload(boolean preload) |
void |
setSimilarityMetricMap(Map<ConceptSimilarityService.SimilarityMetricEnum,SimilarityMetric> similarityMetricMap) |
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) |
List<ConceptPairSimilarity> |
similarity(List<ConceptPair> conceptPairs,
List<ConceptSimilarityService.SimilarityMetricEnum> metrics,
Map<String,Double> conceptFilter,
boolean lcs)
compute similarity for a list of concept pairs
|
ConceptPairSimilarity |
similarity(List<ConceptSimilarityService.SimilarityMetricEnum> metrics,
String concept1,
String concept2,
Map<String,Double> conceptFilter,
boolean lcs)
compute similarity for a pair of concepts
|
public static void main(String[] args) throws IOException
IOException
public Object[] getBestLCS(Set<String> lcses, boolean intrinsicIC, Map<String,Double> conceptFilter)
ConceptSimilarityService
getBestLCS
in interface ConceptSimilarityService
lcses
- set of lcsesintrinsicIC
- should the intrinsic ic be used? false - use corpus-based ic.
For multiple lcses not using concept filter, use the lcs with
the lowest infocontentconceptFilter
- limit to lcses in the concept filter. The lcs with the highest
value will be used.public net.sf.ehcache.CacheManager getCacheManager()
public ClassifierEvaluationDao getClassifierEvaluationDao()
public ConceptDao getConceptDao()
public ConceptGraph getConceptGraph()
getConceptGraph
in interface ConceptSimilarityService
public String getConceptGraphName()
getConceptGraphName
in interface ConceptSimilarityService
public String getConceptSetName()
public String getCorpusName()
public Map<String,BitSet> getCuiTuiMap()
ConceptSimilarityService
ConceptSimilarityService.getTuiList()
getCuiTuiMap
in interface ConceptSimilarityService
public int getDepth(String concept)
getDepth
in interface ConceptSimilarityService
public double getIC(String concept, boolean intrinsicICMap)
getIC
in interface ConceptSimilarityService
public int getLCS(String concept1, String concept2, Set<String> lcses, List<LCSPath> lcsPaths)
ConceptSimilarityService
getLCS
in interface ConceptSimilarityService
concept1
- requiredconcept2
- requiredlcses
- required - will be filled with the lcs(s).public net.sf.ehcache.Cache getLcsCache()
public String getLcsImputedType()
public PageRankService getPageRankService()
public Map<ConceptSimilarityService.SimilarityMetricEnum,SimilarityMetric> getSimilarityMetricMap()
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
public List<String> getTuiList()
ConceptSimilarityService
getTuiList
in interface ConceptSimilarityService
public void init()
public void initCuiTuiMapFromCorpus()
public boolean isPreload()
public int lcs(String concept1, String concept2, List<LCSPath> lcsPaths)
lcs
in interface ConceptSimilarityService
public double loadConceptFilter(String label, int rankCutoff, Map<String,Double> conceptFilter)
loadConceptFilter
in interface ConceptSimilarityService
label
- labelrankCutoff
- cutoffconceptFilter
- set to fill with conceptspublic void setCacheManager(net.sf.ehcache.CacheManager cacheManager)
public void setClassifierEvaluationDao(ClassifierEvaluationDao classifierEvaluationDao)
public void setConceptDao(ConceptDao conceptDao)
public void setConceptGraphName(String conceptGraphName)
public void setConceptSetName(String conceptSetName)
public void setCorpusName(String corpusName)
public void setLcsCache(net.sf.ehcache.Cache lcsCache)
public void setLcsImputedType(String lcsImputedType)
public void setPageRankService(PageRankService pageRankService)
public void setPreload(boolean preload)
public void setSimilarityMetricMap(Map<ConceptSimilarityService.SimilarityMetricEnum,SimilarityMetric> similarityMetricMap)
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
public List<ConceptPairSimilarity> similarity(List<ConceptPair> conceptPairs, List<ConceptSimilarityService.SimilarityMetricEnum> metrics, Map<String,Double> conceptFilter, boolean lcs)
ConceptSimilarityService
similarity
in interface ConceptSimilarityService
conceptPairs
- required, concept pairs for which similarity should be
computedmetrics
- required, similarity metrics to computeconceptFilter
- optional - only lcs's in this set will be used.public ConceptPairSimilarity similarity(List<ConceptSimilarityService.SimilarityMetricEnum> metrics, String concept1, String concept2, Map<String,Double> conceptFilter, boolean lcs)
ConceptSimilarityService
similarity
in interface ConceptSimilarityService
metrics
- required, similarity metrics to computeconcept1
- requiredconcept2
- requiredconceptFilter
- optional - only lcs's in this set will be used.Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.