Commit 8aeef45a authored by Shyam Upadhyay's avatar Shyam Upadhyay
Browse files

viewname

parent 126a1a71
......@@ -15,6 +15,7 @@ public class VoiceClauseHeuristic extends Heuristic {
String voice = TAUtils.voiceFeat(ee.pred_srl).getName();
String clause =TAUtils.getClauseNature(ee.pred_srl);
String lemma = TAUtils.getLemma(ee.pred_srl);
System.out.println(ee.pred_srl.getViewName());
boolean isFirst=isFirstPredicateInList(ee,others);
if(voice.equals("A"))
{
......
......@@ -40,17 +40,17 @@ public class FramenetExtractor {
PredicateArgumentView srlverb = (PredicateArgumentView) ta.getView(ViewNames.SRL_VERB);
PredicateArgumentView srlnom = (PredicateArgumentView) ta.getView(ViewNames.SRL_NOM);
if(srlverb!=null) {
for (Constituent tok : srlverb.getConstituents()) {
if (!tok.getLabel().equals("Predicate"))
for (Constituent cons : srlverb.getConstituents()) {
if (!cons.getLabel().equals("Predicate"))
continue;
String lemma = TAUtils.getLemma(tok);
String lemma = TAUtils.getLemma(cons);
// exclude "be" predicates
if (lemma.equals("be")) {
continue;
}
String frame = TAUtils.getFrame(tok);
String frame = TAUtils.getFrame(cons);
if (acceptableFrames.contains(frame)) {
events.add(new EventInstance(tok, frame));
events.add(new EventInstance(cons, frame));
}
}
}
......@@ -59,12 +59,12 @@ public class FramenetExtractor {
System.out.println("srl verb is null");
}
if(srlnom!=null) {
for (Constituent tok : srlnom.getConstituents()) {
if (!tok.getLabel().equals("Predicate"))
for (Constituent cons : srlnom.getConstituents()) {
if (!cons.getLabel().equals("Predicate"))
continue;
String frame = TAUtils.getFrame(tok);
String frame = TAUtils.getFrame(cons);
if (acceptableFrames.contains(frame)) {
events.add(new EventInstance(tok, frame));
events.add(new EventInstance(cons, frame));
}
}
}
......
......@@ -9,8 +9,8 @@ import edu.illinois.cs.cogcomp.core.datastructures.textannotation.*;
import edu.illinois.cs.cogcomp.edison.features.Feature;
import edu.illinois.cs.cogcomp.edison.features.factory.VerbVoiceIndicator;
import edu.illinois.cs.cogcomp.edison.utilities.EdisonException;
import edu.illinois.cs.cogcomp.esrl.specificity.Main;
import edu.illinois.cs.cogcomp.esrl.specificity.lbjava.SpecificityClassifier;
//import edu.illinois.cs.cogcomp.esrl.specificity.Main;
//import edu.illinois.cs.cogcomp.esrl.specificity.lbjava.SpecificityClassifier;
import edu.illinois.cs.cogcomp.nytlabs.corpus.MyCuratorClient;
import edu.illinois.cs.cogcomp.nytlabs.corpus.annotation.AnnotatedDocument;
import edu.illinois.cs.cogcomp.readers.LazyNYTReader;
......@@ -291,36 +291,36 @@ public class TAUtils {
public static void main(String[] args) throws Exception {
// SpecificityClassifier classifier = new SpecificityClassifier("/home/upadhya3/SpecificityClassifier.lc","/home/upadhya3/SpecificityClassifier.lex");
SpecificityClassifier classifier = new SpecificityClassifier();
List<String> docids = new ArrayList<>();
boolean alreadyCached = true;
// docids.add("1453341");
docids.add("1453356");
// docids.add("1453508");
MyCuratorClient cc = new MyCuratorClient(alreadyCached);
LazyNYTReader reader = new LazyNYTReader(cc, alreadyCached, docids);
AnnotatedDocument doc = reader.next();
TextAnnotation ta = doc.getAbsTA();
PredicateArgumentView verb = (PredicateArgumentView) ta.getView(ViewNames.SRL_VERB);
PredicateArgumentView nom = (PredicateArgumentView) ta.getView(ViewNames.SRL_NOM);
PredicateArgumentView com = (PredicateArgumentView) ta.getView("SRL_COMMA");
System.out.println(verb.getPredicates());
System.out.println(nom.getPredicates());
for(Constituent cons:com.getPredicates())
{
System.out.println(cons+" "+cons.getLabel());
for(Relation rel: cons.getOutgoingRelations())
System.out.println(rel.getTarget()+" "+rel.getTarget().getLabel());
classifier.discreteValue(cons);
System.out.println("--------");
}
for(Constituent cons:verb.getPredicates())
{
System.out.println(cons+" "+TAUtils.isInAppositive(cons));
}
System.exit(-1);
// SpecificityClassifier classifier = new SpecificityClassifier();
// List<String> docids = new ArrayList<>();
// boolean alreadyCached = true;
//// docids.add("1453341");
// docids.add("1453356");
//// docids.add("1453508");
// MyCuratorClient cc = new MyCuratorClient(alreadyCached);
// LazyNYTReader reader = new LazyNYTReader(cc, alreadyCached, docids);
// AnnotatedDocument doc = reader.next();
// TextAnnotation ta = doc.getAbsTA();
// PredicateArgumentView verb = (PredicateArgumentView) ta.getView(ViewNames.SRL_VERB);
// PredicateArgumentView nom = (PredicateArgumentView) ta.getView(ViewNames.SRL_NOM);
// PredicateArgumentView com = (PredicateArgumentView) ta.getView("SRL_COMMA");
//
// System.out.println(verb.getPredicates());
// System.out.println(nom.getPredicates());
//
// for(Constituent cons:com.getPredicates())
// {
// System.out.println(cons+" "+cons.getLabel());
// for(Relation rel: cons.getOutgoingRelations())
// System.out.println(rel.getTarget()+" "+rel.getTarget().getLabel());
// classifier.discreteValue(cons);
// System.out.println("--------");
// }
// for(Constituent cons:verb.getPredicates())
// {
// System.out.println(cons+" "+TAUtils.isInAppositive(cons));
// }
// System.exit(-1);
}
......
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