Package edu.stanford.nlp.sempre.fbalignment.lexicons.LexicalEntry

Examples of edu.stanford.nlp.sempre.fbalignment.lexicons.LexicalEntry.EntityLexicalEntry


      String typesStr = entityTypesCache.get(id);
      if (typesStr != null) {
        for (String type : typesStr.split(","))
          types.add(type);
      }
      entities.add(new EntityLexicalEntry(query, query, Collections.singleton(e.name), new ValueFormula<NameValue>(new NameValue(id, e.name)), EntrySource.FBSEARCH, e.score, distance, types, tokenEditDistanceFeatures));
    }
    return entities;
  }
View Full Code Here


      int distance = editDistance(textDesc.toLowerCase(), fbDescriptions[0].toLowerCase());
      Counter<String> tokenEditDistanceFeatures = TokenLevelMatchFeatures.extractFeatures(textDesc, fbDescriptions[0]);

      if ((popularity > 0 || distance == 0) && TokenLevelMatchFeatures.diffSetSize(textDesc, fbDescriptions[0]) < 4) {

        res.add(new EntityLexicalEntry(textDesc, textDesc, ArrayUtils.asSet(fbDescriptions), formula, EntrySource.LUCENE, popularity, distance, types, tokenEditDistanceFeatures));
      }
    }
    Collections.sort(res, new LexicalEntryComparator());
    return res.subList(0, Math.min(res.size(), opts.maxEntries));
  }
View Full Code Here

  }

  private void joinEntityWithBinariesAndInject(LanguageInfo lInfo, List<FormulaGenerationInfo> res,
      boolean isCount, List<Pair<IntPair, EntityLexicalEntry>> entities, Pair<IntPair, EntityLexicalEntry> spanAndEntryPair)
          throws ParseException, IOException {
    EntityLexicalEntry entityEntry = spanAndEntryPair.getSecond();
    int binaryCounter=0;
    for(String type: entityEntry.types) {
      for(Formula binary: fbFormulasInfo.getBinariesForType2(type)) {

        BinaryFormulaInfo bInfo = fbFormulasInfo.getBinaryInfo(binary);
View Full Code Here

      }
      else {
        for(Pair<IntPair,EntityLexicalEntry> spanAndEntry: exampleEntityEntries) {
          if(ParaphraseUtils.intervalIntersect(spanAndEntry.getFirst(), excludedSpan))
            continue;
          EntityLexicalEntry entry = spanAndEntry.getSecond();
          if(spanAndEntry.getSecond().types.contains(exType)) {
            String entryDesc = entry.fbDescriptions.iterator().next();
            res.add(new EntityInfo(entryDesc, entry.formula, entry.popularity,spanAndEntry.getFirst()));
          }
        }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.sempre.fbalignment.lexicons.LexicalEntry.EntityLexicalEntry

Copyright © 2018 www.massapicom. 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.