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

Download Bidaf Elmo model? #2019

Closed nihiluis closed 6 years ago

nihiluis commented 6 years ago

Can I download the Bidaf elmo models somewhere?

Like this simple Bidaf model (machine comprehension): https://s3-us-west-2.amazonaws.com/allennlp/models/bidaf-model-2017.09.15-charpad.tar.gz

I found some pre trained models at the bottom of https://github.com/allenai/document-qa, but they dont seem to be compatible with Predictor.load_archive (they only have best weights and no config.json).

DeNeutoy commented 6 years ago

We haven't trained this, sorry.

nihiluis commented 6 years ago

ah I thought you might have, since it's on the leaderboard. thanks

HarshTrivedi commented 5 years ago

Hi @DeNeutoy ! Any updates here? I want to use trained model corresponding to this config. I can train it with that config, but if there is a hosted model it would save me some time : )

nelson-liu commented 5 years ago

@HarshTrivedi i've trained a model with that config, and i can send it to you in the meanwhile (give me a few minutes, though). @DeNeutoy do we want to host this somewhere?

HarshTrivedi commented 5 years ago

@nelson-liu That's great! Thank You! 👍

matt-gardner commented 5 years ago

@nelson-liu, we should definitely host it. Do you have permissions to add things to the S3 bucket? Also, there's a file somewhere that has a list of all of our hosted models, and this should be added to it (and any others you've trained that we're missing in that file / the S3 bucket)

nelson-liu commented 5 years ago

@HarshTrivedi see if this works for you: https://s3.us-west-2.amazonaws.com/allennlp/models/bidaf-elmo-model-2018.11.30-charpad.tar.gz

@matt-gardner ok, i'll follow up on this in a different issue / PR.

HarshTrivedi commented 5 years ago

@nelson-liu Thanks again!

faizan30 commented 5 years ago

Hi @nelson-liu , thanks for the new model. What are the metrics for the model? Can it be found from Predictor?

nelson-liu commented 5 years ago

@faizan86 you can rerun the evaluation with:

allennlp evaluate \
    https://s3.us-west-2.amazonaws.com/allennlp/models/bidaf-elmo-model-2018.11.30-charpad.tar.gz \
    https://s3-us-west-2.amazonaws.com/allennlp/datasets/squad/squad-dev-v1.1.json

i get:

2018-12-13 10:55:14,443 - INFO - allennlp.commands.evaluate - Finished evaluating.
2018-12-13 10:55:14,443 - INFO - allennlp.commands.evaluate - Metrics:
2018-12-13 10:55:14,443 - INFO - allennlp.commands.evaluate - start_acc: 0.6660359508041628
2018-12-13 10:55:14,443 - INFO - allennlp.commands.evaluate - end_acc: 0.6951750236518448
2018-12-13 10:55:14,443 - INFO - allennlp.commands.evaluate - span_acc: 0.5757805108798486
2018-12-13 10:55:14,443 - INFO - allennlp.commands.evaluate - em: 0.7157048249763481
2018-12-13 10:55:14,443 - INFO - allennlp.commands.evaluate - f1: 0.806731018961626
faizan30 commented 5 years ago

Thanks @nelson-liu

gpsbaroli commented 4 years ago

Hi

Greeting of the day!

I am using allennlp for get correct answer from paragraph and using this way.

from allennlp.predictors.predictor import Predictor predictor = Predictor.from_path("bidaf-model-2017.09.15-charpad") passage = [CONTENT] result=predictor.predict( passage=passage, question="How does the coronavirus disease spread?" ) result['best_span_str']

Please let me know how can I train model.