Revision: 17860
http://sourceforge.net/p/gate/code/17860
Author: adamfunk
Date: 2014-04-17 15:13:32 +0000 (Thu, 17 Apr 2014)
Log Message:
-----------
Add termCandidateThreshold JAPE to the end, in case users
want to see how it's done.
Modified Paths:
--------------
gate/trunk/plugins/TermRaider/applications/termraider-eng.gapp
gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
Modified: gate/trunk/plugins/TermRaider/applications/termraider-eng.gapp
===================================================================
--- gate/trunk/plugins/TermRaider/applications/termraider-eng.gapp
2014-04-17 15:01:42 UTC (rev 17859)
+++ gate/trunk/plugins/TermRaider/applications/termraider-eng.gapp
2014-04-17 15:13:32 UTC (rev 17860)
@@ -67,6 +67,7 @@
eachDocument {
augTfIdfCopier(termbank:termbank1);
kyotoCopier(termbank:termbank2);
+ termCandidateThreshold();
}
</controlScript>
<prList class="gate.util.persistence.CollectionPersistence">
@@ -97,13 +98,13 @@
<null/>
</entry>
<entry>
+ <string>keepOriginalMarkupsAS</string>
+ <boolean>true</boolean>
+ </entry>
+ <entry>
<string>setsToRemove</string>
<null/>
</entry>
- <entry>
- <string>keepOriginalMarkupsAS</string>
- <boolean>true</boolean>
- </entry>
</localMap>
</runtimeParams>
<resourceType>gate.creole.annotdelete.AnnotationDeletePR</resourceType>
@@ -141,15 +142,15 @@
<mapType>gate.util.SimpleFeatureMapImpl</mapType>
<localMap>
<entry>
- <string>encoding</string>
- <string>UTF-8</string>
- </entry>
- <entry>
<string>rulesURL</string>
<gate.util.persistence.PersistenceManager-URLHolder>
<urlString>$relpath$../../ANNIE/resources/tokeniser/DefaultTokeniser.rules</urlString>
</gate.util.persistence.PersistenceManager-URLHolder>
</entry>
+ <entry>
+ <string>encoding</string>
+ <string>UTF-8</string>
+ </entry>
</localMap>
</initParams>
<features class="gate.util.persistence.MapPersistence">
@@ -181,16 +182,16 @@
<mapType>gate.util.SimpleFeatureMapImpl</mapType>
<localMap>
<entry>
- <string>encoding</string>
- <string>UTF-8</string>
- </entry>
- <entry>
<string>externalSplitListURL</string>
<gate.util.persistence.PersistenceManager-URLHolder>
<urlString>$relpath$../../ANNIE/resources/regex-splitter/external-split-patterns.txt</urlString>
</gate.util.persistence.PersistenceManager-URLHolder>
</entry>
<entry>
+ <string>encoding</string>
+ <string>UTF-8</string>
+ </entry>
+ <entry>
<string>nonSplitListURL</string>
<gate.util.persistence.PersistenceManager-URLHolder>
<urlString>$relpath$../../ANNIE/resources/regex-splitter/non-split-patterns.txt</urlString>
@@ -241,23 +242,23 @@
<mapType>gate.util.SimpleFeatureMapImpl</mapType>
<localMap>
<entry>
- <string>gazetteerFeatureSeparator</string>
- <null/>
+ <string>caseSensitive</string>
+ <boolean>true</boolean>
</entry>
<entry>
<string>encoding</string>
<string>UTF-8</string>
</entry>
<entry>
+ <string>gazetteerFeatureSeparator</string>
+ <null/>
+ </entry>
+ <entry>
<string>listsURL</string>
<gate.util.persistence.PersistenceManager-URLHolder>
<urlString>$relpath$../../ANNIE/resources/gazetteer/lists.def</urlString>
</gate.util.persistence.PersistenceManager-URLHolder>
</entry>
- <entry>
- <string>caseSensitive</string>
- <boolean>true</boolean>
- </entry>
</localMap>
</initParams>
<features class="gate.util.persistence.MapPersistence">
@@ -282,14 +283,14 @@
<string>Token</string>
</entry>
<entry>
+ <string>failOnMissingInputAnnotations</string>
+ <boolean>false</boolean>
+ </entry>
+ <entry>
<string>inputASName</string>
<null/>
</entry>
<entry>
- <string>failOnMissingInputAnnotations</string>
- <boolean>false</boolean>
- </entry>
- <entry>
<string>outputASName</string>
<null/>
</entry>
@@ -313,16 +314,16 @@
<mapType>gate.util.SimpleFeatureMapImpl</mapType>
<localMap>
<entry>
- <string>encoding</string>
- <null/>
- </entry>
- <entry>
<string>rulesURL</string>
<gate.util.persistence.PersistenceManager-URLHolder>
<urlString>$relpath$../../ANNIE/resources/heptag/ruleset</urlString>
</gate.util.persistence.PersistenceManager-URLHolder>
</entry>
<entry>
+ <string>encoding</string>
+ <null/>
+ </entry>
+ <entry>
<string>lexiconURL</string>
<gate.util.persistence.PersistenceManager-URLHolder>
<urlString>$relpath$../../ANNIE/resources/heptag/lexicon</urlString>
@@ -352,6 +353,10 @@
<null/>
</entry>
<entry>
+ <string>rootFeatureName</string>
+ <string>root</string>
+ </entry>
+ <entry>
<string>annotationSetName</string>
<null/>
</entry>
@@ -363,10 +368,6 @@
<string>affixFeatureName</string>
<string>affix</string>
</entry>
- <entry>
- <string>rootFeatureName</string>
- <string>root</string>
- </entry>
</localMap>
</runtimeParams>
<resourceType>gate.creole.morph.Morph</resourceType>
@@ -412,6 +413,10 @@
<null/>
</entry>
<entry>
+ <string>enableDebugging</string>
+ <boolean>false</boolean>
+ </entry>
+ <entry>
<string>inputASName</string>
<null/>
</entry>
@@ -501,14 +506,14 @@
<boolean>true</boolean>
</entry>
<entry>
+ <string>caseSensitive</string>
+ <boolean>false</boolean>
+ </entry>
+ <entry>
<string>encoding</string>
<string>UTF-8</string>
</entry>
<entry>
- <string>caseSensitive</string>
- <boolean>false</boolean>
- </entry>
- <entry>
<string>highPrecisionOrgs</string>
<boolean>false</boolean>
</entry>
@@ -548,6 +553,10 @@
<null/>
</entry>
<entry>
+ <string>enableDebugging</string>
+ <boolean>false</boolean>
+ </entry>
+ <entry>
<string>inputASName</string>
<null/>
</entry>
@@ -563,6 +572,12 @@
<string>UTF-8</string>
</entry>
<entry>
+ <string>grammarURL</string>
+ <gate.util.persistence.PersistenceManager-URLHolder>
+
<urlString>$relpath$../resources/jape/select-tokens-en.jape</urlString>
+ </gate.util.persistence.PersistenceManager-URLHolder>
+ </entry>
+ <entry>
<string>annotationAccessors</string>
<null/>
</entry>
@@ -570,12 +585,6 @@
<string>operators</string>
<null/>
</entry>
- <entry>
- <string>grammarURL</string>
- <gate.util.persistence.PersistenceManager-URLHolder>
-
<urlString>$relpath$../resources/jape/select-tokens-en.jape</urlString>
- </gate.util.persistence.PersistenceManager-URLHolder>
- </entry>
</localMap>
</initParams>
<features class="gate.util.persistence.MapPersistence">
@@ -600,6 +609,10 @@
<null/>
</entry>
<entry>
+ <string>enableDebugging</string>
+ <boolean>false</boolean>
+ </entry>
+ <entry>
<string>inputASName</string>
<null/>
</entry>
@@ -615,6 +628,12 @@
<string>UTF-8</string>
</entry>
<entry>
+ <string>grammarURL</string>
+ <gate.util.persistence.PersistenceManager-URLHolder>
+
<urlString>$relpath$../resources/jape/multiword-main-en.jape</urlString>
+ </gate.util.persistence.PersistenceManager-URLHolder>
+ </entry>
+ <entry>
<string>annotationAccessors</string>
<null/>
</entry>
@@ -622,12 +641,6 @@
<string>operators</string>
<null/>
</entry>
- <entry>
- <string>grammarURL</string>
- <gate.util.persistence.PersistenceManager-URLHolder>
-
<urlString>$relpath$../resources/jape/multiword-main-en.jape</urlString>
- </gate.util.persistence.PersistenceManager-URLHolder>
- </entry>
</localMap>
</initParams>
<features class="gate.util.persistence.MapPersistence">
@@ -653,7 +666,10 @@
</entry>
<entry>
<string>scriptParams</string>
- <null/>
+ <gate.util.persistence.MapPersistence>
+ <mapType>gate.util.SimpleFeatureMapImpl</mapType>
+ <localMap/>
+ </gate.util.persistence.MapPersistence>
</entry>
<entry>
<string>inputASName</string>
@@ -704,6 +720,10 @@
<null/>
</entry>
<entry>
+ <string>enableDebugging</string>
+ <boolean>false</boolean>
+ </entry>
+ <entry>
<string>inputASName</string>
<null/>
</entry>
@@ -842,6 +862,75 @@
<localMap/>
</features>
</gate.util.persistence.PRPersistence>
+ <gate.util.persistence.LanguageAnalyserPersistence>
+ <runtimeParams class="gate.util.persistence.MapPersistence">
+ <mapType>gate.util.SimpleFeatureMapImpl</mapType>
+ <localMap>
+ <entry>
+ <string>outputASName</string>
+ <null/>
+ </entry>
+ <entry>
+ <string>document</string>
+ <null/>
+ </entry>
+ <entry>
+ <string>corpus</string>
+ <null/>
+ </entry>
+ <entry>
+ <string>ontology</string>
+ <null/>
+ </entry>
+ <entry>
+ <string>enableDebugging</string>
+ <boolean>false</boolean>
+ </entry>
+ <entry>
+ <string>inputASName</string>
+ <null/>
+ </entry>
+ </localMap>
+ </runtimeParams>
+ <resourceType>gate.creole.Transducer</resourceType>
+ <resourceName>termCandidateThreshold</resourceName>
+ <initParams class="gate.util.persistence.MapPersistence">
+ <mapType>gate.util.SimpleFeatureMapImpl</mapType>
+ <localMap>
+ <entry>
+ <string>encoding</string>
+ <string>UTF-8</string>
+ </entry>
+ <entry>
+ <string>annotationAccessors</string>
+ <null/>
+ </entry>
+ <entry>
+ <string>operators</string>
+ <null/>
+ </entry>
+ <entry>
+ <string>grammarURL</string>
+ <gate.util.persistence.PersistenceManager-URLHolder>
+
<urlString>$relpath$../resources/jape/term-candidate-threshold.jape</urlString>
+ </gate.util.persistence.PersistenceManager-URLHolder>
+ </entry>
+ <entry>
+ <string>binaryGrammarURL</string>
+ <null/>
+ </entry>
+ </localMap>
+ </initParams>
+ <features class="gate.util.persistence.MapPersistence">
+ <mapType>gate.util.SimpleFeatureMapImpl</mapType>
+ <localMap>
+ <entry>
+ <string>threshold</string>
+ <string>45.0</string>
+ </entry>
+ </localMap>
+ </features>
+ </gate.util.persistence.LanguageAnalyserPersistence>
</localList>
<collectionType>java.util.ArrayList</collectionType>
</prList>
Modified:
gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
===================================================================
--- gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
2014-04-17 15:01:42 UTC (rev 17859)
+++ gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
2014-04-17 15:13:32 UTC (rev 17860)
@@ -11,8 +11,13 @@
double threshold = 50.0; // fallback
if (ctx.getPRFeatures().containsKey("threshold")) {
threshold =
Double.parseDouble(ctx.getPRFeatures().get("threshold").toString());
- }
+ }
+ // Note that this reads a feature called 'threshold' on the PR itself.
+ // To edit the feature in the GATE GUI, show the termCandidateThreshold PR
+ // & look in the lower left corner. If the feature is missing,
+ // the fallback given above is used.
+
if (oldf.containsKey("tfIdfAug") &&
(((Double) oldf.get("tfIdfAug")) > threshold) ) {
Long start = ann.getStartNode().getOffset();
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/NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs