Package edu.stanford.nlp.dcoref

Examples of edu.stanford.nlp.dcoref.CorefChain


    pw.println(chains.size());

    // save each cluster
    for(Integer cid: chains.keySet()) {
      // cluster id + how many mentions in the cluster
      CorefChain cluster = chains.get(cid);
      saveCorefChain(pw, cid, cluster);
    }

    // an empty line at end
    pw.println();
View Full Code Here


        }
        mentionsWithThisHead.add(mention);
        if(rep) representative = mention;
      }
      // construct the cluster
      CorefChain chain = new CorefChain(cid, mentionMap, representative);
      chains.put(cid, chain);
    }
    reader.readLine();
    return chains;
  }
View Full Code Here

    }

    // Set coref chain
    Map<Integer, CorefChain> corefChains = new HashMap<Integer, CorefChain>();
    for (CoreNLPProtos.CorefChain chainProto : proto.getCorefChainList()) {
      CorefChain chain = fromProto(chainProto, ann);
      corefChains.put(chain.getChainID(), chain);
    }
    if (!corefChains.isEmpty()) { ann.set(CorefChainAnnotation.class, corefChains); }

    // Set dependency graphs
    // We need to wait until here, since this is the first time we see tokens
View Full Code Here

      if (proto.hasRepresentative() && i == proto.getRepresentative()) {
        representative = mention;
      }
    }
    // Return
    return new CorefChain(cid, mentions, representative);
  }
View Full Code Here

    Map<Integer, CorefChain> corefChains = document.get(CorefCoreAnnotations.CorefChainAnnotation.class);
    Assert.assertNotNull(corefChains);

    // test chainID = m.corefClusterID
    for(int chainID : corefChains.keySet()) {
      CorefChain c = corefChains.get(chainID);
      for(CorefMention m : c.getMentionsInTextualOrder()) {
        Assert.assertEquals(m.corefClusterID, chainID);
      }
    }

    // test CorefClusterIdAnnotation
View Full Code Here

    //      System.out.println("pair " + pair);
    //    }

    // test chainID = m.corefClusterID
    for(int chainID : chains.keySet()) {
      CorefChain c = chains.get(chainID);
      for(CorefMention m : c.getMentionsInTextualOrder()) {
        Assert.assertEquals(m.corefClusterID, chainID);
      }
    }

    // test CorefClusterIdAnnotation
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.dcoref.CorefChain

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.