Package com.logicaldoc.ai.serializer
Class DocumentSerializer
java.lang.Object
com.logicaldoc.ai.serializer.Serializer
com.logicaldoc.ai.serializer.DocumentSerializer
An
Serializer
that uses Document
s- Since:
- 9.2
- Author:
- Marco Meschieri - LogicalDOC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a reference (path, id or other) to a file used by the modelloadTrainedModel
(AIModel<?, ?> model) loadTrainingData
(AIModel<?, ?> model) void
saveTrainedModel
(AIModel<?, ?> model, InputStream data) Saves the trained model, the input stream gets closedvoid
saveTrainingData
(AIModel<?, ?> model, InputStream data) Saves the training data set, the input stream gets closedMethods inherited from class com.logicaldoc.ai.serializer.Serializer
exportModel, importModel
-
Constructor Details
-
DocumentSerializer
public DocumentSerializer()
-
-
Method Details
-
loadTrainingData
public InputStream loadTrainingData(AIModel<?, ?> model) throws IOException, com.logicaldoc.core.PersistenceException- Specified by:
loadTrainingData
in classSerializer
- Throws:
IOException
com.logicaldoc.core.PersistenceException
-
loadTrainedModel
public InputStream loadTrainedModel(AIModel<?, ?> model) throws IOException, com.logicaldoc.core.PersistenceException- Specified by:
loadTrainedModel
in classSerializer
- Throws:
IOException
com.logicaldoc.core.PersistenceException
-
saveTrainingData
public void saveTrainingData(AIModel<?, ?> model, InputStream data) throws IOException, com.logicaldoc.core.PersistenceExceptionDescription copied from class:Serializer
Saves the training data set, the input stream gets closed- Specified by:
saveTrainingData
in classSerializer
- Parameters:
model
- The modeldata
- The data to save- Throws:
IOException
- Error storing the training datacom.logicaldoc.core.PersistenceException
- Error in the data layer
-
saveTrainedModel
public void saveTrainedModel(AIModel<?, ?> model, InputStream data) throws IOException, com.logicaldoc.core.PersistenceExceptionDescription copied from class:Serializer
Saves the trained model, the input stream gets closed- Specified by:
saveTrainedModel
in classSerializer
- Parameters:
model
- The modeldata
- The data to save- Throws:
IOException
- Error storing the modelcom.logicaldoc.core.PersistenceException
- Error in the data layer
-
getFile
public String getFile(AIModel<?, ?> model, String suffix) throws IOException, com.logicaldoc.core.PersistenceExceptionDescription copied from class:Serializer
Retrieves a reference (path, id or other) to a file used by the model- Specified by:
getFile
in classSerializer
- Parameters:
model
- The modelsuffix
- The file suffix- Returns:
- the file's reference
- Throws:
IOException
- Error retrieving the filecom.logicaldoc.core.PersistenceException
- Error in the data layer
-