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 132 forks source link

Enable creating multiple encoders of one type #175

Closed nelson-liu closed 7 years ago

nelson-liu commented 7 years ago

Before this PR, it was not possible to make two *_encoders (more concretely, it would not be possible to make two separate sentence_encoders that had different parameters). This PR attempts to change that by adopting a similar interface to how embedding layers are handled --- storing them in a dictionary where the key is the "type" of encoder.

@matt-gardner I have no idea if I did this properly, it's quite likely that the changes aren't far-reaching enough (i.e. I forgot to change something somewhere or consider some case).

This needs to work in order to implement the Gated Attention Reader.