Class RelationTypeFineTuner
java.lang.Object
eu.sealsproject.platform.res.tool.impl.AbstractPlugin
de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL
de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAA
de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAAJena
de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersBase
de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersBaseFineTuner
de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersFineTuner
de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.relationprediction.RelationTypeFineTuner
- All Implemented Interfaces:
Filter
,IMatcher<org.apache.jena.ontology.OntModel,
,Alignment, Properties> eu.sealsproject.platform.res.domain.omt.IOntologyMatchingToolBridge
,eu.sealsproject.platform.res.tool.api.IPlugin
,eu.sealsproject.platform.res.tool.api.IToolBridge
This matcher predicts the relation type given a transformer model.
This component do not create new correspondences but refine the relation of given class correspondences.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private static final String
Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersFineTuner
batchSizeOptimization
Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersBaseFineTuner
additionallySwitchSourceTarget, resultingModelLocation, trainingFile
Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersBase
cudaVisibleDevices, extractor, modelName, multipleTextsToMultipleExamples, multiProcessing, trainingArguments, transformersCache, usingTensorflow
Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX
-
Constructor Summary
ConstructorDescriptionRelationTypeFineTuner
(TextExtractorMap extractor, String modelName, File resultingModelLocation) RelationTypeFineTuner
(TextExtractor extractor, String modelName, File resultingModelLocation) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
writeRelationPredictionFormat
(org.apache.jena.rdf.model.Model model, Writer writer) int
writeTrainingFile
(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment trainingAlignment, File trainFile, boolean append) Writes the correspondences to a file (append or not can be chosen by a parameter).Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersFineTuner
addTrainingParameterToMakeTrainingFaster, finetuneModel, getBatchSizeOptimization, getMaximumPerDeviceTrainBatchSize, getMaximumPerDeviceTrainBatchSize, isAdjustMaxBatchSize, setAdjustMaxBatchSize, setBatchSizeOptimization
Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersBaseFineTuner
clearTrainingData, createTrainingFile, finetuneModel, getResultingModelLocation, getTrainingFile, isAdditionallySwitchSourceTarget, match, setAdditionallySwitchSourceTarget, setResultingModelLocation, writeClassificationFormat
Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_ml.python.nlptransformers.TransformersBase
addTrainingArgument, getCudaVisibleDevices, getCudaVisibleDevicesButOnlyOneGPU, getExamplesForBatchSizeOptimization, getExtractor, getExtractorMap, getModelName, getMultiProcessing, getTextualRepresentation, getTrainingArguments, getTransformersCache, isMultipleTextsToMultipleExamples, isOptimizeForMixedPrecisionTraining, isUsingTensorflow, setCudaVisibleDevices, setCudaVisibleDevices, setExtractor, setExtractorMap, setModelName, setMultipleTextsToMultipleExamples, setMultiProcessing, setOptimizeForMixedPrecisionTraining, setTrainingArguments, setTransformersCache, setUsingTensorflow, writeExamplesToFile
Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAAJena
getModelSpec, match, readOntology
Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_jena.MatcherYAAA
match
Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
match
Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL
align, align, canExecute, getType
Methods inherited from class eu.sealsproject.platform.res.tool.impl.AbstractPlugin
getId, getVersion, setId, setVersion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.sealsproject.platform.res.tool.api.IPlugin
getId, getVersion
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
NEWLINE
-
-
Constructor Details
-
RelationTypeFineTuner
public RelationTypeFineTuner(TextExtractor extractor, String modelName, File resultingModelLocation) -
RelationTypeFineTuner
public RelationTypeFineTuner(TextExtractorMap extractor, String modelName, File resultingModelLocation)
-
-
Method Details
-
writeTrainingFile
public int writeTrainingFile(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment trainingAlignment, File trainFile, boolean append) throws IOException Description copied from class:TransformersBaseFineTuner
Writes the correspondences to a file (append or not can be chosen by a parameter).- Overrides:
writeTrainingFile
in classTransformersBaseFineTuner
- Parameters:
source
- the source modeltarget
- the target modeltrainingAlignment
- the training alignment to be written to file.trainFile
- the file to write all textsappend
- true if all content should be appended to the file.- Returns:
- how many correspondences were written to the file.
- Throws:
IOException
- in case the writing fails
-
writeRelationPredictionFormat
protected int writeRelationPredictionFormat(org.apache.jena.rdf.model.Model model, Writer writer) throws IOException - Throws:
IOException
-