Examples of EventMention


Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

      if(event.getClass().equals(EventMention.class)){
        realEvents.add(event);
      }
    }
    events = realEvents;
    EventMention anchor = events.get(0);
   
    if(arg1.getBegin() == anchor.getBegin() && arg1.getEnd() == anchor.getEnd()){
      feats.add(new Feature("Arg1LeftmostEvent"));
    }else if(arg2.getBegin() == anchor.getBegin() && arg2.getEnd() == anchor.getEnd()){
      feats.add(new Feature("Arg2LeftmostEvent"));
    }
   
    if(arg1 instanceof EventMention){
      feats.addAll(getEventFeats("mention1property", (EventMention)arg1));
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

  public List<Feature> extract(JCas jcas, IdentifiedAnnotation arg1,
      IdentifiedAnnotation arg2) throws AnalysisEngineProcessException {
    List<Feature> feats = new ArrayList<Feature>();

    //find event
    EventMention event = null;
    if(arg1 instanceof EventMention){
      event = (EventMention) arg1;
    }else if(arg1 instanceof EventMention){
      event = (EventMention) arg2;
    }else{
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

  @Override
  public List<Feature> extract(JCas jCas, IdentifiedAnnotation arg1,
      IdentifiedAnnotation arg2) throws AnalysisEngineProcessException {
    ArrayList<Feature> feats = new ArrayList<>();
    EventMention event = null;
    TimeMention time = null;

    // swap the order if necessary:
//    if(arg2.getBegin() <= arg1.getBegin() && arg2.getEnd() <= arg1.getEnd()){
//      IdentifiedAnnotation temp = arg1;
//      arg1 = arg2;
//      arg2 = temp;
//    }

    if(arg1 instanceof EventMention && arg2 instanceof TimeMention){
      event = JCasUtil.selectCovering(jCas, EventMention.class, arg1.getBegin(), arg1.getEnd()).get(0);
      time = (TimeMention)arg2;
      if(event!=null && event.getEvent()!=null)
        feats.add(new Feature("Event-Modality-", event.getEvent().getProperties().getContextualModality()));
      feats.add(new Feature("Time-Class-", time.getTimeClass()));
    }else if(arg2 instanceof EventMention && arg1 instanceof TimeMention){
      time = (TimeMention)arg1;
      event = JCasUtil.selectCovering(jCas, EventMention.class, arg2.getBegin(), arg2.getEnd()).get(0);
      feats.add(new Feature("Timex-Class-", time.getTimeClass()));
      if(event!=null && event.getEvent()!=null)
        feats.add(new Feature("Event-Modality-", event.getEvent().getProperties().getContextualModality()));
    }
   
   
    return feats;
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

  public List<Feature> extract(JCas jcas, IdentifiedAnnotation arg1,
      IdentifiedAnnotation arg2) throws AnalysisEngineProcessException {
    List<Feature> feats = new ArrayList<Feature>();

    //find event
    EventMention event = null;
    if(arg1 instanceof EventMention){
      event = (EventMention) arg1;
    }else if(arg2 instanceof EventMention){
      event = (EventMention) arg2;
    }else{
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

  @Override
  public List<Feature> extract(JCas jCas, IdentifiedAnnotation arg1,
      IdentifiedAnnotation arg2) throws AnalysisEngineProcessException {
    ArrayList<Feature> feats = new ArrayList<Feature>();
    EventMention event = null;
    TimeMention time = null;
   
    if(arg1 instanceof EventMention){
      event = (EventMention) arg1;
      time = (TimeMention) arg2;
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

      throws AnalysisEngineProcessException {

    List<Feature> features = new ArrayList<Feature>();
   
    if(arg1 instanceof EventMention) {
      EventMention event = (EventMention) arg1;
      String docTimeRel = event.getEvent().getProperties().getDocTimeRel();
      features.add(new Feature("arg1DocTimeRel", docTimeRel));
    }
   
    if(arg2 instanceof EventMention) {
      EventMention event = (EventMention) arg2;
      String docTimeRel = event.getEvent().getProperties().getDocTimeRel();
      features.add(new Feature("arg2DocTimeRel", docTimeRel));
    }
   
    return features;
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

    String a1type="", a2type="";
    String eventModality="";
    String timeClass="";

    if(arg1 instanceof EventMention){
      EventMention mention = (EventMention) arg1;
      if(mention.getEvent() != null && mention.getEvent().getProperties() != null){
        eventModality = mention.getEvent().getProperties().getContextualModality();
      }
      a1type = "EVENT-"+eventModality;
    }else if(arg1 instanceof TimeMention){
      timeClass = ((TimeMention)arg1).getTimeClass();
      a1type = "TIMEX-"+timeClass;
    }
   
    if(arg2 instanceof EventMention){
      EventMention mention = (EventMention) arg2;
      if(mention.getEvent() != null && mention.getEvent().getProperties() != null){
        eventModality = mention.getEvent().getProperties().getContextualModality();
      }
      a2type = "EVENT"+eventModality;     
    }else if(arg2 instanceof TimeMention){
      timeClass = ((TimeMention)arg2).getTimeClass();
      a2type = "TIMEX-"+timeClass;     
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

    List<Feature> features = new ArrayList<Feature>();
   
    //1 get covering sentence:
    Map<EventMention, Collection<Segment>> coveringMap =
        JCasUtil.indexCovering(view, EventMention.class, Segment.class);
    EventMention targetTokenAnnotation = (EventMention)annotation;
    Collection<Segment> segList = coveringMap.get(targetTokenAnnotation);
   
    //2 get Verb Tense
    if (segList != null && !segList.isEmpty()){
      for(Segment seg : segList) {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

    List<Feature> features = new ArrayList<Feature>();
   
    //1 get covering sentence:
    Map<EventMention, Collection<Sentence>> coveringMap =
        JCasUtil.indexCovering(view, EventMention.class, Sentence.class);
    EventMention targetTokenAnnotation = (EventMention)annotation;
    Collection<Sentence> sentList = coveringMap.get(targetTokenAnnotation);
   
    //2 get TimeX
    Map<Integer, IdentifiedAnnotation> timeDistMap = null;
   
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.EventMention

    String a1type="", a2type="";
    String eventModality="";
    String timeClass;
   
    if(arg1 instanceof EventMention){
      EventMention mention = (EventMention) arg1;
      if(mention.getEvent() != null && mention.getEvent().getProperties() != null){
        eventModality = mention.getEvent().getProperties().getContextualModality();
      }
      a1type = "EVENT-"+eventModality;
    }else if(arg1 instanceof TimeMention){
      timeClass = ((TimeMention)arg1).getTimeClass()
      a1type = "TIMEX-"+timeClass;
    }
   
    if(arg2 instanceof EventMention){
      EventMention mention = (EventMention) arg2;
      if(mention.getEvent() != null && mention.getEvent().getProperties() != null){
        eventModality = mention.getEvent().getProperties().getContextualModality();
      }
      a2type = "EVENT-"+eventModality;     
    }else if(arg2 instanceof TimeMention){
      timeClass = ((TimeMention)arg2).getTimeClass();
      a2type = "TIMEX-"+timeClass;     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.