本文整理了Java中org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation.getConfidence()
方法的一些代码示例,展示了IdentifiedAnnotation.getConfidence()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IdentifiedAnnotation.getConfidence()
方法的具体详情如下:
包路径:org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation
类名称:IdentifiedAnnotation
方法名:getConfidence
[英]getter for confidence - gets The confidence of the annotation.
[中]getter for confidence-获取注释的置信度。
代码示例来源:origin: apache/tika
value = Boolean.toString(annotation.getConditional());
} else if (property == CTAKESAnnotationProperty.CONFIDENCE) {
value = Float.toString(annotation.getConfidence());
} else if (property == CTAKESAnnotationProperty.DISCOVERY_TECNIQUE) {
value = Integer.toString(annotation.getDiscoveryTechnique());
代码示例来源:origin: org.apache.ctakes/ctakes-coreference
@Override
public List<Feature> extract(JCas jCas, IdentifiedAnnotation ante, IdentifiedAnnotation ana)
throws AnalysisEngineProcessException {
List<Feature> feats = new ArrayList<>();
feats.add(new Feature("MP_ANTE_SALIENCE", ante.getConfidence()));
feats.add(new Feature("MP_ANA_SALIENCE", ana.getConfidence()));
return feats;
}
代码示例来源:origin: apache/ctakes
@Override
public List<Feature> extract(JCas jCas, IdentifiedAnnotation ante, IdentifiedAnnotation ana)
throws AnalysisEngineProcessException {
List<Feature> feats = new ArrayList<>();
feats.add(new Feature("MP_ANTE_SALIENCE", ante.getConfidence()));
feats.add(new Feature("MP_ANA_SALIENCE", ana.getConfidence()));
return feats;
}
代码示例来源:origin: org.apache.ctakes/ctakes-coreference
@Override
protected String getRelationCategory(
Map<List<Annotation>, BinaryTextRelation> relationLookup,
IdentifiedAnnotation ante, IdentifiedAnnotation ana) {
String cat = super.getRelationCategory(relationLookup, ante, ana);
int dist = sentsBetween(ante, ana);
if(cat != null && !cat.equals(NO_RELATION_CATEGORY)){
// cat is some coref category
foundAnaphors.add(ana);
logger.info(String.format("DISTSALIENCE: (%d,%f,1)\n", dist, ante.getConfidence()));
}else{
// sample 10 percent of negative examples:
if(Math.random() < 0.1){
logger.info(String.format("DISTSALIENCE: (%d,%f,0)\n", dist, ante.getConfidence()));
}
}
return cat;
}
代码示例来源:origin: apache/ctakes
@Override
protected String getRelationCategory(
Map<List<Annotation>, BinaryTextRelation> relationLookup,
IdentifiedAnnotation ante, IdentifiedAnnotation ana) {
String cat = super.getRelationCategory(relationLookup, ante, ana);
int dist = sentsBetween(ante, ana);
if(cat != null && !cat.equals(NO_RELATION_CATEGORY)){
// cat is some coref category
foundAnaphors.add(ana);
logger.info(String.format("DISTSALIENCE: (%d,%f,1)\n", dist, ante.getConfidence()));
}else{
// sample 10 percent of negative examples:
if(Math.random() < 0.1){
logger.info(String.format("DISTSALIENCE: (%d,%f,0)\n", dist, ante.getConfidence()));
}
}
return cat;
}
代码示例来源:origin: apache/ctakes
public int compare(IdentifiedAnnotationPair o1, IdentifiedAnnotationPair o2) {
if(o1 == o2) return 0;
int sim;
IdentifiedAnnotation ante1 = o1.getArg1();
IdentifiedAnnotation ante2 = o2.getArg1();
IdentifiedAnnotation ana1 = o1.getArg2();
IdentifiedAnnotation ana2 = o2.getArg2();
// first level sorting is by anaphor:
if(ana1.getBegin() != ana2.getBegin()){
sim = ana1.getBegin() - ana2.getBegin() > 0 ? 1 : -1;
}else if(ana1.getEnd() != ana2.getEnd()){
sim = ana1.getEnd() - ana2.getEnd() > 0 ? 1 : -1;
}else{
// sort by antecedent
if(ante1.getConfidence() > ante2.getConfidence()){
sim = -1;
}else if(ante1.getConfidence() < ante2.getConfidence()){
sim = 1;
}else{
sim = 0;
}
}
return sim;
}
代码示例来源:origin: org.apache.tika/tika-parsers
value = Boolean.toString(annotation.getConditional());
} else if (property == CTAKESAnnotationProperty.CONFIDENCE) {
value = Float.toString(annotation.getConfidence());
} else if (property == CTAKESAnnotationProperty.DISCOVERY_TECNIQUE) {
value = Integer.toString(annotation.getDiscoveryTechnique());
代码示例来源:origin: org.apache.ctakes/ctakes-coreference
public int compare(IdentifiedAnnotationPair o1, IdentifiedAnnotationPair o2) {
if(o1 == o2) return 0;
int sim;
IdentifiedAnnotation ante1 = o1.getArg1();
IdentifiedAnnotation ante2 = o2.getArg1();
IdentifiedAnnotation ana1 = o1.getArg2();
IdentifiedAnnotation ana2 = o2.getArg2();
// first level sorting is by anaphor:
if(ana1.getBegin() != ana2.getBegin()){
sim = ana1.getBegin() - ana2.getBegin() > 0 ? 1 : -1;
}else if(ana1.getEnd() != ana2.getEnd()){
sim = ana1.getEnd() - ana2.getEnd() > 0 ? 1 : -1;
}else{
// sort by antecedent
if(ante1.getConfidence() > ante2.getConfidence()){
sim = -1;
}else if(ante1.getConfidence() < ante2.getConfidence()){
sim = 1;
}else{
sim = 0;
}
}
return sim;
}
代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers
value = Boolean.toString(annotation.getConditional());
} else if (property == CTAKESAnnotationProperty.CONFIDENCE) {
value = Float.toString(annotation.getConfidence());
} else if (property == CTAKESAnnotationProperty.DISCOVERY_TECNIQUE) {
value = Integer.toString(annotation.getDiscoveryTechnique());
代码示例来源: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
mention.setEnd(original.getEnd());
mention.setConditional(original.getConditional());
mention.setConfidence(original.getConfidence());
mention.setDiscoveryTechnique(original.getDiscoveryTechnique());
mention.setGeneric(original.getGeneric());
内容来源于网络,如有侵权,请联系作者删除!