org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation.setHistoryOf()方法的使用及代码示例

x33g5p2x  于8个月前 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(14)

本文整理了Java中org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation.setHistoryOf()方法的一些代码示例,展示了IdentifiedAnnotation.setHistoryOf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IdentifiedAnnotation.setHistoryOf()方法的具体详情如下:
包路径:org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation
类名称:IdentifiedAnnotation
方法名:setHistoryOf

IdentifiedAnnotation.setHistoryOf介绍

[英]setter for historyOf - sets
[中]集合历史设置器

代码示例

代码示例来源:origin: apache/ctakes

@Override
public void setClassLabel( IdentifiedAnnotation entityOrEventMention,
             Instance<String> instance ) throws AnalysisEngineProcessException {
 if ( this.isTraining() ) {
   int history = entityOrEventMention.getHistoryOf();
   // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
   if ( history == CONST.NE_HISTORY_OF_ABSENT
     && coin.nextDouble() >= this.probabilityOfKeepingADefaultExample ) {
    return;
   }
   instance.setOutcome( String.valueOf( history ) );
 } else {
   String label = this.classifier.classify( instance.getFeatures() );
   entityOrEventMention.setHistoryOf( Integer.parseInt( label ) );
 }
}

代码示例来源:origin: org.apache.ctakes/ctakes-assertion

@Override
public void setClassLabel(IdentifiedAnnotation entityOrEventMention,
    Instance<String> instance) throws AnalysisEngineProcessException {
  if (this.isTraining())
   {
    int history = entityOrEventMention.getHistoryOf(); 
    // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
    if (history == CONST.NE_HISTORY_OF_ABSENT
        && coin.nextDouble() >= this.probabilityOfKeepingADefaultExample) {
      return;
    }
        
    instance.setOutcome(String.valueOf(history));
   } else
   {
    String label = this.classifier.classify(instance.getFeatures());
    entityOrEventMention.setHistoryOf(Integer.parseInt(label));
   }
}
public static FeatureSelection<String> createFeatureSelection(double threshold) {

代码示例来源:origin: apache/ctakes

@Override
public void setClassLabel(IdentifiedAnnotation entityOrEventMention,
    Instance<String> instance) throws AnalysisEngineProcessException {
  if (this.isTraining())
   {
    int history = entityOrEventMention.getHistoryOf(); 
    // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling
    if (history == CONST.NE_HISTORY_OF_ABSENT
        && coin.nextDouble() >= this.probabilityOfKeepingADefaultExample) {
      return;
    }
        
    instance.setOutcome(String.valueOf(history));
   } else
   {
    String label = this.classifier.classify(instance.getFeatures());
    entityOrEventMention.setHistoryOf(Integer.parseInt(label));
   }
}
public static FeatureSelection<String> createFeatureSelection(double threshold) {

代码示例来源:origin: apache/ctakes

public void consumeHit(JCas jcas, Annotation focusAnnot, int scope, ContextHit ctxHit)
      throws AnalysisEngineProcessException {
    
    Integer status = (Integer) ctxHit.getMetaData(StatusContextAnalyzer.CTX_HIT_KEY_STATUS_TYPE);
    if (focusAnnot instanceof IdentifiedAnnotation) {
      IdentifiedAnnotation neAnnot = (IdentifiedAnnotation) focusAnnot;
      //TODO: currently status is an int in the old system.  Let's update this to a constant string?
      neAnnot.setUncertainty(status);
      if(StatusIndicator.HISTORY_STATUS == status 
          || StatusIndicator.FAMILY_HISTORY_STATUS == status ) {
        neAnnot.setHistoryOf(1);
      }
    }

    createContextAnnot(jcas, focusAnnot, scope, ctxHit).addToIndexes();
  }
}

代码示例来源:origin: org.apache.ctakes/ctakes-ne-contexts

public void consumeHit(JCas jcas, Annotation focusAnnot, int scope, ContextHit ctxHit)
      throws AnalysisEngineProcessException {
    
    Integer status = (Integer) ctxHit.getMetaData(StatusContextAnalyzer.CTX_HIT_KEY_STATUS_TYPE);
    if (focusAnnot instanceof IdentifiedAnnotation) {
      IdentifiedAnnotation neAnnot = (IdentifiedAnnotation) focusAnnot;
      //TODO: currently status is an int in the old system.  Let's update this to a constant string?
      neAnnot.setUncertainty(status);
      if(StatusIndicator.HISTORY_STATUS == status 
          || StatusIndicator.FAMILY_HISTORY_STATUS == status ) {
        neAnnot.setHistoryOf(1);
      }
    }

    createContextAnnot(jcas, focusAnnot, scope, ctxHit).addToIndexes();
  }
}

代码示例来源:origin: apache/ctakes

break;
case HISTORYOF:
  mention.setHistoryOf(CONST.NE_HISTORY_OF_ABSENT);
  break;
case POLARITY:

代码示例来源:origin: apache/ctakes

if (status != null) {
 if ("HistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
 } else if ("FamilyHistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
  mention.setSubject(CONST.ATTR_SUBJECT_FAMILY_MEMBER);
 } else if ("Possible".equals(status)) {

代码示例来源:origin: org.apache.ctakes/ctakes-assertion

break;
case HISTORYOF:
  mention.setHistoryOf(CONST.NE_HISTORY_OF_ABSENT);
  break;
case POLARITY:

代码示例来源:origin: apache/ctakes

if (status != null) {
 if ("HistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
 } else if ("FamilyHistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
  mention.setSubject(CONST.ATTR_SUBJECT_FAMILY_MEMBER);
 } else if ("Possible".equals(status)) {

代码示例来源:origin: org.apache.ctakes/ctakes-core

if (status != null) {
 if ("HistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
 } else if ("FamilyHistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
  mention.setSubject(CONST.ATTR_SUBJECT_FAMILY_MEMBER);
 } else if ("Possible".equals(status)) {

代码示例来源:origin: org.apache.ctakes/ctakes-assertion

if (status != null) {
 if ("HistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
 } else if ("FamilyHistoryOf".equals(status)) {
  mention.setHistoryOf(CONST.NE_HISTORY_OF_PRESENT);
  mention.setSubject(CONST.ATTR_SUBJECT_FAMILY_MEMBER);
 } else if ("Possible".equals(status)) {

代码示例来源:origin: apache/ctakes

break;
case HISTORYOF:
  m.setHistoryOf(mention.getHistoryOf());
  break;
case POLARITY:

代码示例来源:origin: org.apache.ctakes/ctakes-assertion

break;
case HISTORYOF:
  m.setHistoryOf(mention.getHistoryOf());
  break;
case POLARITY:

代码示例来源:origin: org.apache.ctakes/ctakes-assertion

/**
 * 
 * @param goldAnnotation
 * @param jcas
 */
private static void copyAnnotation(Annotation goldAnnotation, JCas jcas) {
  
  Annotation newAnno;
  if (goldAnnotation instanceof IdentifiedAnnotation) {
    IdentifiedAnnotation ia = new IdentifiedAnnotation(jcas);
    ia.setConditional(((IdentifiedAnnotation) goldAnnotation).getConditional());
    ia.setConfidence(((IdentifiedAnnotation) goldAnnotation).getConfidence());
    ia.setDiscoveryTechnique(((IdentifiedAnnotation)goldAnnotation).getDiscoveryTechnique());
    ia.setGeneric(((IdentifiedAnnotation) goldAnnotation).getGeneric());
    ia.setHistoryOf(((IdentifiedAnnotation) goldAnnotation).getHistoryOf());
    ia.setPolarity(((IdentifiedAnnotation) goldAnnotation).getPolarity());
    ia.setSegmentID(((IdentifiedAnnotation) goldAnnotation).getSegmentID());
    ia.setSentenceID(((IdentifiedAnnotation) goldAnnotation).getSentenceID());
    ia.setSubject(((IdentifiedAnnotation) goldAnnotation).getSubject());
    ia.setTypeID(((IdentifiedAnnotation) goldAnnotation).getTypeID());
    ia.setUncertainty(((IdentifiedAnnotation) goldAnnotation).getUncertainty());
    newAnno = ia;
  } else {
    throw new RuntimeException("Unexpected class of object " + goldAnnotation.getClass());
  }
  newAnno.setBegin(goldAnnotation.getBegin());
  newAnno.setEnd(goldAnnotation.getEnd());
  newAnno.addToIndexes();
  
}

代码示例来源:origin: apache/ctakes

/**
 * 
 * @param goldAnnotation
 * @param jcas
 */
private static void copyAnnotation(Annotation goldAnnotation, JCas jcas) {
  
  Annotation newAnno;
  if (goldAnnotation instanceof IdentifiedAnnotation) {
    IdentifiedAnnotation ia = new IdentifiedAnnotation(jcas);
    ia.setConditional(((IdentifiedAnnotation) goldAnnotation).getConditional());
    ia.setConfidence(((IdentifiedAnnotation) goldAnnotation).getConfidence());
    ia.setDiscoveryTechnique(((IdentifiedAnnotation)goldAnnotation).getDiscoveryTechnique());
    ia.setGeneric(((IdentifiedAnnotation) goldAnnotation).getGeneric());
    ia.setHistoryOf(((IdentifiedAnnotation) goldAnnotation).getHistoryOf());
    ia.setPolarity(((IdentifiedAnnotation) goldAnnotation).getPolarity());
    ia.setSegmentID(((IdentifiedAnnotation) goldAnnotation).getSegmentID());
    ia.setSentenceID(((IdentifiedAnnotation) goldAnnotation).getSentenceID());
    ia.setSubject(((IdentifiedAnnotation) goldAnnotation).getSubject());
    ia.setTypeID(((IdentifiedAnnotation) goldAnnotation).getTypeID());
    ia.setUncertainty(((IdentifiedAnnotation) goldAnnotation).getUncertainty());
    newAnno = ia;
  } else {
    throw new RuntimeException("Unexpected class of object " + goldAnnotation.getClass());
  }
  newAnno.setBegin(goldAnnotation.getBegin());
  newAnno.setEnd(goldAnnotation.getEnd());
  newAnno.addToIndexes();
  
}

代码示例来源:origin: apache/ctakes

annotation.setHistoryOf( CONST.NE_HISTORY_OF_PRESENT );

代码示例来源:origin: apache/ctakes

mention.setTypeID(original.getTypeID());
mention.setUncertainty(original.getUncertainty());
mention.setHistoryOf(original.getHistoryOf());

相关文章