Open sandeep82945 opened 4 years ago
Was facing the same problem...
You can create a scripts/predict.sh
bash file as below, and then sh scripts/predict.sh
it. That would be running the code in the sequential_sentence_classification/predictor.py
file.
allennlp predict \
/path/to/model.tar.gz \
data/CSAbstruct/test.jsonl \
--include-package sequential_sentence_classification \
--predictor SeqClassificationPredictor
/path/to/model.tar.gz
is the directory pointing to the trained model (i.e., trained by the script in scripts/train.sh
).
Tried but getting error
Traceback (most recent call last):
File "/usr/local/bin/allennlp", line 33, in
It also helped me to modify the predict_json
method to suit my data (and remove the abstract_id=0
argument) and it also helped me to look at <install path>/allennlp/commands/predict.py
to figure out how prediction loops are run on the data and command line arguments and such.
It will be very helpful, if you let know how to use trained model to predict on new data. There is prediction.py , how there is no description or steps to be followed to run this. Thanks.