Revision: 17683
http://sourceforge.net/p/gate/code/17683
Author: dgmaynard
Date: 2014-03-17 16:13:33 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
cleaned more annotations and fixed a bug with a title, unknown first name and
surname
Modified Paths:
--------------
gate/trunk/plugins/ANNIE/resources/NE/clean.jape
gate/trunk/plugins/ANNIE/resources/NE/name_context.jape
gate/trunk/plugins/ANNIE/resources/NE/name_post.jape
Modified: gate/trunk/plugins/ANNIE/resources/NE/clean.jape
===================================================================
--- gate/trunk/plugins/ANNIE/resources/NE/clean.jape 2014-03-17 02:20:58 UTC
(rev 17682)
+++ gate/trunk/plugins/ANNIE/resources/NE/clean.jape 2014-03-17 16:13:33 UTC
(rev 17683)
@@ -14,7 +14,7 @@
*/
Phase: Clean
-Input: TempPerson TempLocation TempOrganization TempDate TempTime TempYear
TempZone Street Postcode Email Url Phone Ip TempIdentifier TempSpecs
ClosedClass Initials Upper FirstPerson JobTitle HashtagToken HashtagLookup Temp
+Input: TempPerson TempLocation TempOrganization TempDate TempTime TempYear
TempZone Street Postcode Email Url Phone Ip TempIdentifier TempSpecs
ClosedClass Initials Upper FirstPerson JobTitle HashtagToken HashtagLookup Temp
Title UrlPre
Options: control = all
Rule:CleanTempAnnotations
@@ -41,6 +41,8 @@
{JobTitle}|
{HashtagToken}|
{HashtagLookup}|
+ {Title}|
+ {UrlPre}|
{Temp}
):temp
-->
Modified: gate/trunk/plugins/ANNIE/resources/NE/name_context.jape
===================================================================
--- gate/trunk/plugins/ANNIE/resources/NE/name_context.jape 2014-03-17
02:20:58 UTC (rev 17682)
+++ gate/trunk/plugins/ANNIE/resources/NE/name_context.jape 2014-03-17
16:13:33 UTC (rev 17683)
@@ -14,7 +14,7 @@
*/
Phase: NameContext
-Input: Lookup Unknown Person Token Organization
+Input: Lookup Unknown Person Token Organization Title
Options: control = appelt
//Rule: Jobtitle1
@@ -39,6 +39,46 @@
//}
+Rule: TitleUnknownSurname
+Priority: 100
+(
+ ({Title}):title
+ ({Unknown}):firstName
+ ({Person.kind == firstName}):surname
+):person
+-->
+ {
+ gate.FeatureMap features = Factory.newFeatureMap();
+ gate.AnnotationSet personSet = (gate.AnnotationSet)bindings.get("person");
+
+ gate.AnnotationSet firstNameSet =
(gate.AnnotationSet)bindings.get("firstName");
+
+ gate.AnnotationSet titleSet = (gate.AnnotationSet)bindings.get("title");
+ gate.Annotation titleAnn = (gate.Annotation)titleSet.iterator().next();
+
+ gate.AnnotationSet surnameSet = (gate.AnnotationSet)bindings.get("surname");
+ gate.Annotation surnameAnn = (gate.Annotation)surnameSet.iterator().next();
+
+ String contentTitle = gate.Utils.stringFor(doc, titleAnn);
+ features.put("title", contentTitle);
+ features.put("gender", titleAnn.getFeatures().get("gender"));
+
+ if (firstNameSet != null && firstNameSet.size()>0)
+ {
+ gate.Annotation firstNameAnn =
(gate.Annotation)firstNameSet.iterator().next();
+ String firstNameContent = gate.Utils.stringFor(doc, firstNameAnn);
+ features.put("firstName", firstNameContent);
+ }
+ String surnameContent = gate.Utils.stringFor(doc, surnameAnn);
+ features.put("surname", surnameContent);
+
+ features.put("kind", "personName");
+ features.put("rule", "TitleUnknownSurname");
+outputAS.add(personSet.firstNode(), personSet.lastNode(), "Person",
+features);
+}
+
+
Rule:PersonTitle1
Priority: 40
(
Modified: gate/trunk/plugins/ANNIE/resources/NE/name_post.jape
===================================================================
--- gate/trunk/plugins/ANNIE/resources/NE/name_post.jape 2014-03-17
02:20:58 UTC (rev 17682)
+++ gate/trunk/plugins/ANNIE/resources/NE/name_post.jape 2014-03-17
16:13:33 UTC (rev 17683)
@@ -14,7 +14,7 @@
*/
Phase: NamePost
-Input: Token Lookup FirstPerson
+Input: Token Lookup FirstPerson
Options: control = appelt
// this runs after name.jape to fix some problems that may have been caused
@@ -58,3 +58,8 @@
outputAS.add(personSet.firstNode(), personSet.lastNode(), "TempPerson",
features);
}}
+
+
+
+
+
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs