Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about variable instantiation #21

Open
brenowca opened this issue Jul 12, 2018 · 6 comments
Open

Question about variable instantiation #21

brenowca opened this issue Jul 12, 2018 · 6 comments

Comments

@brenowca
Copy link

Is there a way to force RDNBoost to always initialize a variable in the head of the rules?

@brenowca brenowca changed the title Question about output variables in the head Question about variable instantiation Jul 12, 2018
@boost-starai
Copy link
Contributor

boost-starai commented Jul 12, 2018 via email

@mayukhdas
Copy link
Contributor

Variables in the head are instantiated with the constants from every example (positive or negative), as it iterates through all the examples. Do you need them to be instantiated with only one particular constant always?

@brenowca
Copy link
Author

brenowca commented Jul 12, 2018

I am trying to learn frame_element_anno.

My bk file looks like this:

//...
mode: frame_element(+val,+val).
mode: frame_element(-val,+val).

mode: frame_anno(+sent,-const,-const,-val).
mode: frame_element_anno(+sent,-const,-const,-val,+val).

//...

Some of the rules I get from the system are the following:

(frame_element_anno(A, B, C, _, D, 6.506634699773212) :-  /* #neg=4 #pos=40 */ frame_anno(A, C, B, _), frame_anno(A, UniqueVar22, UniqueVar22, D), pos_verb(A, UniqueVar22, _), amod(A, UniqueVar22, B), !)
(frame_element_anno(A, B, C, _, D, 0.8655291266050814) :-  /* #neg=180 #pos=40 */ frame_anno(A, C, B, _), frame_anno(A, UniqueVar23, UniqueVar23, D), pos_verb(A, UniqueVar23, _), !)
(frame_element_anno(A, B, C, _, D, 4.14249832962458) :-  /* #neg=283 #pos=937 */ frame_anno(A, C, B, _), frame_anno(A, UniqueVar24, UniqueVar24, D), !)
(frame_element_anno(A, B, C, _, _, -0.5778185887657344) :-  /* #neg=38 */ frame_anno(A, C, B, _), !)
(frame_element_anno(A, B, C, D, _, 6.111280501980634) :-  /* #neg=8 #pos=31 */ pos_det(A, _, _), pos_verb(A, B, _), frame_element(D, D), frame_anno(A, C, C, _), !)
(frame_element_anno(A, B, _, _, _, 2.7068565692738162) :-  /* #neg=156 #pos=108 */ pos_det(A, _, _), pos_verb(A, B, _), !)
(frame_element_anno(A, _, B, _, _, 5.175917441361119) :-  /* #neg=178 #pos=376 */ pos_det(A, _, _), dobj(A, B, _), !)
(frame_element_anno(A, _, _, _, _, 4.239200007320033) :-  /* #neg=1,032 #pos=1,581 */ pos_det(A, _, _), !)
(frame_element_anno(_, _, _, _, _, 5.375929918106315) :-  /* #neg=62 #pos=260 */ !)

I would like to have some rule with head frame_element_anno(A, B, C, D, E)

@mayukhdas
Copy link
Contributor

Yes if the the target predicate is frame_element_anno then ideally all the mode declaration should + for that predicate, since you wish to instantiate it with the example in question.
So, your mode should be mode: frame_element_anno(+sent,+const,+const,+val,+val).

@mayukhdas
Copy link
Contributor

mayukhdas commented Jul 12, 2018

Additionally an _ is a "don't care" condition. One could write and unique variable name in place of an _ , that will not matter when the rule is fired because there is no binding of "don't care" variables with any other variable. So "_" is essentially a variable, but without binding.

@brenowca
Copy link
Author

Gotcha, thank you :)

Is there a way where I can set some initial nodes to always participate in the tree creation?

I want to experiment and see if some variable bindings actually make sense but were not detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants