public class EREMentionRelationReader extends ERENerReader
EREDocumentReader.EreCorpus
ends, IS_FOUND, starts
ARG_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, WAYS
fileId
fileList, sourceDirectory
corpusName, 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, readEntity
buildEreConfig, buildEreXmlTextAnnotationMaker, buildXmlTextAnnotationMaker, buildXmlTextAnnotationMaker, getFileListing, getPostViewName
getRequiredAnnotationFileExtension, getRequiredSourceFileExtension, initializeReader
getSourceDirectory, hasNext, next
iterator, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
public EREMentionRelationReader(EREDocumentReader.EreCorpus ereCorpus, String corpusRoot, boolean throwExceptionOnXmlParseFailure) throws Exception
ereCorpus
- the ERE corpus release (values from
EREDocumentReader.EreCorpus
throwExceptionOnXmlParseFailure
- if 'true', throws exception if xml parser encounters e.g. mismatched
open/close tagsException
public EREMentionRelationReader(EREDocumentReader.EreCorpus ereCorpus, TextAnnotationBuilder taBuilder, String corpusRoot, boolean throwExceptionOnXmlParseFailure) throws Exception
ereCorpus
- the ERE corpus release (values from
EREDocumentReader.EreCorpus
taBuilder
- 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 tagsException
public void reset()
XmlDocumentReader
reset
in interface IResetableIterator<XmlTextAnnotation>
reset
in class ERENerReader
public List<XmlTextAnnotation> getAnnotationsFromFile(List<Path> corpusFileListEntry) throws Exception
EREDocumentReader
EREDocumentReader.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 ERENerReader
corpusFileListEntry
- a list of files, the first of which is a source file.Exception
public 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.XMLException
public String getMentionViewName()
getMentionViewName
in class ERENerReader
public String generateReport()
generateReport
in class ERENerReader
Copyright © 2017. All rights reserved.