Topic
9 replies Latest Post - ‏2012-12-06T07:01:59Z by SystemAdmin
OlgaLind
OlgaLind
34 Posts
ACCEPTED ANSWER

Pinned topic Is it possible to fire an Aggregate Rule till comma?

‏2012-10-12T07:43:42Z |
Hi,

I constantly meet a problem that I can't set up a precondition in Aggregate Rules to run some particular rules only if there are no commas in the being annotated text. Is it possible to solve this issue with ICA studuio? The minimal scope for an Aggregate rule is a sentence, so I'm stuck there. Probably, I can create some additional rules that could solve the issue? Please advise.
Updated on 2012-12-06T07:01:59Z at 2012-12-06T07:01:59Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    197 Posts
    ACCEPTED ANSWER

    Re: Is it possible to fire an Aggregate Rule till comma?

    ‏2012-10-12T09:28:48Z  in response to OlgaLind
    Could you please provide more explanation, examples etc..
    Thanks
    • OlgaLind
      OlgaLind
      34 Posts
      ACCEPTED ANSWER

      Re: Is it possible to fire an Aggregate Rule till comma?

      ‏2012-10-12T10:40:40Z  in response to SystemAdmin
      Yes, sure. For example, I have the following sentences:

      A snake is bit with teeth by a cat.
      A snake is bit with a stick, a cat is bit with teeth.

      And I have an aggregate rule that matches "CreatureIndicator + ThreatIndicator + WeaponIndicator + CreatureIndicator", which shows that both creatures are involved in the process and have aggressor-victim relations.

      In the first sentence the match is OK, but in the second with this rule I have A snake is bit with a stick, a cat, which is not correct, because there is a comma (by implication it could be even a period here) and there are no aggressor-victim relations in this case, because two creatures are not involved in the same process, this is just enumeration.

      I meet a lot of such cases in the natural language, when an aggregate rule should stop executuion when meets a comma, but I don't see this functionality, probably, I miss something?
      • SystemAdmin
        SystemAdmin
        197 Posts
        ACCEPTED ANSWER

        Re: Is it possible to fire an Aggregate Rule till comma?

        ‏2012-10-12T13:39:38Z  in response to OlgaLind
        In this case it looks to me like your aggregate rule is not doing what it should. This could be because it is not constructed properly.
        Just as an FYI, an aggregate rule doesn't stop at the clause boundaries, it means it will run over commas, colons and semi-colons, as well as over sentence or paragraph boundaries if you specify it in the scope. So basically, the comma in your sentence is considered as a token, so the aggregate will ignore and go over it.
        In the examples you provided, I think you're better off using phrase rules instead of aggregates, in this case they are more controllable.
        • OlgaLind
          OlgaLind
          34 Posts
          ACCEPTED ANSWER

          Re: Is it possible to fire an Aggregate Rule till comma?

          ‏2012-10-15T08:57:14Z  in response to SystemAdmin
          Hi, thanks.

          I need exactly an aggregate rule there, because it wouldn't be possible to handle all alternative variants by the phrase rules. So, there are no ways to execute an aggregate rule till comma? Probably, some rules could be set up to treat a comma as blocker for aggregate rules execution?
          • SystemAdmin
            SystemAdmin
            197 Posts
            ACCEPTED ANSWER

            Re: Is it possible to fire an Aggregate Rule till comma?

            ‏2012-10-15T10:26:12Z  in response to OlgaLind
            You can create a rule that will annotate commas (you can either use a dictionary of a phrase rule), and use it to block the aggregate from going over the boundaries of the comma.
            • OlgaLind
              OlgaLind
              34 Posts
              ACCEPTED ANSWER

              Re: Is it possible to fire an Aggregate Rule till comma?

              ‏2012-10-16T10:24:27Z  in response to SystemAdmin
              Oh, seems like I have to add this blocker rule to each of my Aggregate rules...

              Thank you.
            • SystemAdmin
              SystemAdmin
              197 Posts
              ACCEPTED ANSWER

              Re: Is it possible to fire an Aggregate Rule till comma?

              ‏2012-12-05T07:43:19Z  in response to SystemAdmin
              I also used this solution, having a dictionary of "clausemaking" tokens that included words and punctuation and then checking in the rules that they do not occur between the other relevant tokens.

              But isn't there a more elegant way of doing this? I would expect some kind of ootb annotation of clauses as units.
              • OlgaLind
                OlgaLind
                34 Posts
                ACCEPTED ANSWER

                Re: Is it possible to fire an Aggregate Rule till comma?

                ‏2012-12-05T09:11:07Z  in response to SystemAdmin
                Hi Jane,

                I'm not sure this is not the same to your solution, but I've solved the problem by using rulesets. I've also created a DictBlocker with "clausemaking" tokens, and then created a "Block" Aggregate Rule that match DictBlocker in a different from my other Aggregate Rules ruleset, so "Block" Aggregate Rule just blocks firing of other Rules, therefore stops them until a comma or whatever.
                • SystemAdmin
                  SystemAdmin
                  197 Posts
                  ACCEPTED ANSWER

                  Re: Is it possible to fire an Aggregate Rule till comma?

                  ‏2012-12-06T07:01:59Z  in response to OlgaLind
                  Thanks Olga. I'm very new to this, so I'm not sure yet the different between the Phrase and Aggregate annotations yet. I think what I really was expecting was that just as there is an ootb Paragraph and Sentence annotation, there would be a clause annotation. But for sure this a more complicated thing to parse correctly.