Skip to content

Commit

Permalink
standarized java path; changed relation extraction pipeline to pure java
Browse files Browse the repository at this point in the history
application
  • Loading branch information
Franz Matthies committed Sep 27, 2016
1 parent 1b56a13 commit 45e5019
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 108 deletions.
4 changes: 2 additions & 2 deletions jcore-medical-pos-pipeline/runPipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
fi

### compiles the java file
if [ ! -f "target/classes/de/julielab/jcore/pipelines/MedicalPOSPipeline.class" ]; then
if [ ! -f "target/classes/de/julielab/jcore/pipeline/MedicalPOSPipeline.class" ]; then
echo "[Maven] Compiling sources for the first time"
mvn compile
fi
Expand All @@ -30,4 +30,4 @@ fi
export CLASSPATH=`for i in $java_libs/*.jar; do echo -n "$i:";done;echo -n ""`

### run the pipeline with given arguments
java -cp $CLASSPATH"./target/classes" de.julielab.jcore.pipelines.MedicalPOSPipeline $*
java -cp $CLASSPATH"./target/classes" de.julielab.jcore.pipeline.MedicalPOSPipeline $*
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.julielab.jcore.pipelines;
package de.julielab.jcore.pipeline;

import static org.apache.uima.fit.factory.AnalysisEngineFactory.createEngineDescription;
import static org.apache.uima.fit.factory.CollectionReaderFactory.createReaderDescription;
Expand Down
64 changes: 0 additions & 64 deletions jcore-relation-extraction-pipeline/cpe-pipeline.xml

This file was deleted.

37 changes: 0 additions & 37 deletions jcore-relation-extraction-pipeline/installComponents.sh

This file was deleted.

7 changes: 6 additions & 1 deletion jcore-relation-extraction-pipeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<artifactId>jcore-relation-extraction-pipeline</artifactId>
<name>JCoRe Relation Extraction Pipeline</name>
<dependencies>
<dependency>
<groupId>de.julielab</groupId>
<artifactId>jcore-types</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>de.julielab</groupId>
<artifactId>jcore-bionlp09event-reader</artifactId>
Expand All @@ -31,4 +36,4 @@
<name>JULIE Lab Jena, Germany</name>
<url>http://www.julielab.de</url>
</organization>
</project>
</project>
28 changes: 27 additions & 1 deletion jcore-relation-extraction-pipeline/runPipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

java_libs=target/dependency

### Check whether Maven is installed and install dependencies
if !(hash mvn 2>/dev/null); then
echo ""
echo "[Maven] Maven is not installed. Aborting.";
echo "[Maven] Please install it to use the automatic project dependency copying process."
exit 1;
else
if [ -d "$java_libs" ]; then
echo ""
echo "[Maven] jar library directory \""$java_libs"\" already exists. Skipping Maven dependency copying."
echo "[Maven] Please execute \"mvn clean\" from the command line and re-run this script if you want a clean installation."
echo "[Maven] You can safely ignore this if you don't encounter any problems."
echo ""
else
mvn dependency:copy-dependencies
fi
fi

### compiles the java file
if [ ! -f "target/classes/de/julielab/jcore/pipeline/relationextraction/BioSEMApplication.class" ]; then
echo "[Maven] Compiling sources for the first time"
mvn compile
fi

### add dependencies to java classpath
export CLASSPATH=`for i in $java_libs/*.jar; do echo -n "$i:";done;echo -n ""`

$UIMA_HOME/bin/runCPE.sh cpe-pipeline.xml
### run the pipeline with given arguments
java -cp $CLASSPATH"./target/classes" de.julielab.jcore.pipeline.relationextraction.BioSEMApplication $*
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ public void run(String in, String out) {
private void initializeComponents(String in, String out) {
try {
// init ST Reader
reader = CollectionReaderFactory.createReader(EventReader.class, EventReader.DIRECTORY_PARAM, in,
reader = CollectionReaderFactory.createReader(EventReader.class,
EventReader.DIRECTORY_PARAM, in,
EventReader.BIOEVENT_SERVICE_MODE_PARAM, false);
// init BioSEM Event Extractor AE
relationExtractor = AnalysisEngineFactory.createEngine(AE_DESCRIPTOR);
// init ST Writer
consumer = AnalysisEngineFactory.createEngine(EventConsumer.class, EventConsumer.DIRECTORY_PARAM, out,
consumer = AnalysisEngineFactory.createEngine(EventConsumer.class,
EventConsumer.DIRECTORY_PARAM, out,
EventConsumer.BIOEVENT_SERVICE_MODE_PARAM, false);
} catch (ResourceInitializationException e) {
e.printStackTrace();
Expand Down

0 comments on commit 45e5019

Please sign in to comment.