public class EREMentionRelationReader extends ERENerReader
EREDocumentReader.EreCorpusends, IS_FOUND, startsARG_ONE, ARG_TWO, AUTHOR, CORPUS_TYPE, DATELINE, DATETIME, deletableSpanTags, DOC, ENTITIES, ENTITY, ENTITY_ID, ENTITY_MENTION, ENTITY_MENTION_ID, EntityHeadEndCharOffset, EntityHeadStartCharOffset, EntityIdAttribute, EntityKbIdAttribute, EntityMentionIdAttribute, EntityMentionTypeAttribute, EntitySpecificityAttribute, EVENT_ARGUMENT, EVENT_MENTION, EventIdAttribute, EventMentionIdAttribute, FILL, FILLER, FILLER_ID, FILLERS, HEADLINE, HOPPER, HOPPERS, ID, IMG, KBID, LENGTH, MENTION_HEAD, MENTION_TEXT, NAM, NAME_END, NAME_START, NOM, NOUN_TYPE, OFFSET, ORIG_AUTHOR, ORIGIN, POST, PRO, QUOTE, REALIS, RELATION, RELATION_MENTION, RelationIdAttribute, RelationMentionIdAttribute, RelationRealisAttribute, RELATIONS, RelationSourceRoleAttribute, RelationSubtypeAttribute, RelationTargetRoleAttribute, RelationTypeAttribute, ROLE, SARCASM, SNIP, SOURCE, SPECIFICITY, SQUISH, STUFF, SUBTYPE, tagsToIgnore, tagsWithAtts, TRIGGER, TYPE, UNKNOWN_KBID, UNSPECIFIED, WAYSfileIdfileList, sourceDirectorycorpusName, currentAnnotationId, resourceManager| Constructor and Description |
|---|
EREMentionRelationReader(EREDocumentReader.EreCorpus ereCorpus,
String corpusRoot,
boolean throwExceptionOnXmlParseFailure)
Read mention-relation annotations -- including coreference -- from ERE corpus.
|
EREMentionRelationReader(EREDocumentReader.EreCorpus ereCorpus,
TextAnnotationBuilder taBuilder,
String corpusRoot,
boolean throwExceptionOnXmlParseFailure)
Read mention-relation annotations -- including coreference -- from ERE corpus.
|
| Modifier and Type | Method and Description |
|---|---|
String |
generateReport()
Reports number of relations and relation mentions read from source and generated.
|
List<XmlTextAnnotation> |
getAnnotationsFromFile(List<Path> corpusFileListEntry)
given an entry from the corpus file list generated by
EREDocumentReader.getFileListing() , parse its
contents and get zero or more TextAnnotation objects. |
String |
getMentionViewName() |
void |
readRelation(Node node,
View view)
read the relations from the gold standard xml and produce appropriate Relations linking
mention constituents in the view.
|
void |
reset()
set the reader to start from the beginning of the corpus.
|
compileOffsets, findEndIndex, findEndIndexIgnoreError, findStartIndex, findStartIndexIgnoreError, getCorefViewName, getEntitiesFromFile, getFillersFromFile, getMentionConstituent, getTokenOffsets, readEntitybuildEreConfig, buildEreXmlTextAnnotationMaker, buildXmlTextAnnotationMaker, buildXmlTextAnnotationMaker, getFileListing, getPostViewNamegetRequiredAnnotationFileExtension, getRequiredSourceFileExtension, initializeReadergetSourceDirectory, hasNext, nextiterator, removeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorforEachRemainingpublic EREMentionRelationReader(EREDocumentReader.EreCorpus ereCorpus, String corpusRoot, boolean throwExceptionOnXmlParseFailure) throws Exception
ereCorpus - the ERE corpus release (values from
EREDocumentReader.EreCorpusthrowExceptionOnXmlParseFailure - if 'true', throws exception if xml parser encounters e.g. mismatched
open/close tagsExceptionpublic EREMentionRelationReader(EREDocumentReader.EreCorpus ereCorpus, TextAnnotationBuilder taBuilder, String corpusRoot, boolean throwExceptionOnXmlParseFailure) throws Exception
ereCorpus - the ERE corpus release (values from
EREDocumentReader.EreCorpustaBuilder - TextAnnotationBuilder suited to target corpus (e.g. language other than English)throwExceptionOnXmlParseFailure - if 'true', throws exception if xml parser encounters e.g. mismatched
open/close tagsExceptionpublic void reset()
XmlDocumentReaderreset in interface IResetableIterator<XmlTextAnnotation>reset in class ERENerReaderpublic List<XmlTextAnnotation> getAnnotationsFromFile(List<Path> corpusFileListEntry) throws Exception
EREDocumentReaderEREDocumentReader.getFileListing() , parse its
contents and get zero or more TextAnnotation objects. This allows for the case where corpus
annotations are provided in standoff format in one or more files separate from the source
document. In such cases, the first file in the list should contain the source document
and the rest should be the corresponding markup files.
In this default implementation, it is assumed that a single file contains both source and markup.getAnnotationsFromFile in class ERENerReadercorpusFileListEntry - a list of files, the first of which is a source file.Exceptionpublic void readRelation(Node node, View view) throws XMLException
node - the entity node, contains the more specific mentions of that entity.view - the span label view we will add the labels to.XMLExceptionpublic String getMentionViewName()
getMentionViewName in class ERENerReaderpublic String generateReport()
generateReport in class ERENerReaderCopyright © 2017. All rights reserved.