Skip to main content
Version: 10.3

Execute model

To check model quality, prepare a test set of documents and run the execution process. ModelEvaluationRunner.java contains logic similar to that of the training runner. Once the execution process is finished, model results are available in the output directory.

Statistics are located in /outputDir/statistics.csv and contain information about what actually was extracted by the model against what was expected. For more information about runners, see the Run local test execution page.

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;

import com.workfusion.vds.sdk.run.ModelRunner;
import com.workfusion.vds.sdk.run.config.LocalExecutionConfiguration;

public class ModelExecutionRunner {

public static void main(String[] args) throws Exception {
System.setProperty("WORKFLOW_LOG_FOLDER", "./logs/");

//TODO put correct values for the paths
Path trainedModelPath = Paths.get("model/train/training/output/model");
Path inputDirPath = Paths.get("model/docs");
Path outputDirPath = Paths.get("model/extract");

//TODO add parameters if needed.
Map<String, Object> parameters = new HashMap<>();

LocalExecutionConfiguration configuration = LocalExecutionConfiguration.builder()
.inputDir(inputDirPath)
.outputDir(outputDirPath)
.trainedModelDir(trainedModelPath)
.parameters(parameters)
.build();

ModelRunner.run(IeModelModel.class, configuration);
}
}
troubleshooting

For troubleshooting tips, refer to Issues related to OCR results quality.