Package com.clearnlp.dependency

Examples of com.clearnlp.dependency.DEPFeat


 
  public DEPTree getNullTree()
  {
    DEPTree tree = new DEPTree();
   
    DEPNode dummy = new DEPNode(1, "NULL", "NULL", "NULL", new DEPFeat());
    dummy.setHead(tree.get(0), "NULL");
   
    tree.add(dummy);
    tree.initXHeads();
    tree.initSHeads();
View Full Code Here


 
  private DEPTree getNullTree()
  {
    DEPTree tree = new DEPTree();
   
    DEPNode dummy = new DEPNode(1, "NULL", "NULL", "NULL", new DEPFeat());
    dummy.setHead(tree.get(0), "NULL");
   
    tree.add(dummy);
    tree.initXHeads();
    tree.initSHeads();
View Full Code Here

   */
  protected DEPTree getDEPTree(List<String[]> lines)
  {
    int id, headId, i, size = lines.size();
    String form, lemma, pos, deprel;
    DEPFeat feats;
    String[] tmp;
    DEPNode node;
   
    DEPTree tree = new DEPTree();
   
    // initialize place holders
    for (i=0; i<size; i++)
      tree.add(new DEPNode());
   
    for (i=0; i<size; i++)
    {
      tmp   = lines.get(i);
      id    = Integer.parseInt(tmp[i_id]);
      form  = tmp[i_form];
      lemma = tmp[i_lemma];
      pos   = tmp[i_pos];
      feats = new DEPFeat(tmp[i_feats]);
     
      node = tree.get(id);
      node.init(id, form, lemma, pos, feats);
         
      if (i_headId >= 0 && !tmp[i_headId].equals(AbstractColumnReader.BLANK_COLUMN))
View Full Code Here

 
  public void run(String goldFile, String autoFile, int goldIndex, int autoIndex, boolean bPred)
  {
    BufferedReader fGold = UTInput.createBufferedFileReader(goldFile);
    BufferedReader fAuto = UTInput.createBufferedFileReader(autoFile);
    DEPFeat gFeats, aFeats;
    int[] counts = {0,0,0}// correct, gold total, auto total
    String[] gold, auto;
    String gPred, aPred;
    String line;
   
    try
    {
      while ((line = fGold.readLine()) != null)
      {
        gold = line.split(AbstractColumnReader.DELIM_COLUMN);
        auto = fAuto.readLine().split(AbstractColumnReader.DELIM_COLUMN);
       
        line = line.trim();
        if (line.isEmpty())   continue;
       
        gFeats = new DEPFeat(gold[goldIndex]);
        aFeats = new DEPFeat(auto[autoIndex]);
       
        if (bPred)
        {
          if ((gPred = gFeats.get(DEPLib.FEAT_PB)) != null)
            counts[1]++;
         
          if ((aPred = aFeats.get(DEPLib.FEAT_PB)) != null)
            counts[2]++;
         
          if (gPred != null && aPred != null)
            counts[0]++; 
        }
        else
        {
          if ((gPred = gFeats.get(DEPLib.FEAT_PB)) != null)
          {
            aPred = aFeats.get(DEPLib.FEAT_PB);
            counts[1]++;
            counts[2]++;
           
View Full Code Here

 
  public void run(String goldFile, String autoFile, int goldIndex, int autoIndex)
  {
    BufferedReader fGold = UTInput.createBufferedFileReader(goldFile);
    BufferedReader fAuto = UTInput.createBufferedFileReader(autoFile);
    DEPFeat gFeats, aFeats;
    int[] counts = {0,0}// correct, total
    String[] gold, auto;
    String gPred, aPred;
    String line;
   
    try
    {
      while ((line = fGold.readLine()) != null)
      {
        gold = line.split(AbstractColumnReader.DELIM_COLUMN);
        auto = fAuto.readLine().split(AbstractColumnReader.DELIM_COLUMN);
       
        line = line.trim();
        if (line.isEmpty())   continue;
       
        gFeats = new DEPFeat(gold[goldIndex]);
        aFeats = new DEPFeat(auto[autoIndex]);
       
        gPred = gFeats.get(DEPLib.FEAT_PB);
        aPred = aFeats.get(DEPLib.FEAT_PB);
       
        if (gPred != null)
        {
          counts[0]++;
View Full Code Here

    Map<String,Set<String>> mSub = new HashMap<String,Set<String>>();
    Pattern delim = Pattern.compile("\t");
    String line, roleset, vncls;
    BufferedReader fin;
    Set<String> sVN;
    DEPFeat feat;
    String[] l;
   
    for (String filename : UTFile.getInputFileList(inputDir, ".pmd"))
    {
      fin = UTInput.createBufferedFileReader(filename);
     
      while ((line = fin.readLine()) != null)
      {
        line = line.trim();
       
        if (line.isEmpty())
        {
         
        }
        else
        {
          l = delim.split(line);
          feat = new DEPFeat(l[6]);
          roleset = feat.get(DEPLib.FEAT_PB);
          vncls = feat.get(DEPLib.FEAT_VN);
         
          if (roleset != null && vncls != null)
          {
            sVN = pvMap.getVNSet(roleset);
           
View Full Code Here

TOP

Related Classes of com.clearnlp.dependency.DEPFeat

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.