public class BasicInformationExtractionTrainer extends Object implements InformationExtractionTrainer
Modifier and Type | Class and Description |
---|---|
static class |
BasicInformationExtractionTrainer.MarkingTuple
MarkingTuple holds a tuple of position within a sentence and its label.
|
Modifier and Type | Field and Description |
---|---|
static String |
CRLF
Platform independent newline String.
|
static String |
INDENT
Amount to indent when depicting layered information.
|
Constructor and Description |
---|
BasicInformationExtractionTrainer()
Default constructor for an BasicInformationExtractionTrainer.
|
Modifier and Type | Method and Description |
---|---|
protected Document |
addClassifierTrainingDocument(InformationExtraction ext,
InformationExtractionOutcome confOutcome,
InformationExtractionTrainingSet tset)
Add a Classifier Document based on the confirmed outcome.
|
protected Document |
addConllRelationTrainingDocument(InformationExtraction ext,
InformationExtractionOutcome confOutcome,
InformationExtractionTrainingSet tset)
Add a CONLL Relation training Document based on the confirmed outcome.
|
protected Document |
addSpacyClassifierTrainingDocument(InformationExtraction ext,
InformationExtractionOutcome confOutcome,
InformationExtractionTrainingSet tset,
Document classfierDoc)
Add a Spacy Classifier Document based on the confirmed outcome.
|
void |
applyOverrideSettings()
Apply override settings.
|
static String |
determineClassifierTrainingContent(InformationExtraction ext,
InformationExtractionOutcome confOutcome)
Determine the contents to use for the Classifier Training document.
|
protected AccessControlList |
determineClassifierTrainingDocumentAcl(InformationExtraction ext)
Determine the ACL to use for the Classifier Training document.
|
protected String |
determineClassifierTrainingDocumentName(InformationExtraction ext)
Determine the Name to use for the Classifier Training document.
|
protected Folder |
determineClassifierTrainingDocumentParentFolder(InformationExtraction ext)
Determine the parent Folder to use for the Classifier Training document.
|
protected String |
determineConllRelationTrainingContent(InformationExtraction ext,
InformationExtractionOutcome confOutcome)
Determine the contents to use for the CONLL Relation Training document.
|
protected String |
determineConllRelationTrainingDocumentName(InformationExtraction ext)
Determine the Name to use for the CONLL relation Training document.
|
protected String |
determineSpacyClassifierTrainingDocumentName(InformationExtraction ext)
Determine the Name to use for the Spacy Classifier Training document.
|
InformationExtraction |
getInformationExtraction()
Gets the InformationExtraction being processed.
|
AttributeValueTable |
getSettings()
Gets the effective settings for the current parse.
|
void |
initialize(InformationExtractionTrainerSpecification spec)
Initialize this instance.
|
void |
invalidateTraining(InformationExtraction ext)
Performs invalidation of any training performed for the target InformationExtraction,
called after the InformationExtraction was confirmed and after training is performed
on the confirmed InformationExtraction.
|
void |
setInformationExtraction(InformationExtraction ext)
Sets the InformationExtraction being processed.
|
void |
train(InformationExtraction ext)
Update training models for a confirmed InformationExtraction outcome.
|
protected void |
updateTrainingModels(InformationExtraction ext,
InformationExtractionOutcome confOutcome)
Update the training models for an InformationExtraction with the specified
confirmed outcome.
|
public static final String CRLF
public static final String INDENT
public BasicInformationExtractionTrainer()
public void initialize(InformationExtractionTrainerSpecification spec) throws IfsException
Called immediately after construction (via the default constructor) and used so that the implementation can initialize session-independent state. This instance may be subsequently used concurrently by multiple threads and sessions. A session can be retrieved from the specification object, but it must not be cached. The specification also has the implementation and instance specific parameters which should be cached in a session independent way.
initialize
in interface InformationExtractionTrainer
spec
- The specification for a given implementation.IfsException
- if the operation fails.public AttributeValueTable getSettings()
public InformationExtraction getInformationExtraction()
public void setInformationExtraction(InformationExtraction ext)
ext
- the InformationExtraction being processedpublic void applyOverrideSettings() throws IfsException
IfsException
- if the operation failspublic void train(InformationExtraction ext) throws IfsException
train
in interface InformationExtractionTrainer
ext
- the target InformationExtractionIfsException
- if the operation failsprotected void updateTrainingModels(InformationExtraction ext, InformationExtractionOutcome confOutcome) throws IfsException
ext
- the target InformationExtractionconfOutcome
- the confirmed outcome of the InformationExtractionIfsException
- if the operation failsprotected Document addClassifierTrainingDocument(InformationExtraction ext, InformationExtractionOutcome confOutcome, InformationExtractionTrainingSet tset) throws IfsException
ext
- the target InformationExtractionconfOutcome
- the confirmed outcome of the InformationExtractiontset
- the training setIfsException
- if the operation failspublic static String determineClassifierTrainingContent(InformationExtraction ext, InformationExtractionOutcome confOutcome) throws IfsException
ext
- the InformationExtraction being preparedconfOutcome
- the confirmed outcome of the InformationExtractionIfsException
- if the operation failsprotected String determineClassifierTrainingDocumentName(InformationExtraction ext) throws IfsException
ext
- the InformationExtraction being preparedIfsException
- if the operation failsprotected AccessControlList determineClassifierTrainingDocumentAcl(InformationExtraction ext) throws IfsException
ext
- the InformationExtraction being preparedIfsException
- if the operation failsprotected Folder determineClassifierTrainingDocumentParentFolder(InformationExtraction ext) throws IfsException
ext
- the InformationExtraction being preparedIfsException
- if the operation failsprotected Document addSpacyClassifierTrainingDocument(InformationExtraction ext, InformationExtractionOutcome confOutcome, InformationExtractionTrainingSet tset, Document classfierDoc) throws IfsException
ext
- the target InformationExtractionconfOutcome
- the confirmed outcome of the InformationExtractiontset
- the training setclassfierDoc
- the regular classifier DocumentIfsException
- if the operation failsprotected String determineSpacyClassifierTrainingDocumentName(InformationExtraction ext) throws IfsException
ext
- the InformationExtraction being preparedIfsException
- if the operation failsprotected Document addConllRelationTrainingDocument(InformationExtraction ext, InformationExtractionOutcome confOutcome, InformationExtractionTrainingSet tset) throws IfsException
ext
- the target InformationExtractionconfOutcome
- the confirmed outcome of the InformationExtractiontset
- the training setIfsException
- if the operation failsprotected String determineConllRelationTrainingContent(InformationExtraction ext, InformationExtractionOutcome confOutcome) throws IfsException
ext
- the InformationExtraction being preparedconfOutcome
- the confirmed outcome of the InformationExtractionIfsException
- if the operation failsprotected String determineConllRelationTrainingDocumentName(InformationExtraction ext) throws IfsException
ext
- the InformationExtraction being preparedIfsException
- if the operation failspublic void invalidateTraining(InformationExtraction ext) throws IfsException
invalidateTraining
in interface InformationExtractionTrainer
ext
- the target InformationExtraction.IfsException
- if the operation fails.Copyright © 2023. All rights reserved.