ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1514842 - in /ctakes/trunk/ctakes-assertion: build.xml src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTests.java src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTrain.java
Date Fri, 16 Aug 2013 18:42:20 GMT
Author: swu
Date: Fri Aug 16 18:42:20 2013
New Revision: 1514842

URL: http://svn.apache.org/r1514842
Log:
polarity paper #1 test scripts

Added:
    ctakes/trunk/ctakes-assertion/build.xml   (with props)
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTests.java
  (with props)
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTrain.java
  (with props)

Added: ctakes/trunk/ctakes-assertion/build.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/build.xml?rev=1514842&view=auto
==============================================================================
--- ctakes/trunk/ctakes-assertion/build.xml (added)
+++ ctakes/trunk/ctakes-assertion/build.xml Fri Aug 16 18:42:20 2013
@@ -0,0 +1,377 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- WARNING: Eclipse auto-generated file.
+              Any modifications will be overwritten.
+              To include a user specific buildfile here, simply create one in the same
+              directory with the processing instruction <?eclipse.ant.import?>
+              as the first entry and export the buildfile again. --><project basedir="."
default="build" name="ctakes-assertion">
+    <property environment="env"/>
+    <property name="ECLIPSE_HOME" value="../../../tools/eclipse"/>
+    <property name="debuglevel" value="source,lines,vars"/>
+    <property name="target" value="1.6"/>
+    <property name="source" value="1.6"/>
+    <path id="UIMA.userclasspath"/>
+    <path id="Maven Dependencies.libraryclasspath">
+        <pathelement location="../../../../../../ctakes-assertion-res"/>
+        <pathelement location="../../../../../../ctakes-assertion-zoner"/>
+        <pathelement location="../../../../../../ctakes-assertion-zoner-res"/>
+        <pathelement location="../../../../.m2/repository/net/sf/mastif/mastif-zoner/1.4/mastif-zoner-1.4.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/uima/uimaj-core/2.4.0/uimaj-core-2.4.0.jar"/>
+        <pathelement location="../../../../../../ctakes-type-system"/>
+        <pathelement location="../../../../../../ctakes-dictionary-lookup"/>
+        <pathelement location="../../../../../../ctakes-dictionary-lookup-res"/>
+        <pathelement location="../../../../.m2/repository/hsqldb/hsqldb/1.8.0.10/hsqldb-1.8.0.10.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/lucene/lucene-queries/4.0.0/lucene-queries-4.0.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/lucene/lucene-queryparser/4.0.0/lucene-queryparser-4.0.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/lucene/lucene-sandbox/4.0.0/lucene-sandbox-4.0.0.jar"/>
+        <pathelement location="../../../../.m2/repository/jakarta-regexp/jakarta-regexp/1.4/jakarta-regexp-1.4.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/lucene/lucene-analyzers-common/4.0.0/lucene-analyzers-common-4.0.0.jar"/>
+        <pathelement location="../../../../.m2/repository/net/sourceforge/ctakesresources/ctakes-resources-umls2011ab/3.1.0/ctakes-resources-umls2011ab-3.1.0.jar"/>
+        <pathelement location="../../../../../../ctakes-core"/>
+        <pathelement location="../../../../../../ctakes-core-res"/>
+        <pathelement location="../../../../.m2/repository/org/jdom/jdom2/2.0.3/jdom2-2.0.3.jar"/>
+        <pathelement location="../../../../.m2/repository/edu/mit/findstruct/findstructapi/0.0.1/findstructapi-0.0.1.jar"/>
+        <pathelement location="../../../../.m2/repository/com/googlecode/armbrust-file-utils/sqlwrapper/0.0.1/sqlwrapper-0.0.1.jar"/>
+        <pathelement location="../../../../.m2/repository/net/sourceforge/openai/openaifsm/0.0.1/openaifsm-0.0.1.jar"/>
+        <pathelement location="../../../../../../ctakes-constituency-parser"/>
+        <pathelement location="../../../../../../ctakes-constituency-parser-res"/>
+        <pathelement location="../../../../../../ctakes-utils"/>
+        <pathelement location="../../../../../../ctakes-pos-tagger"/>
+        <pathelement location="../../../../../../ctakes-pos-tagger-res"/>
+        <pathelement location="../../../../.m2/repository/com/googlecode/clearnlp/clearnlp/1.3.1/clearnlp-1.3.1.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar"/>
+        <pathelement location="../../../../.m2/repository/org/tukaani/xz/1.0/xz-1.0.jar"/>
+        <pathelement location="../../../../.m2/repository/net/sourceforge/jregex/jregex/1.2_01/jregex-1.2_01.jar"/>
+        <pathelement location="../../../../../../ctakes-dependency-parser"/>
+        <pathelement location="../../../../../../ctakes-dependency-parser-res"/>
+        <pathelement location="../../../../.m2/repository/org/cleartk/cleartk-ml/1.3.0/cleartk-ml-1.3.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/cleartk/cleartk-ml-libsvm/1.2.0/cleartk-ml-libsvm-1.2.0.jar"/>
+        <pathelement location="../../../../.m2/repository/de/bwaldvogel/liblinear/1.92/liblinear-1.92.jar"/>
+        <pathelement location="../../../../.m2/repository/org/cleartk/cleartk-ml-opennlp-maxent/1.1.2/cleartk-ml-opennlp-maxent-1.1.2.jar"/>
+        <pathelement location="../../../../.m2/repository/org/cleartk/cleartk-util/0.9.2/cleartk-util-0.9.2.jar"/>
+        <pathelement location="../../../../.m2/repository/org/cleartk/cleartk-eval/0.9.2/cleartk-eval-0.9.2.jar"/>
+        <pathelement location="../../../../.m2/repository/args4j/args4j/2.0.16/args4j-2.0.16.jar"/>
+        <pathelement location="../../../../.m2/repository/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar"/>
+        <pathelement location="../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar"/>
+        <pathelement location="../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+        <pathelement location="../../../../.m2/repository/com/google/guava/guava/10.0/guava-10.0.jar"/>
+        <pathelement location="../../../../.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar"/>
+        <pathelement location="../../../../.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar"/>
+        <pathelement location="../../../../.m2/repository/com/carrotsearch/hppc/0.4.1/hppc-0.4.1.jar"/>
+        <pathelement location="../../../../.m2/repository/jdom/jdom/1.0/jdom-1.0.jar"/>
+        <pathelement location="../../../../.m2/repository/junit/junit/4.10/junit-4.10.jar"/>
+        <pathelement location="../../../../.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/>
+        <pathelement location="../../../../.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/opennlp/opennlp-maxent/3.0.2-incubating/opennlp-maxent-3.0.2-incubating.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/opennlp/opennlp-tools/1.5.2-incubating/opennlp-tools-1.5.2-incubating.jar"/>
+        <pathelement location="../../../../.m2/repository/jwnl/jwnl/1.3.3/jwnl-1.3.3.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/lucene/lucene-core/4.0.0/lucene-core-4.0.0.jar"/>
+        <pathelement location="../../../../.m2/repository/tw/edu/ntu/csie/libsvm/3.1/libsvm-3.1.jar"/>
+        <pathelement location="../../../../.m2/repository/org/springframework/spring-core/3.1.2.RELEASE/spring-core-3.1.2.RELEASE.jar"/>
+        <pathelement location="../../../../.m2/repository/org/springframework/spring-asm/3.1.2.RELEASE/spring-asm-3.1.2.RELEASE.jar"/>
+        <pathelement location="../../../../.m2/repository/org/uimafit/uimafit/1.4.0/uimafit-1.4.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/uima/uimaj-tools/2.4.0/uimaj-tools-2.4.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/uima/uimaj-cpe/2.4.0/uimaj-cpe-2.4.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/uima/uimaj-adapter-vinci/2.4.0/uimaj-adapter-vinci-2.4.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/uima/jVinci/2.4.0/jVinci-2.4.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/apache/uima/uimaj-document-annotation/2.4.0/uimaj-document-annotation-2.4.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/springframework/spring-context/3.1.0.RELEASE/spring-context-3.1.0.RELEASE.jar"/>
+        <pathelement location="../../../../.m2/repository/org/springframework/spring-aop/3.1.0.RELEASE/spring-aop-3.1.0.RELEASE.jar"/>
+        <pathelement location="../../../../.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/springframework/spring-beans/3.1.0.RELEASE/spring-beans-3.1.0.RELEASE.jar"/>
+        <pathelement location="../../../../.m2/repository/org/springframework/spring-expression/3.1.0.RELEASE/spring-expression-3.1.0.RELEASE.jar"/>
+        <pathelement location="../../../../.m2/repository/org/codehaus/jackson/jackson-core-asl/1.5.0/jackson-core-asl-1.5.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.5.0/jackson-mapper-asl-1.5.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/scala-lang/scala-library/2.9.0/scala-library-2.9.0.jar"/>
+        <pathelement location="../../../../.m2/repository/org/scala-tools/sbinary/sbinary_2.9.0/0.4.0/sbinary_2.9.0-0.4.0.jar"/>
+        <pathelement location="lib/med-facts-i2b2-1.2-SNAPSHOT.jar"/>
+        <pathelement location="lib/med-facts-zoner-1.1.jar"/>
+        <pathelement location="lib/jcarafe-core_2.9.1-0.9.8.3.RC4.jar"/>
+        <pathelement location="lib/jcarafe-ext_2.9.1-0.9.8.3.RC4.jar"/>
+        <pathelement location="../../../../../../ctakes-lvg"/>
+        <pathelement location="../../../../../../ctakes-lvg-res"/>
+        <pathelement location="../../../../.m2/repository/gov/nih/nlm/nls/lvg/lvg2010dist/0.0.1/lvg2010dist-0.0.1.jar"/>
+        <pathelement location="../../../../../../ctakes-context-tokenizer"/>
+        <pathelement location="../../../../../../ctakes-chunker"/>
+        <pathelement location="../../../../../../ctakes-chunker-res"/>
+    </path>
+    <path id="ctakes-assertion.classpath">
+        <pathelement location="target/classes"/>
+        <path refid="UIMA.userclasspath"/>
+        <pathelement location="target/test-classes"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.CrossValidateAttributeModels.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.CrossValidateChi2GridSearch.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.NegExCorpusReader.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ReadAndPreprocessForAttributeModels.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.TestAttributeModels.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.TestFeatureSelection.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.TrainAttributeModels.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_read_gold_and_preprocess.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_evaluation_on_test.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_evaluation_on_output.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_crossvalidation.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes__assertion_eval_preprocess.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes__assertion_eval.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_read_gold_and_preprocess.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_evaluation_on_test.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_evaluation_on_output.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes_assertion_crossvalidation.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes__assertion_eval_preprocess.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.ctakes__assertion_eval.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.PolarityCotrainingTrain.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <path id="run.PolarityCotrainingTests.classpath">
+        <path refid="ctakes-assertion.classpath"/>
+        <path refid="Maven Dependencies.libraryclasspath"/>
+    </path>
+    <target name="init">
+        <mkdir dir="target/classes"/>
+        <mkdir dir="target/test-classes"/>
+        <copy includeemptydirs="false" todir="target/classes">
+            <fileset dir="src/main/java">
+                <exclude name="**/*.java"/>
+            </fileset>
+        </copy>
+        <copy includeemptydirs="false" todir="target/classes">
+            <fileset dir="src/main/resources">
+                <exclude name="**/*.java"/>
+                <exclude name="**"/>
+            </fileset>
+        </copy>
+        <copy includeemptydirs="false" todir="target/test-classes">
+            <fileset dir="src/test/java">
+                <exclude name="**/*.java"/>
+            </fileset>
+        </copy>
+        <copy includeemptydirs="false" todir="target/classes">
+            <fileset dir="target/generated-sources/jcasgen">
+                <exclude name="**/*.java"/>
+            </fileset>
+        </copy>
+    </target>
+    <target name="clean">
+        <delete dir="target/classes"/>
+        <delete dir="target/test-classes"/>
+    </target>
+    <target depends="clean" name="cleanall"/>
+    <target depends="build-subprojects,build-project" name="build"/>
+    <target name="build-subprojects"/>
+    <target depends="init" name="build-project">
+        <echo message="${ant.project.name}: ${ant.file}"/>
+        <javac debug="true" debuglevel="${debuglevel}" destdir="target/classes" includeantruntime="false"
source="${source}" target="${target}">
+            <src path="src/main/java"/>
+            <src path="src/main/resources"/>
+            <src path="target/generated-sources/jcasgen"/>
+            <exclude name="**"/>
+            <classpath refid="ctakes-assertion.classpath"/>
+        </javac>
+        <javac debug="true" debuglevel="${debuglevel}" destdir="target/test-classes" includeantruntime="false"
source="${source}" target="${target}">
+            <src path="src/test/java"/>
+            <classpath refid="ctakes-assertion.classpath"/>
+        </javac>
+    </target>
+    <target description="Build all projects which reference this project. Useful to propagate
changes." name="build-refprojects"/>
+    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
+        <copy todir="${ant.library.dir}">
+            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
+        </copy>
+        <unzip dest="${ant.library.dir}">
+            <patternset includes="jdtCompilerAdapter.jar"/>
+            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
+        </unzip>
+    </target>
+    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
+        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
+        <antcall target="build"/>
+    </target>
+    <target name="CrossValidateAttributeModels">
+        <java classname="org.apache.ctakes.assertion.train.CrossValidateAttributeModels"
failonerror="true" fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <classpath refid="run.CrossValidateAttributeModels.classpath"/>
+        </java>
+    </target>
+    <target name="CrossValidateChi2GridSearch">
+        <java classname="org.apache.ctakes.assertion.train.CrossValidateChi2GridSearch"
failonerror="true" fork="yes">
+            <jvmarg line="-Xmx2g"/>
+            <classpath refid="run.CrossValidateChi2GridSearch.classpath"/>
+        </java>
+    </target>
+    <target name="NegExCorpusReader">
+        <java classname="org.apache.ctakes.assertion.cr.NegExCorpusReader" failonerror="true"
fork="yes">
+            <arg line="/Users/m081914/work/data/negextestset/rsAnnotations-1-120-random.txt"/>
+            <classpath refid="run.NegExCorpusReader.classpath"/>
+        </java>
+    </target>
+    <target name="ReadAndPreprocessForAttributeModels">
+        <java classname="org.apache.ctakes.assertion.train.ReadAndPreprocessForAttributeModels"
failonerror="true" fork="yes">
+            <jvmarg line="-Xmx2g"/>
+            <classpath refid="run.ReadAndPreprocessForAttributeModels.classpath"/>
+        </java>
+    </target>
+    <target name="TestAttributeModels">
+        <java classname="org.apache.ctakes.assertion.train.TestAttributeModels" failonerror="true"
fork="yes">
+            <classpath refid="run.TestAttributeModels.classpath"/>
+        </java>
+    </target>
+    <target name="TestFeatureSelection">
+        <java classname="org.apache.ctakes.assertion.eval.TestFeatureSelection" failonerror="true"
fork="yes">
+            <classpath refid="run.TestFeatureSelection.classpath"/>
+        </java>
+    </target>
+    <target name="TrainAttributeModels">
+        <java classname="org.apache.ctakes.assertion.train.TrainAttributeModels" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <classpath refid="run.TrainAttributeModels.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_read_gold_and_preprocess">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir sharp_data/train --test-dir sharp_data/test --dev-dir
sharp_data/dev --models-dir sharp_data/model/eval.model --preprocess-only &quot;/Users/m081914/work/data/sharp/Seed
Corpus/Mayo/UMLS_CEM&quot;"/>
+            <classpath refid="run.ctakes_assertion_read_gold_and_preprocess.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_evaluation_on_test">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir sharp_data/train --test-dir sharp_data/test --models-dir
sharp_data/model/eval.model"/>
+            <classpath refid="run.ctakes_assertion_evaluation_on_test.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_evaluation_on_output">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir sharp_data/train --test-dir sharp_data/dev --models-dir
sharp_data/model/eval.model --evaluation-output-dir sharp_data/output_instancegathering --eval-only"/>
+            <classpath refid="run.ctakes_assertion_evaluation_on_output.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_crossvalidation">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir /Users/m081914/work/data/assertion/fromtim_sharp_data/train
--models-dir ../ctakes-assertion-res/resources/model/sharptrain-xval --cross-validation 5"/>
+            <classpath refid="run.ctakes_assertion_crossvalidation.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes__assertion_eval_preprocess">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <arg line="--train-dir data/train --test-dir data/test --models-dir data/model/eval.model
--dev-dir data/dev --preprocess-only &quot;H:\SHARP\Corpora\\Mayo\UMLS_CEM&quot;"/>
+            <classpath refid="run.ctakes__assertion_eval_preprocess.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes__assertion_eval">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <arg line="--train-dir data/train --test-dir data/test --models-dir data/model/eval.model
--dev-dir data/dev"/>
+            <classpath refid="run.ctakes__assertion_eval.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_read_gold_and_preprocess">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir sharp_data/train --test-dir sharp_data/test --dev-dir
sharp_data/dev --models-dir sharp_data/model/eval.model --preprocess-only &quot;/Users/m081914/work/data/sharp/Seed
Corpus/Mayo/UMLS_CEM&quot;"/>
+            <classpath refid="run.ctakes_assertion_read_gold_and_preprocess.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_evaluation_on_test">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir sharp_data/train --test-dir sharp_data/test --models-dir
sharp_data/model/eval.model"/>
+            <classpath refid="run.ctakes_assertion_evaluation_on_test.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_evaluation_on_output">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir sharp_data/train --test-dir sharp_data/dev --models-dir
sharp_data/model/eval.model --evaluation-output-dir sharp_data/output_instancegathering --eval-only"/>
+            <classpath refid="run.ctakes_assertion_evaluation_on_output.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes_assertion_crossvalidation">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <jvmarg line="-Xmx1600M"/>
+            <arg line="--train-dir /Users/m081914/work/data/assertion/fromtim_sharp_data/train
--models-dir ../ctakes-assertion-res/resources/model/sharptrain-xval --cross-validation 5"/>
+            <classpath refid="run.ctakes_assertion_crossvalidation.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes__assertion_eval_preprocess">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <arg line="--train-dir data/train --test-dir data/test --models-dir data/model/eval.model
--dev-dir data/dev --preprocess-only &quot;H:\SHARP\Corpora\\Mayo\UMLS_CEM&quot;"/>
+            <classpath refid="run.ctakes__assertion_eval_preprocess.classpath"/>
+        </java>
+    </target>
+    <target name="ctakes__assertion_eval">
+        <java classname="org.apache.ctakes.assertion.eval.AssertionEvaluation" failonerror="true"
fork="yes">
+            <arg line="--train-dir data/train --test-dir data/test --models-dir data/model/eval.model
--dev-dir data/dev"/>
+            <classpath refid="run.ctakes__assertion_eval.classpath"/>
+        </java>
+    </target>
+    <target name="PolarityCotrainingTrain">
+        <java classname="org.apache.ctakes.assertion.train.PolarityCotrainingTrain" failonerror="true"
fork="yes">
+            <classpath refid="run.PolarityCotrainingTrain.classpath"/>
+        </java>
+    </target>
+    <target name="PolarityCotrainingTests">
+        <java classname="org.apache.ctakes.assertion.train.PolarityCotrainingTests" failonerror="true"
fork="yes">
+            <classpath refid="run.PolarityCotrainingTests.classpath"/>
+        </java>
+    </target>
+</project>

