Commit 4b057a85 authored by Christos Christodoulopoulos's avatar Christos Christodoulopoulos
Browse files

Added extra predicate roles

 - YY, ER, LV, IE
Added alias info
parent 420178d6
package jubilee.propbank;
/**
* PBAlias contains 'framenet', 'verbnet', 'pos' and the 'alias' itself
*/
public class PBAlias {
//TODO How should 'framenet' and 'verbnet' attributes be represented?
private String framenet, verbnet, pos, alias;
public PBAlias(String framenet, String verbnet, String pos, String alias) {
this.framenet = framenet;
this.verbnet = verbnet;
this.pos = pos;
this.alias = alias;
}
public String toString() {
return pos + "-alias: " + alias;
}
}
......@@ -75,6 +75,18 @@ public class PBFramesetReader {
PBRoleset roleset = new PBRoleset();
roleset.setId(emRoleset.getAttribute("id"));
roleset.setName(emRoleset.getAttribute("name"));
NodeList ndAlias = emRoleset.getElementsByTagName("alias");
for (int k=0; k<ndAlias.getLength(); k++) {
Element emAlias = (Element)ndAlias.item(k);
String framenet = emAlias.getAttribute("framenet");
String verbnet = emAlias.getAttribute("verbnet");
String pos = emAlias.getAttribute("pos");
String aliasStr = emAlias.getTextContent().trim();
PBAlias alias = new PBAlias(framenet, verbnet, pos, aliasStr);
roleset.addAlias(alias);
}
NodeList ndComment = emRoleset.getElementsByTagName("note");
String comment = "";
......
......@@ -36,12 +36,14 @@ import java.util.*;
public class PBRoleset {
private String id, name;
private String comment;
private Vector<PBAlias> aliases;
private Vector<PBRole> roles;
private Vector<PBExample> examples;
public PBRoleset() {
roles = new Vector<PBRole>();
examples = new Vector<PBExample>();
aliases = new Vector<PBAlias>();
}
/**
......@@ -68,6 +70,19 @@ public class PBRoleset {
return str.trim();
}
/**
* Get all aliases.
* @return all aliases.
*/
public String getAliases() {
if (aliases.isEmpty()) return "";
String str = "";
for (PBAlias alias : aliases) str += alias + "\n";
str += "---------------------\n";
return str;
}
/**
* Set ID of the roleset.
......@@ -103,17 +118,26 @@ public class PBRoleset {
/**
* Adds an example to the roleset.
* @param example the example to be added.
* @param example the example to be added.
*/
public void addExample(PBExample example) {
examples.add(example);
}
/**
* Adds an alias to the roleset.
* @param alias the alias to be added.
*/
public void addAlias(PBAlias alias) {
aliases.add(alias);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
String str = "ID : " + id + "\nName : " + name;
String str = getAliases();
str += "ID : " + id + "\nName : " + name;
for (PBRole role : roles) str += "\n" + role;
return str;
......
......@@ -134,7 +134,8 @@ public class JBFramesetPanel extends JPanel implements ActionListener, ItemListe
public void itemStateChanged(ItemEvent e) {
if (cb_roleset.getSelectedIndex() < 0) return;
if (cb_roleset.getSelectedIndex() != 0 && cb_roleset.getSelectedIndex() < cb_roleset.getItemCount()) {
// We have frameset information for cb_roleset items [1, N-4] (since we have four "null" elements)
if (cb_roleset.getSelectedIndex() != 0 && cb_roleset.getSelectedIndex() < cb_roleset.getItemCount() - 4) {
PBPredicate predicate = frameset.getPredicate(getPredicateNum());
PBRoleset roleset = predicate.getRoleset(getRolesetNum());
......@@ -192,6 +193,10 @@ public class JBFramesetPanel extends JPanel implements ActionListener, ItemListe
vec_pNum.add(i); vec_cNum.add(j);
}
}
cb_roleset.insertItemAt(lemma+".YY", k++);
cb_roleset.insertItemAt(lemma+".ER", k++);
cb_roleset.insertItemAt(lemma+".LV", k++);
cb_roleset.insertItemAt(lemma+".IE", k);
int index = getItemIndex(roleset);
if (index != -1) cb_roleset.setSelectedIndex(index);
......@@ -210,8 +215,7 @@ public class JBFramesetPanel extends JPanel implements ActionListener, ItemListe
return -1;
}
private int getPredicateNum()
{
private int getPredicateNum() {
return vec_pNum.get(cb_roleset.getSelectedIndex()-1);
}
......
  • For clarification the new predicate roles are:

    • .ER means there is a Treebank error. Originally, these were sent back to be re-treed but I think we've stopped doing that. It means that the tree error makes annotation impossible though so these can be pulled out prior to data releases.
    • .LV is used to mark the roleset during the verb pass in a light verb construction. For example, in 'make a speech', when annotating 'make' we would mark the frame as .LV. In post-processing, this would be pulled and sandwhiched with 'speech'. The frame for speech would be the correct, shared roleset.
    • .NN isn't used. It appeared when .YY did. We've used it to mark special cases in the short term once or twice but it has no long standing meaning.
    • .IE means idiomatic expression. If you had 'kick the bucket' where the meaning was so bleached that you couldn't possibly annotate with a 'kicked him in the shins' type frame and there wasn't actually a sense of the word meaning 'to die' except in this construction, the .IE role is used. This is VERY rarely needed.
    • .YY is used for non-eventive nouns and non-head nouns. I think the original plan for .NN was to use .YY for non-head and .NN for non-eventive but there wasn't much reason to separate them. Neither non-eventive nor non-head nouns are annotated.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment