allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.76k stars 2.25k forks source link

Help Training Allennlp models on new data #1365

Closed dhairyadalal closed 6 years ago

dhairyadalal commented 6 years ago

I'd like to train the the allennlp bidaf implementation on the squad 2.0 dataset. Wondering if it possible to this programmatically? Or do can I only do it via the command line instructions in the readme?

joelgrus commented 6 years ago

yes, you can do it programmatically.

one simple way is as described here:

https://github.com/allenai/allennlp/blob/master/tutorials/how_to/using_a_debugger.md#how-to-debug-in-pycharm-using-run--debug

if you want to control the details further, you can import allennlp.commands.train.train_model and call that from your code, or even create your own equivalent that's even more customized

https://github.com/allenai/allennlp/blob/master/allennlp/commands/train.py#L224

matt-gardner commented 6 years ago

Note, though, that BiDAF won't work on SQuAD 2.0 without some modification, because it assumes the answer is always present. You either have to change the data to assign a consistent empty span when there is no answer (not sure that this would actually work, but you could try it), or add something to the model.

nelson-liu commented 6 years ago

Does bidaf even work with Squad 2.0? I haven’t looked at the data, but maybe they changed the format to support unanswerable questions?

dhairyadalal commented 6 years ago

I was think of updating it with changes suggested in Levy '17 - Zero-shot relation extraction via reading comprehension (BiDAF no answer). Is that appropriate?

murphp15 commented 6 years ago

@dhairyadalal I have just recently read that paper but I don't fully understand how the no answer part of this works. Is there any chance you could explain it to me ?

dhairyadalal commented 6 years ago

@murphp15 apologies for the late response. Just got back from vacation. I'm still working on getting a better understanding for what they did. Their implementation (in tensorflow) can be found here: https://bitbucket.org/omerlevy/bidaf_no_answer. Was planning on going through to see if I could get some clues.

Happy to talk more over email if its helpful (dhairya.b.dalal [at] gmail )

antoinecomp commented 6 years ago

@dhairyadalal @murphp15 I'm doing my Master dissertation thesis on the topic, I'm really interested about this discussion if you're still reviewing their algorithm.

Swathygsb commented 5 years ago

Hi All, I want to train bidaf model for my own data set along with squad dataset. In my Question Answer pairs, the answers are not single word and are mostly a passage containing multiple sentences. Should i change any configuration in bidaf.jsonnet to support it for Machine comprehension - BIdaf model?

rbhat03 commented 4 years ago

HI @Swathygsb I am looking for some similar requirement as urs... were u able to make any progress?

v-nhandt21 commented 4 years ago

Hi All, I want to train bidaf model for my own data set along with squad dataset. In my Question Answer pairs, the answers are not single word and are mostly a passage containing multiple sentences. Should i change any configuration in bidaf.jsonnet to support it for Machine comprehension - BIdaf model?

Can I have a question that when you train your model with Squad+your Data, what is your configuration? I mean the file json used for training includes Squad or not, or only your new data and weight provided from glove and elmo/squad