Examples of similarity()


Examples of de.spinscale.elasticsearch.action.suggest.suggest.SuggestRequest.similarity()

            } else {
                suggestRequest.indexAnalyzer(XContentMapValues.nodeStringValue(parserMap.get("indexAnalyzer"), ""));
                suggestRequest.queryAnalyzer(XContentMapValues.nodeStringValue(parserMap.get("queryAnalyzer"), ""));
            }
            suggestRequest.term(XContentMapValues.nodeStringValue(parserMap.get("term"), ""));
            suggestRequest.similarity(XContentMapValues.nodeFloatValue(parserMap.get("similarity"), 1.0f));
            suggestRequest.size(XContentMapValues.nodeIntegerValue(parserMap.get("size"), 10));

            client.execute(SuggestAction.INSTANCE, suggestRequest, new RestToXContentListener<SuggestResponse>(channel));
        } catch (IOException e) {
            try {
View Full Code Here

Examples of de.spinscale.elasticsearch.action.suggest.suggest.SuggestRequest.similarity()

        if (suggestionQuery.size != null) {
            request.size(suggestionQuery.size);
        }
        if (suggestionQuery.similarity != null && suggestionQuery.similarity > 0.0 && suggestionQuery.similarity < 1.0) {
            request.similarity(suggestionQuery.similarity);
        }
        if (suggestionQuery.suggestType != null) {
            request.suggestType(suggestionQuery.suggestType);
        }
        if (Strings.hasLength(suggestionQuery.indexAnalyzer)) {
View Full Code Here

Examples of de.spinscale.elasticsearch.client.action.suggest.SuggestRequestBuilder.similarity()

        if (suggestionQuery.size != null) {
            builder.size(suggestionQuery.size);
        }
        if (suggestionQuery.similarity != null && suggestionQuery.similarity > 0.0 && suggestionQuery.similarity < 1.0) {
            builder.similarity(suggestionQuery.similarity);
        }
        if (suggestionQuery.suggestType != null) {
            builder.suggestType(suggestionQuery.suggestType);
        }
        if (Strings.hasLength(suggestionQuery.indexAnalyzer)) {
View Full Code Here

Examples of de.spinscale.elasticsearch.client.action.suggest.SuggestRequestBuilder.similarity()

        if (suggestionQuery.size != null) {
            builder.size(suggestionQuery.size);
        }
        if (suggestionQuery.similarity != null && suggestionQuery.similarity > 0.0 && suggestionQuery.similarity < 1.0) {
            builder.similarity(suggestionQuery.similarity);
        }
        if (suggestionQuery.suggestType != null) {
            builder.suggestType(suggestionQuery.suggestType);
        }
        if (Strings.hasLength(suggestionQuery.queryAnalyzer)) {
View Full Code Here

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

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

      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

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

          .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

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

      }
      // 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

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

    // 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

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

        .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.