Package com.clearnlp.propbank.verbnet

Examples of com.clearnlp.propbank.verbnet.PVRoleset


 
  static public void addVerbNet(PVMap map, DEPTree tree)
  {
    int i, size = tree.size();
    PVRoleset[] pvRolesets = new PVRoleset[size];
    PVRoleset pvRoleset;
    List<String> vnclss;
    String rolesetId;
    PVRole pvRole;
    DEPNode node;
    String n;
   
    for (i=1; i<size; i++)
    {
      node = tree.get(i);
      rolesetId = node.getFeat(DEPLib.FEAT_PB);
     
      if (rolesetId != null)
      {
        if ((pvRoleset = map.getRoleset(rolesetId)) != null)
        {
          vnclss = new ArrayList<String>(pvRoleset.keySet());
          Collections.sort(vnclss);
          node.addFeat(DEPLib.FEAT_VN, UTCollection.toString(vnclss, DEPFeat.DELIM_VALUES));
        }
       
        pvRolesets[i] = pvRoleset;
      }
    }
   
    for (i=1; i<size; i++)
      for (DEPArc arc : tree.get(i).getSHeads())
        if ((pvRoleset = pvRolesets[arc.getNode().id]) != null)
          if (PTNumber.containsOnlyDigits(n = arc.getLabel().substring(1, 2)))
          {
            vnclss = new ArrayList<String>(pvRoleset.keySet());
            Collections.sort(vnclss);
           
            for (String vncls : vnclss)
              if ((pvRole = pvRoleset.get(vncls).getRole(n)) != null)
                arc.appendLabel(pvRole.vntheta);
          }
  }
View Full Code Here


  {
    List<PBInstance> pbList = PBLib.getPBInstanceList(ontoPBFile, ontoDir, false);
    Map<String,String> semMap = getSemlinkMap(ontoDir, semDir, semVNFile);
    PVMap pvMap = new PVMap(new FileInputStream(pvMapFile));
    int mono = 0, poly = 0, subcls = 0, supcls = 0, none = 0, skip = 0;
    PVRoleset pvRoleset;
    PVRoles   pvRoles;
    String    vncls;
   
    for (PBInstance inst : pbList)
    {
      pvRoleset = pvMap.getRoleset(inst.roleset);
          
      if (pvRoleset != null)
      {
        pvRoles = null;
       
        if (pvRoleset.size() == 1)
        {
          pvRoles = pvRoleset.getSubVNRoles("");
          inst.annotator = "mono";
          mono++;
        }
        else
        {
          vncls = semMap.get(getKey(inst.treePath, inst.treeId, inst.predId));

          if (vncls != null)
          {
            if ((pvRoles = pvRoleset.get(vncls)) != null)
            {
              inst.annotator = "poly";
              poly++;
            }
            else if ((pvRoles = pvRoleset.getSubVNRoles(vncls)) != null)
            {
              inst.annotator = "subcls";
              subcls++;
            }
            else if ((pvRoles = pvRoleset.getSuperVNRoles(vncls)) != null)
            {
              inst.annotator = "supcls";
              supcls++;
            }
          }
View Full Code Here

  }
 
  public Set<String> getRSet(PVMap pvMap, Set<String> prev)
  {
    Set<String> sVncls, sVerb, curr = new HashSet<String>();
    PVRoleset   pvRoleset;
    PVVerb      pvVerb;
   
    int[] count = new int[5];
    int total = 0, c;
   
    for (String verb : pvMap.keySet())
    {
      pvVerb = pvMap.get(verb);
       sVerb = pvVerb.keySet();
      total += sVerb.size();
     
      for (String roleset : sVerb)
      {
        pvRoleset = pvVerb.get(roleset);
        sVncls = new HashSet<String>(pvRoleset.keySet());
        c = sVncls.size();
        sVncls.removeAll(prev);
       
        if (sVncls.isEmpty())  c = 1;
        else if (c > 5)      c = 5;
View Full Code Here

  }
 
  public Set<String> getVSet(PVMap pvMap, Set<String> prev)
  {
    Set<String> sVncls, sVerb, curr = new HashSet<String>();
    PVRoleset   pvRoleset;
    PVVerb      pvVerb;
   
    int[] count = new int[5];
    int total = 0, c;
   
    for (String verb : pvMap.keySet())
    {
      pvVerb = pvMap.get(verb);
       sVerb = pvVerb.keySet();
      sVncls = new HashSet<String>();
      total++;
     
      for (String roleset : sVerb)
      {
        pvRoleset = pvVerb.get(roleset);
        sVncls.addAll(pvRoleset.keySet());
      }
     
      c = sVncls.size();
      sVncls.removeAll(prev);
     
View Full Code Here

TOP

Related Classes of com.clearnlp.propbank.verbnet.PVRoleset

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.