Class GermEval2014NameSampleStream
java.lang.Object
opennlp.tools.formats.GermEval2014NameSampleStream
- All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>
@Internal
public class GermEval2014NameSampleStream
extends Object
implements opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>
Parser for the GermEval 2014 Named Entity Recognition Shared Task data.
The data is in a tab-separated format with four columns:
- Token index (1-based per sentence)
- Token text
- Outer named entity tag (IOB2 scheme)
- Nested/embedded named entity tag (IOB2 scheme)
# mark document boundaries and contain
source URL and date metadata. Blank lines separate sentences.
The data uses four main entity types: Person (PER), Location (LOC),
Organization (ORG) and Other (OTH), with additional deriv and
part suffixes for derived forms and name parts respectively.
Since NameSample does not support overlapping spans, this stream
requires selecting either the outer or
inner annotation layer via a GermEval2014NameSampleStream.NerLayer parameter.
Data can be found on this web site.
Note: Do not use this class, internal use only!
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSelects which NER annotation layer to read from the GermEval 2014 data. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionGermEval2014NameSampleStream(opennlp.tools.util.InputStreamFactory in, int types, GermEval2014NameSampleStream.NerLayer layer) Initializes aGermEval2014NameSampleStream.GermEval2014NameSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, int types, GermEval2014NameSampleStream.NerLayer layer) Initializes aGermEval2014NameSampleStream. -
Method Summary
-
Field Details
-
GENERATE_PERSON_ENTITIES
public static final int GENERATE_PERSON_ENTITIES- See Also:
-
GENERATE_ORGANIZATION_ENTITIES
public static final int GENERATE_ORGANIZATION_ENTITIES- See Also:
-
GENERATE_LOCATION_ENTITIES
public static final int GENERATE_LOCATION_ENTITIES- See Also:
-
GENERATE_MISC_ENTITIES
public static final int GENERATE_MISC_ENTITIES- See Also:
-
-
Constructor Details
-
GermEval2014NameSampleStream
public GermEval2014NameSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, int types, GermEval2014NameSampleStream.NerLayer layer) Initializes aGermEval2014NameSampleStream.- Parameters:
lineStream- AnObjectStreamover the lines in the GermEval 2014 data file.types- The entity types to include in the Name Sample object stream.layer- TheGermEval2014NameSampleStream.NerLayerto read.
-
GermEval2014NameSampleStream
public GermEval2014NameSampleStream(opennlp.tools.util.InputStreamFactory in, int types, GermEval2014NameSampleStream.NerLayer layer) throws IOException Initializes aGermEval2014NameSampleStream.- Parameters:
in- TheInputStreamFactoryfor the input file.types- The entity types to include in the Name Sample object stream.layer- TheGermEval2014NameSampleStream.NerLayerto read.- Throws:
IOException- Thrown if IO errors occurred.
-
-
Method Details
-
read
- Specified by:
readin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>- Throws:
IOException
-
reset
- Specified by:
resetin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>- Throws:
IOExceptionUnsupportedOperationException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceopennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>- Throws:
IOException
-