Class DocumentSerializer

java.lang.Object
com.logicaldoc.ai.serializer.Serializer
com.logicaldoc.ai.serializer.DocumentSerializer

public class DocumentSerializer extends Serializer
An Serializer that uses Documents
Since:
9.2
Author:
Marco Meschieri - LogicalDOC
  • Constructor Details

    • DocumentSerializer

      public DocumentSerializer()
  • Method Details

    • loadTrainingData

      public InputStream loadTrainingData(AIModel<?,?> model) throws IOException, com.logicaldoc.core.PersistenceException
      Specified by:
      loadTrainingData in class Serializer
      Throws:
      IOException
      com.logicaldoc.core.PersistenceException
    • loadTrainedModel

      public InputStream loadTrainedModel(AIModel<?,?> model) throws IOException, com.logicaldoc.core.PersistenceException
      Specified by:
      loadTrainedModel in class Serializer
      Throws:
      IOException
      com.logicaldoc.core.PersistenceException
    • saveTrainingData

      public void saveTrainingData(AIModel<?,?> model, InputStream data) throws IOException, com.logicaldoc.core.PersistenceException
      Description copied from class: Serializer
      Saves the training data set, the input stream gets closed
      Specified by:
      saveTrainingData in class Serializer
      Parameters:
      model - The model
      data - The data to save
      Throws:
      IOException - Error storing the training data
      com.logicaldoc.core.PersistenceException - Error in the data layer
    • saveTrainedModel

      public void saveTrainedModel(AIModel<?,?> model, InputStream data) throws IOException, com.logicaldoc.core.PersistenceException
      Description copied from class: Serializer
      Saves the trained model, the input stream gets closed
      Specified by:
      saveTrainedModel in class Serializer
      Parameters:
      model - The model
      data - The data to save
      Throws:
      IOException - Error storing the model
      com.logicaldoc.core.PersistenceException - Error in the data layer
    • getFile

      public String getFile(AIModel<?,?> model, String suffix) throws IOException, com.logicaldoc.core.PersistenceException
      Description copied from class: Serializer
      Retrieves a reference (path, id or other) to a file used by the model
      Specified by:
      getFile in class Serializer
      Parameters:
      model - The model
      suffix - The file suffix
      Returns:
      the file's reference
      Throws:
      IOException - Error retrieving the file
      com.logicaldoc.core.PersistenceException - Error in the data layer