allenai / deep_qa

A deep NLP library, based on Keras / tf, focused on question answering (but useful for other NLP too)
Apache License 2.0
404 stars 133 forks source link

fix BiDAF set_max_lengths_from_model #243

Closed nelson-liu closed 7 years ago

nelson-liu commented 7 years ago

This fixes an error in the _set_max_lengths_from_model function. I think it clearly makes sense to pass self.model.get_input_shape_at(0)[1][1:], considering the words are at self.model.get_input_shape_at(0)[1][1].

I'd like to add a non-regression test to make sure that this issue doesn't come up again, but i'm not sure what sort of examples would be appropriate. thoughts?

matt-gardner commented 7 years ago

I think the right way to test this is to re-index the data after you load a model in the loading tests.

nelson-liu commented 7 years ago

@matt-gardner , think this is good to go?