REBERTPredict
Synopsis
Binary relation extraction using RE-BERT .
This module is experimental.
Description
REBERTPredict classifies candidate binary relations with ensemble models finetuned with RE-BERT /
Candidate relations can be either asserted by specifying tuples of a relation, or generated by specifying the set of subject and object arguments, or a combination of both.
assertedCandidates specifies the elements corresponding to asserted candidates. Arguments are specified with assertedSubject and assertedObject .
candidateGenerationScope specifies the scope of generated andidates, e.g. documents or sentences. The list of elements corresponding the arguments are specified with generatedSubjects and generatedObjects . For each scope, REBERTPredict will generate a candidate for all combinations of subject and object.
The selection of the model is specified with modelType ( bert , biobert , or scibert ) and finetunedModel . ensembleNumber is the number of models used to make a prediction, ensembleNumber must be less or equal than the number of finetuned models. The final prediction is aggregated by vote.
REBERTPredict stores the prediction in labelFeature either in the asserted candidate, or a new tuple for generated candidates. REBERTPredict does not create tuples for negative predictions unless createNegativeTuples .
Snippet
<rebertpredict class="REBERTPredict">
<finetunedModel></finetunedModel>
<modelType></modelType>
<rebertDir></rebertDir>
</rebertpredict>
Mandatory parameters
finetunedModel
Path to the directory containing the models finetuned with RE-BERT.
modelType
BERT variant ( bert , biobert , scibert ).
rebertDir
Path to RE-BERT directory.
Optional parameters
assertedCandidates
Asserted candidates. The expression is evaluatd as a list of elements from the corpus.
assertedObject
Object (right) argument of asserted candidates. The expression is evaluated as a single element from the asserted candidate element (see assertedCandidates ).
assertedSubject
Subject (left) argument of asserted candidates. The expression is evaluated as a single element from the asserted candidate element (see assertedCandidates ).
candidateGenerationScope
Scopes for the generated candidates. The expression is evaluated as a list of elements from the corpus.
conda
Path to a conda executable. If not set, then REBERTPredict uses the conda from the environment PATH.
condaEnvironment
Name of the conda environment. If this parameter is set, then RE-BERT will be executed under a Conda environment.
constantRelationFeatures
Constant features to add to each relation created by this module.
constantTupleFeatures
Constant features to add to each tuple created by this module.
ensembleModels
Models to use for the prediction. Either this parameter or ensembleNumber is mandatory (and mutually exclusive).
explainFeaturePrefix
Prefix for additional features ( e.g. number of votes, probability).
generatedObjects
Object (right) arguments of generated candidates within a scope. This expression is evaluated as a list of elements from the scope element.
generatedSubjects
Subject (left) arguments of generated candidates within a scope. This expression is evaluated as a list of elements from the scope element.
python
Path to the Python interpreter. If not set, then REBERTPredict will use the Python interpreter from the PATH environment variable.
relation
Name of the relation for generated candidates.
aggregator
Aggregation method of predictions of all ensemble models. Only vote is available.
createAssertedTuples
If set to true , then REBERTPredict creates a tuple even for asserted candidates. labelFeature will be set on the created tuple instead of the asserted candidate element.
createNegativeTuples
If set to true , then REBERTPredict creates a tuple even for generated candidates predicted as negative.
end
End position of candidates (asserted and generated). This expression is evaluated as an integer from the candidate element.
ensembleNumber
Number of models that make a prediction. The value must be lower or equal to the number of models finetuned. Either this parameter or ensembleModels is mandatory (and mutually exclusive).
labelFeature
Feature where to store the predicted category.
negativeCategory
Category that is considered negative (no relation).
objectRole
Name of the object (right) argument in tuples created for generated candidates.
sentenceLayer
Layer containing sentences.
start
Start position of candidates (asserted and generated). This expression is evaluated as an integer from the candidate element.
subjectRole
Name of the subject (left) argument in tuples created for generated candidates.
useGPU
Use GPU instead of CPU.
Deprecated parameters
relationName
Deprecated alias for relation .