Package opennlp.ccg.hylo

Examples of opennlp.ccg.hylo.Nominal


          String predInfo = null;
          if (cat.getLF() != null) {
        // convert LF
        LF flatLF = cat.getLF();
        cat = cat.copy();
        Nominal index = cat.getIndexNominal();
        convertedLF = HyloHelper.compactAndConvertNominals(flatLF, index, thisParse);
        // get pred info
        predInfoMap.clear();
        Testbed.extractPredInfo(flatLF, predInfoMap);
        predInfo = Testbed.getPredInfo(predInfoMap);
View Full Code Here


        f.addFeatureWithProb("PT", pospair.a, pospair.b);
        n.setPOS(pospair.a); // take the top choice to be "the pos tag", used later for prior
      }
    }
    // class name feature for node, if available
    Nominal idx = n.getPred().getNominal();
    String cls = idx.toString();
    // string is in X:Y:Z format. Remove 'X:' leaving 'Y:Z'.
    if(cls != null && cls.indexOf(':') > 0) {
      String cfeat = cls.substring(cls.indexOf(':') + 1);
      f.addFeatureWithProb("XC", cfeat);
    }
View Full Code Here

      }
    }
   
    for(SatOp so : satOps) { // second pass adds edges and attributes, sets highest parent (if any)
      if(isElementaryPredication(so)) {
        Nominal soNom = so.getNominal();
        LFVertex source = g.findVertexByNominal(soNom);
       
        // check if node is not yet added (not a lex. pred.)
        if(source == null) {
          source = new LFVertex(soNom);
          g.addVertex(source);
        }
       
        if(isLexPred(so)) {
          Nominal parent = ancestorMap.get(source.nominal);
          if(parent != null) {
            g.highestAncestorMap.put(source, g.findVertexByNominal(parent));
          }
        }
        else if(isRelPred(so)) {
          Diamond d = (Diamond)so.getArg();
         
          Nominal dArg = (Nominal)d.getArg();
          LFVertex target = g.findVertexByNominal(dArg);
         
          if(target == null) {
            target = new LFVertex(dArg);
            g.addVertex(target);
View Full Code Here

     */
    public Pair<Sign,Boolean> oracleBest(LF goldLF) {
      Sign retval = null; double bestF = 0.0;
      for (Sign sign : result) {
            Category cat = sign.getCategory().copy();
            Nominal index = cat.getIndexNominal();
            LF parsedLF = cat.getLF();
            if (parsedLF != null) {
              index = HyloHelper.convertNominals(parsedLF, sign, index);
          EPsScorer.Results score = EPsScorer.score(parsedLF, goldLF);
          if (score.fscore > bestF) {
View Full Code Here

        }
      }
    }
    feats.addFeature("NA", Integer.toString(argchildren));
    // class name feature, if available
    Nominal idx = n.getPred().getNominal();
    String cls = idx.toString();
    // string is in X:Y:Z format. Remove 'X:' leaving 'Y:Z'.
    if(cls.indexOf(':') > 0) {
      String cfeat = cls.substring(cls.indexOf(':') + 1);
      feats.addFeature("XC", cfeat);
    }
View Full Code Here

TOP

Related Classes of opennlp.ccg.hylo.Nominal

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.