You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by vamsi kruthiventi <va...@live.com> on 2019/07/22 10:41:38 UTC
How to check matched annotation with StringList/ WordList in RUTA
Hi Team,
I have a Policy Number of pattern :- AB-1234567-PAD, and Product Code as last 3 characters (PAD) of Policy number. With my code, I am now successfully extracting the Product Code (PAD) for given format of policy number. But, now, I need to check the extracted Product Code(PAD) with list of Product codes available. Currently, I am using STRINGLIST which has list of product codes. But, I don't know how to check the extracted Product Code matches with List of available Product codes.
Below is my code:
PACKAGE uima.ruta.example;
Document{->RETAINTYPE(SPACE)};
DECLARE Annotation ProdCode;
"(?i)\\b(?=.*\\d)[1]{0,1}[A-Z0-9]{2}[\\s |-]{0,2}[A-Z0-9]{7}[\\s |-]{0,2}([A-Z]{3})\\b"->1 = ProdCode;//<-Previously ProdCode was replaced with EntityType to get last 3 chars of given REGEX
STRINGLIST CustomSL = {"PLB","PAD"};
ProdCode{INLIST(CustomSL)->MARK(EntityType)};//<- Requesting your help here!
Ex 1:
Input : The policy number is 1A-AB12345-PAD.
Exp OP : PAD
Ex 2:
Input : The policy number is 1A-AB12345-PAN.
Exp OP : Entity should not be recognized since PAN does not exist in given STRINGLIST
Note:
I am a Pega developer and new to RUTA.
Please share your thoughts and kindly do the needful.
Thanks
Vamsi
Re: How to check matched annotation with StringList/ WordList in RUTA
Posted by Nikolai Krot <ta...@gmail.com>.
Hi,
If i understand you correctly, you only need such ProdCode's that contain
specific values of PAN (that you define in CustomSL). If this is true, I
would start with finding and annotating these values of PAN and then build
ProdCode annotation around these annotated PANs.
Best regards,
Nikolai
On Mon, Jul 22, 2019 at 1:22 PM vamsi kruthiventi <va...@live.com> wrote:
> Hi Team,
>
> I have a Policy Number of pattern :- AB-1234567-PAD, and Product Code as
> last 3 characters (PAD) of Policy number. With my code, I am now
> successfully extracting the Product Code (PAD) for given format of policy
> number. But, now, I need to check the extracted Product Code(PAD) with list
> of Product codes available. Currently, I am using STRINGLIST which has list
> of product codes. But, I don't know how to check the extracted Product Code
> matches with List of available Product codes.
>
> Below is my code:
>
> PACKAGE uima.ruta.example;
>
> Document{->RETAINTYPE(SPACE)};
>
> DECLARE Annotation ProdCode;
>
> "(?i)\\b(?=.*\\d)[1]{0,1}[A-Z0-9]{2}[\\s |-]{0,2}[A-Z0-9]{7}[\\s
> |-]{0,2}([A-Z]{3})\\b"->1 = ProdCode;//<-Previously ProdCode was replaced
> with EntityType to get last 3 chars of given REGEX
>
> STRINGLIST CustomSL = {"PLB","PAD"};
>
> ProdCode{INLIST(CustomSL)->MARK(EntityType)};//<- Requesting your help
> here!
>
> Ex 1:
>
> Input : The policy number is 1A-AB12345-PAD.
>
> Exp OP : PAD
>
> Ex 2:
>
> Input : The policy number is 1A-AB12345-PAN.
>
> Exp OP : Entity should not be recognized since PAN does not exist in given
> STRINGLIST
>
> Note:
> I am a Pega developer and new to RUTA.
>
> Please share your thoughts and kindly do the needful.
>
> Thanks
> Vamsi
>
Re: How to check matched annotation with StringList/ WordList in RUTA
Posted by Peter Klügl <pe...@averbis.com>.
Hi,
there are many ways to do that, one being the rules in your example. Do
the rules not work for you?
I just tested the following and got only one EntityType annotation.
Input:
The policy number is 1A-AB12345-PAD.
The policy number is 1A-AB12345-PAN.
Script:
PACKAGE uima.example;
DECLARE Annotation ProdCode;
DECLARE EntityType;
STRINGLIST CustomSL = {"PLB","PAD"};
"(?i)\\b(?=.*\\d)[1]{0,1}[A-Z0-9]{2}[\\s |-]{0,2}[A-Z0-9]{7}[\\s
|-]{0,2}([A-Z]{3})\\b" -> 1 = ProdCode;
ProdCode{INLIST(CustomSL)->MARK(EntityType)};
Best,
Peter
Am 22.07.2019 um 12:41 schrieb vamsi kruthiventi:
> Hi Team,
>
> I have a Policy Number of pattern :- AB-1234567-PAD, and Product Code as last 3 characters (PAD) of Policy number. With my code, I am now successfully extracting the Product Code (PAD) for given format of policy number. But, now, I need to check the extracted Product Code(PAD) with list of Product codes available. Currently, I am using STRINGLIST which has list of product codes. But, I don't know how to check the extracted Product Code matches with List of available Product codes.
>
> Below is my code:
>
> PACKAGE uima.ruta.example;
>
> Document{->RETAINTYPE(SPACE)};
>
> DECLARE Annotation ProdCode;
>
> "(?i)\\b(?=.*\\d)[1]{0,1}[A-Z0-9]{2}[\\s |-]{0,2}[A-Z0-9]{7}[\\s |-]{0,2}([A-Z]{3})\\b"->1 = ProdCode;//<-Previously ProdCode was replaced with EntityType to get last 3 chars of given REGEX
>
> STRINGLIST CustomSL = {"PLB","PAD"};
>
> ProdCode{INLIST(CustomSL)->MARK(EntityType)};//<- Requesting your help here!
>
> Ex 1:
>
> Input : The policy number is 1A-AB12345-PAD.
>
> Exp OP : PAD
>
> Ex 2:
>
> Input : The policy number is 1A-AB12345-PAN.
>
> Exp OP : Entity should not be recognized since PAN does not exist in given STRINGLIST
>
> Note:
> I am a Pega developer and new to RUTA.
>
> Please share your thoughts and kindly do the needful.
>
> Thanks
> Vamsi
>
--
Dr. Peter Klügl
R&D Text Mining/Machine Learning
Averbis GmbH
Salzstr. 15
79098 Freiburg
Germany
Fon: +49 761 708 394 0
Fax: +49 761 708 394 10
Email: peter.kluegl@averbis.com
Web: https://averbis.com
Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó