I am learning to use Gate to retrieve information from documents. Could somebody please explain to me exactly what I have to do to get my JAPE grammar rule to work. I have checked most tutorials and Gate manual but I am still not getting the point. I would like to extract person, location and date as my named entities.
So what I did is: 1. Identified my date patterns in the documents 2. Create JAPE grammar rules for each pattern 3. Load .jape file into gate as a new jape transducer
My date patterns are as follows: 1. DateMonthYear 2. MonthYear
So if I understand correctly, I would have to define JAPE grammar rules for each of these patterns. And that is what I am trying to do. I have defined my rules in a .jape file but it wouldn load into gate and it gives me an error that resource can not be created, the .jape file is as follow:
Phase: datetimefinder
Input: Token Lookup SpaceToken
Options: control = appelt
Macro: DAY_ONEDIGIT
({Toke.kind == number,Token.category==CD, Token.length == "1"})
Macro: DAY_TWODIGIT
({Token.kind == number,Token.category==CD, Token.length == "2"})
Macro: MONTH
({Lookup.MajorType="Month"})
Macro: YEAR
({Token.kind== number,Token.category==CD, Token.length== "4"})
////////Rule number 1
Rule: ddmmyyyy
priority:50
(
(
(DAY_ONEDIGIT|DAY_TWODIGIT)
({Token.kind==punctuation}|{SpaceToken})?
)
(
(MONTH)
({Token.kind==punctuation}|{SpaceToken})?
(YEAR)
)
)
:ddmmyyyy
-->
:ddmmyyyy.DateMonthYear= {rule = "ddmmyyyy"}
//Rule number 2
Rule: mmyyyy
priority: 50
(
(MONTH)
({Token})?
({SpaceToken})?
(YEAR)
)
:mmyyyy
-->
:mmyyyy.MonthYear= {rule = "mmyyyy"}
I am not sure if I need to have new lists of the different annotation patterns (e.g DateMonth). Can someone please tell me what I should have, and do in order for this to run. I checked gate manual and other questions here but I cant find anything that give a complete tutorial on how to set this whole framework up.