I am working a class that inherits ConditionalRandomField class from allennlp_light.modules.conditional_random_field.
I think it would be more flexible if the allowed_transitions function is allowed to be imported like from allennlp_light.modules.conditional_random_field import allowed_transitions.
I did go through the original https://github.com/allenai/allennlp, they already did it.
allenai/allennlp#5695
allenai/allennlp#5697
allenai/allennlp#5706
Although this will be a small patch, I think there will be many parts we still can update and improve from time to time.
If you agree to update, I can PR this small change.