public class RelationExtractorEvaluation extends SHARPXMI.Evaluation_ImplBase
Modifier and Type | Class and Description |
---|---|
static class |
RelationExtractorEvaluation.HashableArguments
This class is useful for mapping the spans of relation arguments to the
relation's category.
|
static interface |
RelationExtractorEvaluation.Options |
static class |
RelationExtractorEvaluation.RemoveCTakesMentionsAndCopyGoldRelations
Annotator that removes cTAKES mentions in the system view and copies
relations from the gold view to the system view
|
static class |
RelationExtractorEvaluation.RemoveSmallerEventMentions |
static class |
RelationExtractorEvaluation.ReplaceCTakesMentionsWithGoldMentions
Annotator that removes cTAKES Mentions and Modifiers from the system view,
and copies over the manually annotated Mentions and Modifiers from the gold
view.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
allowSmallerSystemArguments |
static java.util.Map<java.lang.Class<? extends BinaryTextRelation>,java.lang.Class<? extends RelationExtractorAnnotator>> |
ANNOTATOR_CLASSES |
static java.util.Map<java.lang.Class<? extends BinaryTextRelation>,ParameterSettings> |
BEST_PARAMETERS |
private java.lang.Class<? extends RelationExtractorAnnotator> |
classifierAnnotatorClass |
private boolean |
ignoreImpossibleGoldRelations |
private ParameterSettings |
parameterSettings |
private boolean |
printErrors |
static java.util.Map<java.lang.String,java.lang.Class<? extends BinaryTextRelation>> |
RELATION_CLASSES |
private java.lang.Class<? extends BinaryTextRelation> |
relationClass |
private boolean |
testOnCTakes |
Constructor and Description |
---|
RelationExtractorEvaluation(java.io.File baseDirectory,
java.lang.Class<? extends BinaryTextRelation> relationClass,
java.lang.Class<? extends RelationExtractorAnnotator> classifierAnnotatorClass,
ParameterSettings parameterSettings) |
RelationExtractorEvaluation(java.io.File baseDirectory,
java.lang.Class<? extends BinaryTextRelation> relationClass,
java.lang.Class<? extends RelationExtractorAnnotator> classifierAnnotatorClass,
ParameterSettings parameterSettings,
boolean testOnCTakes,
boolean allowSmallerSystemArguments,
boolean ignoreImpossibleGoldRelations,
boolean printErrors)
An evaluation of a relation extractor.
|
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.String |
format(IdentifiedAnnotation a) |
private static java.lang.String |
formatRelation(BinaryTextRelation relation) |
static void |
main(java.lang.String[] args) |
protected |
test(CollectionReader collectionReader,
java.io.File directory) |
void |
train(CollectionReader collectionReader,
java.io.File directory) |
getCollectionReader
public static final java.util.Map<java.lang.String,java.lang.Class<? extends BinaryTextRelation>> RELATION_CLASSES
public static final java.util.Map<java.lang.Class<? extends BinaryTextRelation>,java.lang.Class<? extends RelationExtractorAnnotator>> ANNOTATOR_CLASSES
public static final java.util.Map<java.lang.Class<? extends BinaryTextRelation>,ParameterSettings> BEST_PARAMETERS
private java.lang.Class<? extends BinaryTextRelation> relationClass
private java.lang.Class<? extends RelationExtractorAnnotator> classifierAnnotatorClass
private ParameterSettings parameterSettings
private boolean testOnCTakes
private boolean allowSmallerSystemArguments
private boolean ignoreImpossibleGoldRelations
private boolean printErrors
public RelationExtractorEvaluation(java.io.File baseDirectory, java.lang.Class<? extends BinaryTextRelation> relationClass, java.lang.Class<? extends RelationExtractorAnnotator> classifierAnnotatorClass, ParameterSettings parameterSettings, boolean testOnCTakes, boolean allowSmallerSystemArguments, boolean ignoreImpossibleGoldRelations, boolean printErrors)
baseDirectory
- The directory where models, etc. should be writtenrelationClass
- The class of the relation to be predictedclassifierAnnotatorClass
- The CleartkAnnotator class that learns a relation extractor modelparameterSettings
- The parameters defining how to train a classifiertestOnCTakes
- During testing, use annotations from cTAKES, not from the gold
standardallowSmallerSystemArguments
- During testing, allow system annotations to match gold annotations
that enclose themignoreImpossibleGoldRelations
- During testing, ignore gold relations that would be impossible to
find because there are no corresponding system mentionspublic RelationExtractorEvaluation(java.io.File baseDirectory, java.lang.Class<? extends BinaryTextRelation> relationClass, java.lang.Class<? extends RelationExtractorAnnotator> classifierAnnotatorClass, ParameterSettings parameterSettings)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public void train(CollectionReader collectionReader, java.io.File directory) throws java.lang.Exception
java.lang.Exception
protectedtest(CollectionReader collectionReader, java.io.File directory) throws java.lang.Exception
java.lang.Exception
private static java.lang.String formatRelation(BinaryTextRelation relation)
static java.lang.String format(IdentifiedAnnotation a)