Search in sources :

Example 1 with SentenceInstance

use of edu.illinois.cs.cogcomp.verbsense.jlis.SentenceInstance in project cogcomp-nlp by CogComp.

the class SenseExampleGenerator method getExamples.

public Pair<SentenceInstance, SentenceStructure> getExamples(TextAnnotation ta) throws Exception {
    List<SenseInstance> predicates = new ArrayList<>();
    List<SenseStructure> structures = new ArrayList<>();
    if (ta.hasView(SenseManager.getGoldViewName()))
        getTreebankExamples(ta, predicates, structures);
    else
        getExamples(ta, predicates);
    SentenceInstance sx = new SentenceInstance(predicates);
    SentenceStructure sy = new SentenceStructure(sx, structures);
    return new Pair<>(sx, sy);
}
Also used : SenseStructure(edu.illinois.cs.cogcomp.verbsense.jlis.SenseStructure) SentenceInstance(edu.illinois.cs.cogcomp.verbsense.jlis.SentenceInstance) SenseInstance(edu.illinois.cs.cogcomp.verbsense.jlis.SenseInstance) SentenceStructure(edu.illinois.cs.cogcomp.verbsense.jlis.SentenceStructure) ArrayList(java.util.ArrayList) Pair(edu.illinois.cs.cogcomp.core.datastructures.Pair)

Aggregations

Pair (edu.illinois.cs.cogcomp.core.datastructures.Pair)1 SenseInstance (edu.illinois.cs.cogcomp.verbsense.jlis.SenseInstance)1 SenseStructure (edu.illinois.cs.cogcomp.verbsense.jlis.SenseStructure)1 SentenceInstance (edu.illinois.cs.cogcomp.verbsense.jlis.SentenceInstance)1 SentenceStructure (edu.illinois.cs.cogcomp.verbsense.jlis.SentenceStructure)1 ArrayList (java.util.ArrayList)1