public abstract class RelationExtractorAnnotator extends org.cleartk.ml.CleartkAnnotator<String>
| Modifier and Type | Class and Description |
|---|---|
static class |
RelationExtractorAnnotator.IdentifiedAnnotationPair |
| Modifier and Type | Field and Description |
|---|---|
static Map<String,Integer> |
category_frequency |
protected Random |
coin |
static String |
NO_RELATION_CATEGORY |
static String |
PARAM_PROBABILITY_OF_KEEPING_A_NEGATIVE_EXAMPLE |
protected double |
probabilityOfKeepingANegativeExample |
| Constructor and Description |
|---|
RelationExtractorAnnotator() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
classify(List<org.cleartk.ml.Feature> features)
Predict an outcome given a set of features.
|
static void |
clearCategoryFrequency() |
protected void |
createRelation(org.apache.uima.jcas.JCas jCas,
IdentifiedAnnotation arg1,
IdentifiedAnnotation arg2,
String predictedCategory)
Create a UIMA relation type based on arguments and the relation label.
|
protected abstract Iterable<RelationExtractorAnnotator.IdentifiedAnnotationPair> |
getCandidateRelationArgumentPairs(org.apache.uima.jcas.JCas identifiedAnnotationView,
org.apache.uima.jcas.tcas.Annotation coveringAnnotation)
Selects the relevant mentions/annotations within a covering annotation for
relation identification/extraction.
|
protected abstract Class<? extends org.apache.uima.jcas.tcas.Annotation> |
getCoveringClass() |
protected List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> |
getFeatureExtractors()
Defines the list of feature extractors used by the classifier.
|
protected String |
getRelationCategory(Map<List<org.apache.uima.jcas.tcas.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 Class<? extends BinaryTextRelation> |
getRelationClass() |
void |
initialize(org.apache.uima.UimaContext context) |
void |
process(org.apache.uima.jcas.JCas jCas) |
getRequiredCasInterface, processgetCasInstancesRequired, hasNext, nextpublic static final String NO_RELATION_CATEGORY
public static final String PARAM_PROBABILITY_OF_KEEPING_A_NEGATIVE_EXAMPLE
protected double probabilityOfKeepingANegativeExample
protected Random coin
protected List<RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>> getFeatureExtractors()
protected Class<? extends BinaryTextRelation> getRelationClass()
protected abstract Class<? extends org.apache.uima.jcas.tcas.Annotation> getCoveringClass()
protected abstract Iterable<RelationExtractorAnnotator.IdentifiedAnnotationPair> getCandidateRelationArgumentPairs(org.apache.uima.jcas.JCas identifiedAnnotationView, org.apache.uima.jcas.tcas.Annotation coveringAnnotation)
public void initialize(org.apache.uima.UimaContext context)
throws org.apache.uima.resource.ResourceInitializationException
initialize in interface org.apache.uima.analysis_component.AnalysisComponentinitialize in interface org.apache.uima.fit.factory.initializable.Initializableinitialize in class org.cleartk.ml.CleartkAnnotator<String>org.apache.uima.resource.ResourceInitializationExceptionpublic void process(org.apache.uima.jcas.JCas jCas)
throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
process in class org.apache.uima.analysis_component.JCasAnnotator_ImplBaseorg.apache.uima.analysis_engine.AnalysisEngineProcessExceptionprotected String getRelationCategory(Map<List<org.apache.uima.jcas.tcas.Annotation>,BinaryTextRelation> relationLookup, IdentifiedAnnotation arg1, IdentifiedAnnotation arg2)
protected String classify(List<org.cleartk.ml.Feature> features) throws org.cleartk.ml.CleartkProcessingException
classifier. Subclasses may override
this method to implement more complex classification procedures.features - The features to be classified.org.cleartk.ml.CleartkProcessingExceptionprotected void createRelation(org.apache.uima.jcas.JCas jCas,
IdentifiedAnnotation arg1,
IdentifiedAnnotation arg2,
String predictedCategory)
jCas - - JCas object, needed to create new UIMA typesarg1 - - First argument to relationarg2 - - Second argument to relationpredictedCategory - - Name of relationpublic static void clearCategoryFrequency()
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.