allennlp.common.checks.ConfigurationError: 'You cannot construct a Batch with non-homogeneous Instances.
Is occurring due to the TargetSentiment dataset reader returning batches where some have instances that do contain categories where as others do not contain categories. This is all due to the dataset reader being too flexible with what it allows the dataset to contain and what it takes from it. The get around for now is too specify if you want the categories or not, however there will be issues the other way if you want to predict categories only and sometimes it has targets and sometimes it does not.
Therefore the optimal solution to this would probably see if they exist in the instance and if not create an empty field to get around the issue and pass the problem downstream to the model(s).
This error:
Is occurring due to the TargetSentiment dataset reader returning batches where some have instances that do contain categories where as others do not contain categories. This is all due to the dataset reader being too flexible with what it allows the dataset to contain and what it takes from it. The get around for now is too specify if you want the categories or not, however there will be issues the other way if you want to predict categories only and sometimes it has targets and sometimes it does not.
Therefore the optimal solution to this would probably see if they exist in the instance and if not create an empty field to get around the issue and pass the problem downstream to the model(s).