I´m using AllenNLP for a combined classifier (one of its task is NER tagging), and while designing some tests, I've come across this doubt: how do I access the values of the different fields of my AllenNLP instance? I want to compared them with the values introduced, to make sure nothing got lost in the preprocessing.
I managed to get to the text field of the instance using instance.__getitem__("text")
, but I dont know how to get the value from there, or if there is anything quicker directly from the Instance class.
What I'm trying to do is something like assert instance.getValueFromField("text) == training_dataset["text"][0]