0

I am looking for a way in Watson Explorer Content Analytics Studio to generate multiple annotations of the same type if the text contains multiple terms in one sentence or paragraph. I don't get past the one annotation, I can make it select all "text containers" but than still it produces one annotation. I tried "fire all rules at this level" but that also does not give the desired result

Below some samples

Homework will be chapters 1,2 and 4 of the book "bonjour France"

Revisit paragraphs 2 and 3 of chapter 2 in the book Big History

The content of chapter 1 to 3 will be part of the test

For next week the homework is to read pages 1,2 and 5 of the textbook

What I have so far is the following helpers (see screenshot)

enter image description here

The expected result for the first line is 3 annotations of type SinglePieceOfContent with values/features:

  1. chapter 1 book "bonjour France"
  2. chapter 2 book "bonjour France"
  3. chapter 4 book "bonjour France"

I would like to avoid building a custom annotator, but if that is the way to go I would like to see that confirmed.

mpjjonker
  • 917
  • 1
  • 6
  • 28
  • What rule type do you use: phrase or aggregate? I'm not entirely sure what you are trying to do. But making a rule which produces the three annotations which you mention should be possible in WEX Studio. – Leonard Saers Mar 19 '17 at 16:18
  • @LeonardSaers we are using phrase rules and are very curious how to achieve this in WEX studio – mpjjonker Mar 20 '17 at 11:12

1 Answers1

1

Two ways to do this, both are a bit clunky and may not work with your spevific data.

The first way is you can create multiple annotations with a single selection rule. So the brute force way to do this is to have a selector that looks something like this (high level, ignoring intervening tokens). First pick a maximum number of annotation your're going to do in a single sentence, say 5, then:

Selection:
find   chapter chapter? chapter? chapter? chapter? book
rule   create 5 annotations, each with limited span over just the N they refer to and add book covered text as a feature to each. 

The second way is to use updates. Create an annotation that identifies each of the chapters and include a string feature book that is set to "default". Create another annotation that identifies book. Then create an aggregate rule like this:

selection:   chapter*  book
rule:    here just drag the value of book to update the feature value currently set to default. 

No rule is actually created, it's an update. Updates can handle multiple annotations at once.

mnsuk
  • 39
  • 3
  • Thanks I will try this out. In the mean time we have resolved this by building a custom java annotator, but I want to check out this approach as well – mpjjonker Sep 29 '17 at 05:58
  • I can see this work when all chapters are indeed mentioned in the text, but I am not sure how to get chapter 2 and 3 from the sentence: "study chapter 1 to 4..." – mpjjonker Oct 04 '17 at 15:39