Package org.apache.ctakes.ytex.kernel.metric

Examples of org.apache.ctakes.ytex.kernel.metric.ConceptSimilarityService.similarity()


      return null;
    List<SimilarityMetricEnum> metricList = this
        .metricArrayToList(metrics.split(","));
    if (metricList.size() == 0)
      return null;
    return s.similarity(metricList, concept1, concept2, null,
        "true".equalsIgnoreCase(lcs));
  }

  private ConceptSimilarityService getConceptSimilarityService(
      String conceptGraph) {
View Full Code Here


      ConceptPair[] conceptPairs, String[] metrics, boolean lcs) {
    ConceptSimilarityService s = this
        .getConceptSimilarityService(conceptGraph);
    List<SimilarityMetricEnum> metricList = metricArrayToList(metrics);
    List<ConceptPair> conceptPairList = Arrays.asList(conceptPairs);
    return s.similarity(conceptPairList, metricList, null, lcs);
  }

  private List<SimilarityMetricEnum> metricArrayToList(String[] metrics) {
    List<SimilarityMetricEnum> metricIndexMap = new ArrayList<SimilarityMetricEnum>();
    for (String metric : metrics) {
View Full Code Here

          .getSemanticSimServiceMap().get(conceptGraphName)
          .getConceptSimilarityService();
      ConceptSearchService searchSvc = this.getSemanticSimRegistryBean()
          .getSemanticSimServiceMap().get(conceptGraphName)
          .getConceptSearchService();
      ConceptPairSimilarity csim = simSvc.similarity(metrics, concept1
          .getSearchCUI().getConceptId(), concept2.getSearchCUI()
          .getConceptId(), null, true);
      this.simInfo = csim.getSimilarityInfo();
      this.similarityMap = toSimMap(csim);
      lcsPathMap.clear();
View Full Code Here

      }
      // calculate sim
      ConceptSimilarityService simSvc = this.getSemanticSimRegistryBean()
          .getSemanticSimServiceMap().get(conceptGraphName)
          .getConceptSimilarityService();
      List<ConceptPairSimilarity> similarities = simSvc.similarity(
          conceptPairs, metrics, null, false);
      // load list with results
      for (int i = 0; i < conceptPairs.size(); i++) {
        SimilarityEntry e = new SimilarityEntry();
        e.setConceptPair(conceptPairs.get(i));
View Full Code Here

    // ConceptSimilarityService simSvc = appCtxSim
    // .getBean(ConceptSimilarityService.class);
    ConceptSimilarityService simSvc = SimSvcContextHolder
        .getApplicationContext()
        .getBean(ConceptSimilarityService.class);
    ConceptPairSimilarity simDogCat = simSvc.similarity(
        Arrays.asList(SimilarityMetricEnum.PATH,
            SimilarityMetricEnum.INTRINSIC_PATH), "dog", "cat",
        null, false);
    ConceptPairSimilarity simDogEColi = simSvc.similarity(
        Arrays.asList(SimilarityMetricEnum.PATH,
View Full Code Here

        .getBean(ConceptSimilarityService.class);
    ConceptPairSimilarity simDogCat = simSvc.similarity(
        Arrays.asList(SimilarityMetricEnum.PATH,
            SimilarityMetricEnum.INTRINSIC_PATH), "dog", "cat",
        null, false);
    ConceptPairSimilarity simDogEColi = simSvc.similarity(
        Arrays.asList(SimilarityMetricEnum.PATH,
            SimilarityMetricEnum.INTRINSIC_PATH), "dog", "e coli",
        null, false);
    Assert.isTrue(simDogCat.getSimilarities().get(0) > simDogEColi
        .getSimilarities().get(0));
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.