Propchange: ctakes/trunk/ctakes-assertion/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTests.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTests.java?rev=1514842&view=auto
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTests.java
(added)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTests.java
Fri Aug 16 18:42:20 2013
@@ -0,0 +1,99 @@
+package org.apache.ctakes.assertion.train;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
+import org.apache.ctakes.assertion.eval.AssertionEvaluation;
+import org.apache.ctakes.assertion.util.AssertionConst;
+import org.apache.ctakes.assertion.train.PolarityCotrainingTrain.*;
+
+import scala.actors.threadpool.Arrays;
+
+
+/**
+ * For each assertion attribute (polarity, conditional, etc), run against the test directories
+ * for that attribute, using models that are under the models-dir.
+ * Note that this uses constants within {@link AssertionConst} for the directory names.
+ */
+public class PolarityCotrainingTests {
+
+	protected final static String SHARP_TEST = AssertionConst.DATA_DIR + "preprocessed_data/sharp/test";
+	protected final static String I2B2_TEST  = AssertionConst.DATA_DIR + "preprocessed_data/i2b2/test";
+	protected final static String MIPACQ_TEST = AssertionConst.DATA_DIR + "preprocessed_data/mipacq/cTAKES-xmi";
+	protected final static String NEGEX_TEST = AssertionConst.DATA_DIR + "preprocessed_data/negex";
+	
+	public static void main(String[] args) throws Exception {
+
+		AssertionEvaluation.useEvaluationLogFile = true;
+
+		HashMap<String,String> testGrid = new HashMap<String,String>();
+		testGrid.put(PolarityCotrainingTrain.SHARP_MODEL, 	SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_MODEL, 	I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_MODEL, 	MIPACQ_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_MODEL, 	NEGEX_TEST);
+		testGrid.put(PolarityCotrainingTrain.I2B2_MODEL,  	SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.I2B2_MODEL,  	I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.I2B2_MODEL,  	MIPACQ_TEST);
+		testGrid.put(PolarityCotrainingTrain.I2B2_MODEL,  	NEGEX_TEST);
+		testGrid.put(PolarityCotrainingTrain.MIPACQ_MODEL,  SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.MIPACQ_MODEL,  I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.MIPACQ_MODEL,  MIPACQ_TEST); // not valid
+		testGrid.put(PolarityCotrainingTrain.MIPACQ_MODEL,  NEGEX_TEST);
+		testGrid.put(PolarityCotrainingTrain.NEGEX_MODEL,  	SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.NEGEX_MODEL,  	I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.NEGEX_MODEL,  	MIPACQ_TEST);
+		testGrid.put(PolarityCotrainingTrain.NEGEX_MODEL,  	NEGEX_TEST);  // not valid
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MODEL,  	SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MODEL,  	I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MODEL,  	MIPACQ_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MODEL,  	NEGEX_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_MIPACQ_MODEL,  SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_MIPACQ_MODEL,  I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_MIPACQ_MODEL,  MIPACQ_TEST); // not valid
+		testGrid.put(PolarityCotrainingTrain.SHARP_MIPACQ_MODEL,  NEGEX_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_NEGEX_MODEL,  	SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_NEGEX_MODEL,  	I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_NEGEX_MODEL,  	MIPACQ_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_NEGEX_MODEL,  	NEGEX_TEST);  // not valid
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MIPACQ_NEGEX_MODEL,  	SHARP_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MIPACQ_NEGEX_MODEL,  	I2B2_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MIPACQ_NEGEX_MODEL,  	MIPACQ_TEST);
+		testGrid.put(PolarityCotrainingTrain.SHARP_I2B2_MIPACQ_NEGEX_MODEL,  	NEGEX_TEST);
+
+		
+		String attribute = "polarity";
+
+		for (Entry<String, String> oneTest : testGrid.entrySet()) {
+			ArrayList<String> params = new ArrayList<String>();
+
+			params.add("--test-dir"); 	params.add(oneTest.getValue());
+			params.add("--models-dir"); params.add(oneTest.getKey());
+			//			params.add("--ytex-negation");
+			//		params.add("--evaluation-output-dir");	params.add(AssertionConst.evalOutputDir);
+			params.add("--test-only");	
+			params.add("--print-errors");
+
+			// Build up an "ignore" string
+			for (String ignoreAttribute : AssertionConst.allAnnotationTypes) {
+				if (!ignoreAttribute.equals(attribute)) { 
+
+					if (ignoreAttribute.equals("historyOf")) {
+						ignoreAttribute = ignoreAttribute.substring(0, ignoreAttribute.length()-2);
+					}
+
+					params.add("--ignore-" + ignoreAttribute);
+				}
+			}
+			String[] paramList = params.toArray(new String[]{});
+
+			System.out.println(Arrays.asList(paramList).toString());
+
+			// Run the actual assertion test on just one attribute
+			AssertionEvaluation.main( paramList );
+		}
+	}
+
+
+
+}

