public abstract class RelationExtractorAnnotator extends
Modifier and Type | Class and Description |
---|---|
static class |
RelationExtractorAnnotator.IdentifiedAnnotationPair |
Modifier and Type | Field and Description |
---|---|
protected java.util.Random |
coin |
private java.lang.Class<? extends Annotation> |
coveringClass |
private java.util.List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> |
featureExtractors |
static java.lang.String |
NO_RELATION_CATEGORY |
static java.lang.String |
PARAM_PROBABILITY_OF_KEEPING_A_NEGATIVE_EXAMPLE |
protected double |
probabilityOfKeepingANegativeExample |
Constructor and Description |
---|
RelationExtractorAnnotator() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
allowClassifierModelOnClasspath(UimaContext context)
Workaround for https://code.google.com/p/cleartk/issues/detail?id=346
Not intended for external use
|
protected java.lang.String |
classify(java.util.List<Feature> features)
Predict an outcome given a set of features.
|
protected void |
createRelation(JCas jCas,
IdentifiedAnnotation arg1,
IdentifiedAnnotation arg2,
java.lang.String predictedCategory)
Create a UIMA relation type based on arguments and the relation label.
|
protected abstract java.util.List<RelationExtractorAnnotator.IdentifiedAnnotationPair> |
getCandidateRelationArgumentPairs(JCas identifiedAnnotationView,
Annotation coveringAnnotation)
Selects the relevant mentions/annotations within a covering annotation for
relation identification/extraction.
|
protected abstract java.lang.Class<? extends Annotation> |
getCoveringClass() |
protected java.util.List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> |
getFeatureExtractors()
Defines the list of feature extractors used by the classifier.
|
protected java.lang.String |
getRelationCategory(java.util.Map<java.util.List<Annotation>,BinaryTextRelation> relationLookup,
IdentifiedAnnotation arg1,
IdentifiedAnnotation arg2)
Looks up the arguments in the specified lookup table and converts the
relation into a label for classification
|
protected java.lang.Class<? extends BinaryTextRelation> |
getRelationClass() |
void |
initialize(UimaContext context) |
void |
process(JCas jCas) |
public static final java.lang.String NO_RELATION_CATEGORY
public static final java.lang.String PARAM_PROBABILITY_OF_KEEPING_A_NEGATIVE_EXAMPLE
protected double probabilityOfKeepingANegativeExample
protected java.util.Random coin
private java.util.List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> featureExtractors
private java.lang.Class<? extends Annotation> coveringClass
protected java.util.List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> getFeatureExtractors()
protected java.lang.Class<? extends BinaryTextRelation> getRelationClass()
protected abstract java.lang.Class<? extends Annotation> getCoveringClass()
protected abstract java.util.List<RelationExtractorAnnotator.IdentifiedAnnotationPair> getCandidateRelationArgumentPairs(JCas identifiedAnnotationView, Annotation coveringAnnotation)
static void allowClassifierModelOnClasspath(UimaContext context)
public void initialize(UimaContext context) throws ResourceInitializationException
ResourceInitializationException
public void process(JCas jCas) throws AnalysisEngineProcessException
AnalysisEngineProcessException
protected java.lang.String getRelationCategory(java.util.Map<java.util.List<Annotation>,BinaryTextRelation> relationLookup, IdentifiedAnnotation arg1, IdentifiedAnnotation arg2)
protected java.lang.String classify(java.util.List<Feature> features) throws CleartkProcessingException
classifier
. Subclasses may override
this method to implement more complex classification procedures.features
- The features to be classified.CleartkProcessingException
protected void createRelation(JCas jCas, IdentifiedAnnotation arg1, IdentifiedAnnotation arg2, java.lang.String predictedCategory)
jCas
- - JCas object, needed to create new UIMA typesarg1
- - First argument to relationarg2
- - Second argument to relationpredictedCategory
- - Name of relation