starling-lab / BoostSRL

BoostSRL: "Boosting for Statistical Relational Learning." A gradient-boosting based approach for learning different types of SRL models.
https://starling.utdallas.edu
GNU General Public License v3.0
32 stars 21 forks source link

Question about variable instantiation #21

Open brenowca opened 6 years ago

brenowca commented 6 years ago

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

boost-starai commented 6 years ago

Could you please provide an example of what you want to learn?

On Jul 12, 2018, at 11:43 AM, brenocarvalho notifications@github.com<mailto:notifications@github.com> wrote:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/starling-lab/BoostSRL/issues/21, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXip1fIoeajJ76fgKUA1cYucZ-apyKILks5uF3y3gaJpZM4VNW_d.

mayukhdas commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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.