allennlp.commands.predictΒΆ

The predict subcommand allows you to make bulk JSON-to-JSON or dataset to JSON predictions using a trained model and its Predictor wrapper.

$ allennlp predict -h
usage: allennlp predict [-h] [--output-file OUTPUT_FILE]
                        [--weights-file WEIGHTS_FILE]
                        [--batch-size BATCH_SIZE] [--silent]
                        [--cuda-device CUDA_DEVICE] [--use-dataset-reader]
                        [-o OVERRIDES] [--predictor PREDICTOR]
                        [--include-package INCLUDE_PACKAGE]
                        archive_file input_file

Run the specified model against a JSON-lines input file.

positional arguments:
archive_file          the archived model to make predictions with
input_file            path to input file

optional arguments:
-h, --help              show this help message and exit
--output-file OUTPUT_FILE
                        path to output file
--weights-file WEIGHTS_FILE
                        a path that overrides which weights file to use
--batch-size BATCH_SIZE The batch size to use for processing
--silent                do not print output to stdout
--cuda-device CUDA_DEVICE
                        id of GPU to use (if any)
--use-dataset-reader    Whether to use the dataset reader of the original
                        model to load Instances
-o OVERRIDES, --overrides OVERRIDES
                        a JSON structure used to override the experiment
                        configuration
--predictor PREDICTOR   optionally specify a specific predictor to use
--include-package INCLUDE_PACKAGE
                        additional packages to include