public class MentionAnnotator extends Annotator
| Modifier and Type | Class and Description |
|---|---|
static class |
MentionAnnotator.Builder |
| Modifier and Type | Field and Description |
|---|---|
protected Resource |
bestModel |
protected static org.slf4j.Logger |
log |
components, it, provenance, tagger| Constructor and Description |
|---|
MentionAnnotator() |
MentionAnnotator(Tagger root) |
| Modifier and Type | Method and Description |
|---|---|
void |
annotate(Collection<Document> docs) |
protected void |
createAnnotations(Iterable<Document> docs,
Annotation.Source expected) |
protected void |
createTags(Iterable<Document> docs,
Annotation.Source expected) |
MentionTagger |
getTagger() |
String |
toString() |
void |
trainModel(Collection<Sentence> sentences,
Annotation.Source tagSource,
WordHelpers.Language lang)
Trains the NER model using selected Sentences (BIO2Tags are required and will not be generated)
|
void |
trainModel(Dataset train,
Annotation.Source annotationSource,
WordHelpers.Language lang) |
void |
trainModel(Dataset train,
Annotation.Source annotationSource,
WordHelpers.Language lang,
int limitExamples,
boolean incremental,
boolean randomize)
Trains the NER model using a complete Dataset with MentionAnnotations
|
void |
trainModel(Dataset train,
Dataset test,
WordHelpers.Language lang) |
void |
trainModelEarlyStopping(Dataset train,
Dataset validation,
Annotation.Source annotationSource,
WordHelpers.Language lang,
int epochSize,
int minEpochs,
int maxEpochs,
int maxEpochsWithNoImprovement) |
void |
writeBestModel(Resource path,
String name)
Writes
|
addComponent, annotate, annotate, annotate, createDataset, createDocument, getComponent, getProvenance, isModelAvailable, isModelAvailableInChildren, readModel, trainModel, writeComponents, writeHTML, writeModel, writeModel, writeTestLog, writeTrainLogprotected static final org.slf4j.Logger log
protected Resource bestModel
public MentionAnnotator()
public MentionAnnotator(Tagger root)
public MentionTagger getTagger()
public void annotate(Collection<Document> docs)
public void trainModel(Dataset train, Dataset test, WordHelpers.Language lang)
public void trainModel(Dataset train, Annotation.Source annotationSource, WordHelpers.Language lang)
public void trainModel(Dataset train, Annotation.Source annotationSource, WordHelpers.Language lang, int limitExamples, boolean incremental, boolean randomize)
train - - dataset do use for trainingannotationSource - - use MentionAnnotations of given source to create tagslang - - language used for preprocessinglimitExamples - - use only n examples for training (after randomization), -1 for all examplesincremental - - don't reset the model before trainingrandomize - - randomize examples after each epochpublic void trainModelEarlyStopping(Dataset train, Dataset validation, Annotation.Source annotationSource, WordHelpers.Language lang, int epochSize, int minEpochs, int maxEpochs, int maxEpochsWithNoImprovement)
public void writeBestModel(Resource path, String name) throws IOException
path - Directory to write toIOExceptionpublic void trainModel(Collection<Sentence> sentences, Annotation.Source tagSource, WordHelpers.Language lang)
sentences - tagSource - lang - protected void createTags(Iterable<Document> docs, Annotation.Source expected)
protected void createAnnotations(Iterable<Document> docs, Annotation.Source expected)
Copyright © 2020. All rights reserved.