Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Domain Language with side args execution bug #13

Open
nitishgupta opened this issue Apr 2, 2019 · 4 comments
Open

Domain Language with side args execution bug #13

nitishgupta opened this issue Apr 2, 2019 · 4 comments
Assignees

Comments

@nitishgupta
Copy link
Contributor

In my DomainLanguage if I have a @predicate without a side_arg, say

@predicate
def find_passageSpanAnswer(self, passage_attention: PA) -> PSA:

The grammar is made in the correct manner, i.e. the following production is added
'<PA:PSA> -> find_passageSpanAnswer'.
During execution if the side_args dictionary contains a key passage_attention that value is used instead which throws an error. I have tried by changing the argument's name in the predicate definition and the error disappears.

There seems to be a bug in execution with side_args.

@kernelmachine
Copy link

@yizhongw can you take a look at this?

@matt-gardner
Copy link
Contributor

Yizhong doesn't have context on this one. It'd be pretty easy for me to fix but I think that @nitishgupta could fix it also. Care to submit a PR for this, Nitish?

@nitishgupta
Copy link
Contributor Author

I haven't tried to trace the error, let me give it a shot and submit a PR asap.

@matt-gardner
Copy link
Contributor

Hmm, looking at this a little more, maybe it isn't so easy. The problem is here: https://github.com/allenai/allennlp/blob/53a46ab7227a7f4293030c06a1ad18d010e87d74/allennlp/semparse/domain_languages/domain_language.py#L566-L567. You need to only add the parameter to kwargs if the argument has been registered to the function as a side argument. I'm not sure off the top of my head how to fix this, and I'm on vacation, so I'm only doing a cursory look into this. I can fix it when I get back, or you can try; hopefully this was enough to get you started, if you want to look into it.

@matt-gardner matt-gardner self-assigned this Jun 13, 2019
@matt-gardner matt-gardner transferred this issue from allenai/allennlp Dec 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants