C
- the class of core elements.R
- the relation class that is constructed by this annotator.public abstract class RelationAnnotator<C extends de.unibi.techfak.scie.descriptors.Annotation,R extends de.unibi.techfak.scie.descriptors.Aggregated>
extends org.apache.uima.fit.component.JCasAnnotator_ImplBase
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DIST_LIMIT |
static int |
DEFAULT_K |
static int |
DEFAULT_R |
Constructor and Description |
---|
RelationAnnotator(Class<C> coreClass,
Classifier coreClassifier,
Classifier relationClassifier) |
Modifier and Type | Method and Description |
---|---|
abstract CoreDataPoint<C> |
createCoreDataPoint(C core,
org.apache.uima.jcas.JCas jcas)
This method should create a CoreDataPoint given a core instance.
|
abstract CoreSlotCombinationDataPoint<C,? extends de.unibi.techfak.scie.descriptors.Annotation> |
createCoreSlotCombinationDataPoint(SlotSpecification spec,
C code,
de.unibi.techfak.scie.descriptors.Annotation slot,
org.apache.uima.jcas.JCas jcas)
This method should create a CoreSlotCombination given a
SlotSpecification, a core instance and a Slot instance.
|
abstract RelationDataPoint<C> |
createDataPoint(C core,
ClassificationResult coreClassification,
SlotCandidate[] slotCandidates,
org.apache.uima.jcas.JCas jcas)
This method should create a RelationDataPoint given a core instance,
a core classification and Candidates for all slots (note that the
candidates might be null).
|
abstract R |
createRelationObject(C core,
ClassificationResult coreClassification,
SlotCandidate[] slots,
org.apache.uima.jcas.JCas jcas)
This is only needed to create an empty relation object and to add
relation-specific information.
|
Class<C> |
getCoreClass() |
Classifier |
getCoreClassifier() |
int |
getDistLimit()
Returns the limit (in characters) a core instance may have to a
slot instance.
|
int |
getK()
Returns the number of annotations that may be present on an
overlapping piece of text.
|
int |
getR()
Returns the number of annotations that may be present in the text.
|
Classifier |
getRelationClassifier() |
ArrayList<SlotSpecification> |
getSlotSpecifications() |
void |
process(org.apache.uima.jcas.JCas jcas)
Annotates a given document in its JCas form.
|
void |
setDistLimit(int distLimit)
Sets the limit (in characters) a core instance may have to a
slot instance.
|
void |
setK(int K)
Returns the number of annotations that may be present on an
overlapping piece of text.
|
void |
setR(int R)
Sets the number of annotations that may be present in the text.
|
getLogger, initialize
getRequiredCasInterface, process
getCasInstancesRequired, hasNext, next
public static final int DEFAULT_DIST_LIMIT
public static final int DEFAULT_K
public static final int DEFAULT_R
public RelationAnnotator(Class<C> coreClass, Classifier coreClassifier, Classifier relationClassifier)
public Classifier getCoreClassifier()
public ArrayList<SlotSpecification> getSlotSpecifications()
public Classifier getRelationClassifier()
public int getDistLimit()
public void setDistLimit(int distLimit)
distLimit
- the limit (in characters) a core instance may have to a
slot instance.public int getK()
public void setK(int K)
K
- the number of annotations that may be present on an
overlapping piece of text.public int getR()
public void setR(int R)
R
- the number of annotations that may be present in the text.public void process(org.apache.uima.jcas.JCas jcas) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
process
in class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
jcas
- a document given as a JCas instance.org.apache.uima.analysis_engine.AnalysisEngineProcessException
public abstract RelationDataPoint<C> createDataPoint(C core, ClassificationResult coreClassification, SlotCandidate[] slotCandidates, org.apache.uima.jcas.JCas jcas)
core
- a core instance.coreClassification
- the classification of that core instance
including the classification confidence (the label will be true).slotCandidates
- the candidates for each slot. Note that each entry
of that array might be null if the slot is not filled.jcas
- the current JCas object.public abstract CoreDataPoint<C> createCoreDataPoint(C core, org.apache.uima.jcas.JCas jcas)
core
- a core instance.jcas
- the current JCas object.public abstract CoreSlotCombinationDataPoint<C,? extends de.unibi.techfak.scie.descriptors.Annotation> createCoreSlotCombinationDataPoint(SlotSpecification spec, C code, de.unibi.techfak.scie.descriptors.Annotation slot, org.apache.uima.jcas.JCas jcas)
spec
- the current SlotSpecification.code
- the current Core instance.slot
- the current slot instance.jcas
- the current JCas object.public abstract R createRelationObject(C core, ClassificationResult coreClassification, SlotCandidate[] slots, org.apache.uima.jcas.JCas jcas)
core
- the core instance.coreClassification
- the ClassificationResult for the core.slots
- all SlotCandidates (some of them may be null).jcas
- the current JCas object.Copyright © 2014. All rights reserved.