I tried to use allennlp.predictors.Predictor.get_gradients to get the gradients of an instance.
The main code:
for instance in targeted_dev_data:
predic