Topic
  • 12 replies
  • Latest Post - ‏2012-09-11T11:15:19Z by OlgaLind
OlgaLind
OlgaLind
34 Posts

Pinned topic aggregate rules execution ordering

‏2012-09-05T10:06:23Z |
Hi,

Did someone face the issue of aggregate rules execution ordering? How does the ruleset influence the ordering? I mean, how does the studio define which ruleset to execute first? Are there any other ways, beside rulesets, to set up the aggregate rules exacution ordering?
Updated on 2012-09-11T11:15:19Z at 2012-09-11T11:15:19Z by OlgaLind
  • SystemAdmin
    SystemAdmin
    197 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-06T11:04:21Z  
    Hi,

    Rules ordering is quite a complicated internal process.

    The Ruleset stops rules from affecting and breaking each other if they are from different rulesests. It also allows rules from the same Ruleset to interact with each other.

    Usually Rules are built up on each other, so if rule_1 creates an annotation, and this annotation is used by rule_2, then rule_1 will run before Rule_2.
    If you want some rules to run after of before another set of rules, you can create them in separate Databases, and you order the rules jars in the parsing stage as you want.

    From experience, before creating any rules, you should break down your model into its components, and create building blocks that will work together so the rules are created in the relevant order.

    Hope this helps.
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-07T13:19:38Z  
    Hi,

    Rules ordering is quite a complicated internal process.

    The Ruleset stops rules from affecting and breaking each other if they are from different rulesests. It also allows rules from the same Ruleset to interact with each other.

    Usually Rules are built up on each other, so if rule_1 creates an annotation, and this annotation is used by rule_2, then rule_1 will run before Rule_2.
    If you want some rules to run after of before another set of rules, you can create them in separate Databases, and you order the rules jars in the parsing stage as you want.

    From experience, before creating any rules, you should break down your model into its components, and create building blocks that will work together so the rules are created in the relevant order.

    Hope this helps.
    Thanks, I will play with rulesets and annotators more.
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-07T13:23:12Z  
    Hi,

    Rules ordering is quite a complicated internal process.

    The Ruleset stops rules from affecting and breaking each other if they are from different rulesests. It also allows rules from the same Ruleset to interact with each other.

    Usually Rules are built up on each other, so if rule_1 creates an annotation, and this annotation is used by rule_2, then rule_1 will run before Rule_2.
    If you want some rules to run after of before another set of rules, you can create them in separate Databases, and you order the rules jars in the parsing stage as you want.

    From experience, before creating any rules, you should break down your model into its components, and create building blocks that will work together so the rules are created in the relevant order.

    Hope this helps.
    Actually, the issue that I have is the following. I have a sentence:

    "Product X doesn't have a great feature", where "great feature" is annotated as PositiveDescription.
    But obviuosly in this context it is not a PositiveDescription , so I have another rule, which cancels PositiveDescription annotation with "doesn't have".

    And then I want to annotate "doesn't have" + PositiveDescription as NegativeDescription, but I can't do that, because PositiveDescription doesn't exist anymore in this sentence, as it was cancelled before. Are there any ways to annotate "doesn't have" + PositiveDescription as NegativeDescription with simultaneous cancellation of PositiveDescription? Can the correct usage of rulesets help with this issue?
  • SystemAdmin
    SystemAdmin
    197 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-07T14:41:41Z  
    You can do all this in a single rule.
    You select "doesn't have" + PositiveDescription", you annotate the whole thing as NegativeDescription, and then you delete the "PositiveDescription" (in the Annotation Tab, right click on the PositiveDescription annotation and select delete annotation).
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-10T13:16:57Z  
    You can do all this in a single rule.
    You select "doesn't have" + PositiveDescription", you annotate the whole thing as NegativeDescription, and then you delete the "PositiveDescription" (in the Annotation Tab, right click on the PositiveDescription annotation and select delete annotation).
    Thanks a lot for your tip. But If I delete "PositiveDescription" in Annotation Tab, then there will be only "doesn't have" part of phraze matched in the document, but I need the whole "doesn't have" + PositiveDescription" phraze to be matched. Do I miss something?
  • SystemAdmin
    SystemAdmin
    197 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-10T14:15:55Z  
    • OlgaLind
    • ‏2012-09-10T13:16:57Z
    Thanks a lot for your tip. But If I delete "PositiveDescription" in Annotation Tab, then there will be only "doesn't have" part of phraze matched in the document, but I need the whole "doesn't have" + PositiveDescription" phraze to be matched. Do I miss something?
    This shouldn't happen. Could you please tell me what you are doing exactly?
    The way this should be done is:
    • you annotate "great features" as PositiveDescription.
    • Compile your rules.
    • Drag and drop the "Product X doesn't have a great feature" sentence into the selection Tab.
    • In the Annotation Tab, Create a new annotation called "PositiveDescription", that covers the two nodes (negation and Positive Description (make sure you select the two nodes, so they both are annotated) and then delete the old PositiveDescription.

    If it doesn't work, please describe exactly what you are doing, and provide screenshots with the rules so I can help you.
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-11T06:10:50Z  
    This shouldn't happen. Could you please tell me what you are doing exactly?
    The way this should be done is:
    • you annotate "great features" as PositiveDescription.
    • Compile your rules.
    • Drag and drop the "Product X doesn't have a great feature" sentence into the selection Tab.
    • In the Annotation Tab, Create a new annotation called "PositiveDescription", that covers the two nodes (negation and Positive Description (make sure you select the two nodes, so they both are annotated) and then delete the old PositiveDescription.

    If it doesn't work, please describe exactly what you are doing, and provide screenshots with the rules so I can help you.
    This is what I'm doing:

    1) Annotate "great feature" as phrase rule "PositiveDescription";
    2) Compile my rules, and the result is on Sample1.png;
    3) Create a new aggregate rule "NegativeDescription" (not by dragging the phraze, but by using "Add" menu), which says "doesn't" + "PositiveDescription" = "NegativeDescription". I create a correspondent annotation (Sample2.png), then delete "PositiveDescription" from this annotation (Sample3.png);
    4) As a result, you can see that "PositiveDescription" isn't being annotated in this sentence anymore, but only "doesn't" is annotated as "NegativeDescription" (Sample4.png).
    The issue is that I need the whole phrase "doesn't have a great feature" to be annotated as "NegativeDescription".

    Thank you.
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-11T06:12:38Z  
    This shouldn't happen. Could you please tell me what you are doing exactly?
    The way this should be done is:
    • you annotate "great features" as PositiveDescription.
    • Compile your rules.
    • Drag and drop the "Product X doesn't have a great feature" sentence into the selection Tab.
    • In the Annotation Tab, Create a new annotation called "PositiveDescription", that covers the two nodes (negation and Positive Description (make sure you select the two nodes, so they both are annotated) and then delete the old PositiveDescription.

    If it doesn't work, please describe exactly what you are doing, and provide screenshots with the rules so I can help you.
    Oops, it looks like I can attach only one file in one post. Please look at the next posts for other screenshots.
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-11T06:13:15Z  
    This shouldn't happen. Could you please tell me what you are doing exactly?
    The way this should be done is:
    • you annotate "great features" as PositiveDescription.
    • Compile your rules.
    • Drag and drop the "Product X doesn't have a great feature" sentence into the selection Tab.
    • In the Annotation Tab, Create a new annotation called "PositiveDescription", that covers the two nodes (negation and Positive Description (make sure you select the two nodes, so they both are annotated) and then delete the old PositiveDescription.

    If it doesn't work, please describe exactly what you are doing, and provide screenshots with the rules so I can help you.
    Here is Sample3.png
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-11T06:14:15Z  
    This shouldn't happen. Could you please tell me what you are doing exactly?
    The way this should be done is:
    • you annotate "great features" as PositiveDescription.
    • Compile your rules.
    • Drag and drop the "Product X doesn't have a great feature" sentence into the selection Tab.
    • In the Annotation Tab, Create a new annotation called "PositiveDescription", that covers the two nodes (negation and Positive Description (make sure you select the two nodes, so they both are annotated) and then delete the old PositiveDescription.

    If it doesn't work, please describe exactly what you are doing, and provide screenshots with the rules so I can help you.
    Here is Sample4.png
  • SystemAdmin
    SystemAdmin
    197 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-11T09:50:18Z  
    • OlgaLind
    • ‏2012-09-11T06:14:15Z
    Here is Sample4.png
    OK, I see what is happening there.
    I am not sure if this is a bug, I will check with the developers.
    There is a workaround to do this, when you create the rule, create it by dragging the text, rather than using the combo box. You should have the sub-tree after you remove the annotation. (please see the attachment, the Types names are different from the ones you are using, but they should convey the meaning).

    On another point, in this case (negation), you should use phrase rules instead of an aggregate. You can have a long sentence which contains a negation at the beginning, and at the end of it you have the positive phrase:
    Example: This phone doesn't have a complicated UI, but it has great features.
    You can have some optional tokens between the negation and the positive phrase (between 0 and 3).
  • OlgaLind
    OlgaLind
    34 Posts

    Re: aggregate rules execution ordering

    ‏2012-09-11T11:15:19Z  
    OK, I see what is happening there.
    I am not sure if this is a bug, I will check with the developers.
    There is a workaround to do this, when you create the rule, create it by dragging the text, rather than using the combo box. You should have the sub-tree after you remove the annotation. (please see the attachment, the Types names are different from the ones you are using, but they should convey the meaning).

    On another point, in this case (negation), you should use phrase rules instead of an aggregate. You can have a long sentence which contains a negation at the beginning, and at the end of it you have the positive phrase:
    Example: This phone doesn't have a complicated UI, but it has great features.
    You can have some optional tokens between the negation and the positive phrase (between 0 and 3).
    I've checked out your solution and it really works! A selection should be rather dragged than created from the combo box. In this case a subtree is seen, so the application "remembers" what was the selection. This is odd, I don't see the difference between dragging and combo box quite well. I would like to know when combo box is of better usage.

    It seems you are right about negation and phrase rules. Aggregate rules also could create correct annotations in the case of "but"-sentence, but they need a lot of additional rules to be able to hold it all.

    Thanks a ton!