allenai / allennlp

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

Where could i download the codes about different models of ALLennlp? #3007

Closed TianlinZhang668 closed 5 years ago

TianlinZhang668 commented 5 years ago

Where could i download the codes about different models of ALLennlp?

brendan-ai2 commented 5 years ago

Hi @18222278799. The source code for our models is located in https://github.com/allenai/allennlp/tree/master/allennlp/models, but I may be misunderstanding your question. Please let me know if that doesn't answer it!

TianlinZhang668 commented 5 years ago

i cannot find the source code of Open inforamtion extraction.Thank you

guoquan commented 5 years ago

It seems this thread #2840 would be helpful.

TianlinZhang668 commented 5 years ago

Thank you , But the code is gabrielStanovsky/supervised-oie. Is there an implementation in AllenNLP

guoquan commented 5 years ago

If you take a look at @gabrielStanovsky 's repos, you will find it direct you to this instruction https://allennlp.org/models#open-information-extraction, which further indicates what should you search for in this repos. I guess they have a register open-information-extraction, what would reveal more details.

brendan-ai2 commented 5 years ago

If you open the model archive and for the Open IE model (https://s3-us-west-2.amazonaws.com/allennlp/models/openie-model.2018-08-20.tar.gz, linked from https://allennlp.org/models) you'll find the following in config.json:

    "model": {
        "type": "srl",
        ...

Searching for register("srl") on AllenNLP's Github pulls up the corresponding registration: https://github.com/allenai/allennlp/blob/master/allennlp/models/semantic_role_labeler.py#L20

That should be the source code you're looking for.

gabrielStanovsky commented 5 years ago

Hi @18222278799, as @brendan-ai2 pointed out, the code for the implementation of Open IE uses the model architecture of SRL, with a different predictor: https://github.com/allenai/allennlp/blob/master/allennlp/predictors/open_information_extraction.py

Hope this helps!