private List<String> buildMarianCommand(String configPath, File input, File output,
                                            String device) {
        List<String> command = new ArrayList<>();
        command.add(Paths.get(marianPath).toString());
        command.add("-c");
        command.add(configPath);
        command.add("-i");
        command.add(input.getAbsolutePath());
        command.add("-o");
        command.add(output.getAbsolutePath());
        if (device.equalsIgnoreCase("cpu")) {
            command.add("--cpu-threads");
            command.add(config.getProperty("translator.marian.device.cpuThreads", "1"));
        }
        return command;
    }
Builds the Marian NMT Command for the configuration.

@param configPath the path to the configuration file
@param input      the input file location
@param output     the output file location
@param device     the device for inference (i.e. cpu or gpu)
@return the command to be executed.
tika-translate/src/main/java/org/apache/tika/language/translate/impl/MarianTranslator.java