Skip to main content

alphaWorks  >  Forums  >  IBM LanguageWare Resource Workbench  >  developerWorks

annotation/features from preconditions    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 8 - Pages: 1 - Last Post: Nov 9, 2009 2:35 PM Last Post By: KevinCunnane Threads: [ Previous | Next ]
t.oby

Posts: 53
Registered: Feb 19, 2009 08:57:13 AM
annotation/features from preconditions
Posted: Mar 10, 2009 06:54:55 AM
Click to report abuse...   Click to reply to this thread Reply
Hello,

is there a possibility assigning precondition elements to the features or annotate them? For example having a rule for a company name only firing when a location is detected, where the second part is implemented via the precondition. Then one would like to include the location into the features. As far as I understood a rule implies a certain order of the words and a preconditions scopes on different levels (sentence, paragraph,..). I was thinking of examples as:

"Jack and Brothers LTD opened a new cite in California."

"...California... new site was opened by Jack and Brothers LTD."

It would also be nice to be able to specify the scope more detailed. For example: this sentence and the last two or n sentences before and after.

Regards,
Toby
KevinCunnane

Posts: 72
Registered: Feb 03, 2009 10:46:24 AM
Re: annotation/features from preconditions
Posted: Mar 10, 2009 08:21:47 AM   in response to: t.oby in response to: t.oby's post
Click to report abuse...   Click to reply to this thread Reply
Hi Toby,

This is not possible in the current version of the workbench. Linking to Annotations found using a Precondition test is something that's currently tricky to support in our analysis engine. So at present, we would recommend doing something like using Aggregate rules to get around this. You can do this by:
  • Creating a local rule to identify things like "Jack and Brothers LTD", e.g. as a "PossibleCompany". Or you could keep the Precondition test, and mark it as a Company since you know it definitely is one.
  • Then use an Aggregate rule to match Location followed by PossibleCompany if they're in the same Sentence/Paragraph (and probably also a rule to match PossibleCompany followed by Location), and do two things:
    • first promote the PossibleCompany to a Company annotation, by creating a new annotation over it (you don't need to do this if you set it as a Company)
    • next create a "CompanyLocation" annotation or similar, and use it to link the Location to the PossibleCompany. Note that in the present version of the LRW, it's not possible to link to newly created annotations, so you'll still need to link to the PossibleCompany. This is something we hope to address in future releases.

We also do not have support at the moment for specifying the scope apart from Sentence, Paragraph or Document. Thanks for mentioning this, I'll add it to the list of user issues for review.

Kevin
t.oby

Posts: 53
Registered: Feb 19, 2009 08:57:13 AM
Re: annotation/features from preconditions
Posted: Mar 10, 2009 09:14:40 AM   in response to: KevinCunnane in response to: KevinCunnane's post
Click to report abuse...   Click to reply to this thread Reply
Hi Kevin,

thanks! This totally suffices my requirement :)

Regards,
Toby
t.oby

Posts: 53
Registered: Feb 19, 2009 08:57:13 AM
Re: annotation/features from preconditions
Posted: Mar 10, 2009 09:40:03 AM   in response to: t.oby in response to: t.oby's post
Click to report abuse...   Click to reply to this thread Reply
Hi Kevin,

so the aggregate rules is to what you refer the "loose matching"-rules - right?

Regards,
Toby
KevinCunnane

Posts: 72
Registered: Feb 03, 2009 10:46:24 AM
Re: annotation/features from preconditions
Posted: Mar 10, 2009 09:46:48 AM   in response to: t.oby in response to: t.oby's post
Click to report abuse...   Click to reply to this thread Reply
Hi Toby, yes these are "loose match" rules. They ignore the majority of Annotations in the CAS, and so they are the opposite of "exact match" rules, where the exact pattern has to exist. I think I covered this topic in more detail in an earlier post, and there should also be some information in the help.
SOALab

Posts: 4
Registered: Sep 28, 2009 04:51:10 AM
Re: annotation/features from preconditions
Posted: Nov 06, 2009 09:34:29 AM   in response to: KevinCunnane in response to: KevinCunnane's post
Click to report abuse...   Click to reply to this thread Reply
I have application where I need to annotate news. If date is in sentence and in the sameor next sentence is location, then his should be annotate as a news. Feature for specifying the scope apart from Sentence, Paragraph or Document will do this trick.

Is this feature on road-map or is it any other way to do this.
KevinCunnane

Posts: 72
Registered: Feb 03, 2009 10:46:24 AM
Re: annotation/features from preconditions
Posted: Nov 06, 2009 01:05:41 PM   in response to: SOALab in response to: SOALab's post
Click to report abuse...   Click to reply to this thread Reply
Hi. We are planning to allow scoping of rules under annotation spans other than Sentence, Paragraph or Document in the future. However we have not committed to a specific timeframe for supporting this. Hopefully this would solve your issue, though I'm not 100% sure that it would.

You say that you need the Location to be in a range +/- 1 sentence from the Date. In this case, you probably need slightly different functionality. You can do this test in post-processing right now, while in the future it is again likely that we'll support it when writing rules. Here is what you could do
  • When creating Date and Location annotations, link them to the Sentence they are in. You can do this using a Rule - when you create a new Annotation it has a "Features" node below it. Right-clicking on this lets you link to the Sentence, Paragraph or Document covering the matched annotations. Now your Date and Location annotations will have a "sentence" feature, which links to the Sentence Annotation covering them.
  • Each Sentence has a "sentenceNumber" feature. So what you need to do is to compare the value of this feature for Dates and Locations
  • You can do this in post-processing fairly easily. For customer engagements we provide a number of CAS Consumers that can export to Databases and Triple stores. Once the data is in a triple store or a database table it becomes extremely easy to query for data based on a parameter such as sentence number - a simple SQL query would do the job.
  • Alternatively you could write your own custom annotator to do this very easily. The UIMA documentation has plenty of examples which would show how to do this. The next release of the LanguageWare Resource Workbench will let you add in any custom annotator to a pipeline, so you could easily build on top of your range-based annotator.

The ideal solution would be to let you do all this in rules. We should have support for this in the future. We are currently working on support for testing any feature for annotations. We also have plans to let you test ranges on integer features, and combining this would do what you need.

I hope this helps,

Kevin
mat3y

Posts: 3
Registered: Sep 16, 2009 02:26:58 PM
Re: annotation/features from preconditions
Posted: Nov 09, 2009 02:15:51 PM   in response to: KevinCunnane in response to: KevinCunnane's post
Click to report abuse...   Click to reply to this thread Reply
Hi Keving,

thank you very much for your detailed answer. I think we will use approach number three, especially if in the next LW release we could easily include it.

You mentioned CAS consumers for customers, we are in IBM Academeic Iniciative. Is possible for us to get access to any extra LW resources?

We are located in Slovenia, EU country, and we are looking into option of making dictionary for Slovenian language. Do you have any pointers for us on this topic.

Thank you and kind regards,

Matej
KevinCunnane

Posts: 72
Registered: Feb 03, 2009 10:46:24 AM
Re: annotation/features from preconditions
Posted: Nov 09, 2009 02:35:00 PM   in response to: mat3y in response to: mat3y's post
Click to report abuse...   Click to reply to this thread Reply
Hi Matej, can you email us at EMEALAN@ie.ibm.com please? That is the best way to talk about the issues you raised.

Thanks,

Kevin

Point your RSS reader here for a feed of the latest messages in all forums