Propchange: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTests.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTrain.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTrain.java?rev=1514842&view=auto
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTrain.java
(added)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTrain.java
Fri Aug 16 18:42:20 2013
@@ -0,0 +1,79 @@
+package org.apache.ctakes.assertion.train;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
+import org.apache.ctakes.assertion.eval.AssertionEvaluation;
+import org.apache.ctakes.assertion.util.AssertionConst;
+
+import scala.actors.threadpool.Arrays;
+/**
+ * For each assertion attribute (polarity, conditional, etc), train a model using the data
+ * in the training directories for that attribute, and store the model under the models-dir
+ * Note that this uses constants within {@link AssertionConst} for the directory names.
+ */
+public class PolarityCotrainingTrain {
+	protected final static String SHARP_TRAIN = AssertionConst.DATA_DIR + "preprocessed_data/sharp/train";
+	protected final static String I2B2_TRAIN  = AssertionConst.DATA_DIR + "preprocessed_data/i2b2/train";
+	protected final static String MIPACQ_TRAIN = AssertionConst.DATA_DIR + "preprocessed_data/mipacq/cTAKES-xmi";
// actually test
+	protected final static String NEGEX_TRAIN = AssertionConst.DATA_DIR + "preprocessed_data/negex";
// actually test
+
+	protected final static String SHARP_MODEL = "../ctakes-assertion-res/resources/model/sharptrain";
+	protected final static String I2B2_MODEL  = "../ctakes-assertion-res/resources/model/i2b2train";
+	protected final static String MIPACQ_MODEL  = "../ctakes-assertion-res/resources/model/mipacqtest";
+	protected final static String NEGEX_MODEL  = "../ctakes-assertion-res/resources/model/negextest";
+	protected final static String SHARP_I2B2_MODEL = "../ctakes-assertion-res/resources/model/sharptrain+i2b2train";
+	protected final static String SHARP_MIPACQ_MODEL = "../ctakes-assertion-res/resources/model/sharptrain+mipacqtest";
+	protected final static String SHARP_NEGEX_MODEL = "../ctakes-assertion-res/resources/model/sharptrain+negextest";
+	protected final static String SHARP_I2B2_MIPACQ_NEGEX_MODEL = "../ctakes-assertion-res/resources/model/sharpi2b2mipacqnegex";
+
+	public static void main(String[] args) throws Exception {
+
+		String attribute = "polarity";
+		
+		HashMap<String,String> trainGrid = new HashMap<String,String>();
+		trainGrid.put(SHARP_TRAIN, 	SHARP_MODEL);
+		trainGrid.put(I2B2_TRAIN, 	I2B2_MODEL);
+		trainGrid.put(MIPACQ_TRAIN,	MIPACQ_MODEL);
+		trainGrid.put(NEGEX_TRAIN,	NEGEX_MODEL);
+		trainGrid.put(SHARP_TRAIN+":"+I2B2_TRAIN,	SHARP_I2B2_MODEL);
+		trainGrid.put(SHARP_TRAIN+":"+MIPACQ_TRAIN,	SHARP_MIPACQ_MODEL);
+		trainGrid.put(SHARP_TRAIN+":"+NEGEX_TRAIN,	SHARP_NEGEX_MODEL);
+		trainGrid.put(SHARP_TRAIN+":"+I2B2_TRAIN+":"+MIPACQ_TRAIN+":"+NEGEX_TRAIN,	
+				SHARP_I2B2_MIPACQ_NEGEX_MODEL);
+
+		for (Entry<String, String> oneTrain : trainGrid.entrySet()) {
+			
+			ArrayList<String> params = new ArrayList<String>();
+
+			params.add("--train-dir"); 	params.add(oneTrain.getKey());
+//			params.add("--test-dir"); 	params.add("sharp_data/dev");
+			params.add("--models-dir"); params.add(oneTrain.getValue());
+//			params.add("--evaluation-output-dir");	params.add(AssertionConst.evalOutputDir); 
+			params.add("--train-only"); 
+//			params.add("--feature-selection");	params.add("1.0");
+			
+			// Build up an "ignore" string
+			for (String ignoreAttribute : AssertionConst.allAnnotationTypes) {
+				if (!ignoreAttribute.equals(attribute)) { 
+
+					if (ignoreAttribute.equals("historyOf")) {
+						ignoreAttribute = ignoreAttribute.substring(0, ignoreAttribute.length()-2);
+					}
+
+					params.add("--ignore-" + ignoreAttribute);
+				}
+			}
+			String[] paramList = params.toArray(new String[]{});
+			
+//			System.out.println(Arrays.asList(paramList).toString());
+			
+			// Run the actual assertion training on just one attribute
+			AssertionEvaluation.main( paramList );
+		}
+		
+		
+		
+	}
+}

Propchange: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/train/PolarityCotrainingTrain.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message