Commit ae021be0 authored by jcorvi's avatar jcorvi
Browse files

First Commit

parents
#
# Project specific excludes
#
tomcat
#
# Default excludes
#
# Binaries
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.war
*.ear
*.sar
*.class
# Maven
target/
# IntelliJ project files
*.iml
*.iws
*.ipr
.idea/
# eclipse project file
.settings/
.classpath
.project
# NetBeans specific
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
# OS
.DS_Store
# Misc
*.swp
release.properties
pom.xml.releaseBackup
pom.xml.tag
#custom
pos/
FROM alpine:3.9
WORKDIR /usr/local/share/ades_relation
ARG ADES_RELATION_VERSION=1.0
COPY docker-build.sh /usr/local/bin/docker-build.sh
COPY src src
COPY pom.xml .
RUN mkdir logs
RUN chmod u=rwx,g=rwx,o=r /usr/local/share/ades_relation -R
RUN docker-build.sh ${ADES_RELATION_VERSION}
ades-relation-extraction
========================
<b>Relation Extraction for Preclinical Adverse Drug Effect text-mining Project</b>
========================
Internal project. Specific for the preclinical adverse Drug effect text-mining pipeline.
It uses the nlp-gate-generic-component; and contains specific jape rules for the relation extraction of the treatment-related findings.
This project it uses gate formated documents as input and output.
The most important information is that this project is only usefull inside the preclinical adverse drug effect pipeline.
The main objective is to extract the relations between the entities and retrieve the treatment-related findings of the toxicology reports.
========================
#!/bin/sh
BASEDIR=/usr/local
ADES_RELATION_EXTRACTION_HOME="${BASEDIR}/share/ades_relation_extraction/"
ADES_RELATION_EXTRACTION_VERSION=1.0
# Exit on error
set -e
if [ $# -ge 1 ] ; then
ADES_RELATION_EXTRACTION_VERSION="$1"
fi
if [ -f /etc/alpine-release ] ; then
# Installing OpenJDK 8
apk add --update openjdk8-jre
# dict tagger development dependencies
apk add openjdk8 git maven
else
# Runtime dependencies
apt-get update
apt-get install openjdk-8-jre
# The development dependencies
apt-get install openjdk-8-jdk git maven
fi
git clone --depth 1 https://github.com/inab/docker-textmining-tools.git nlp_gate_generic_component
cd nlp_gate_generic_component
git filter-branch --prune-empty --subdirectory-filter nlp-gate-generic-component HEAD
mvn clean install -DskipTests
cd ..
#rename jar
mv nlp_gate_generic_component/target/nlp-gate-generic-component-0.0.1-SNAPSHOT-jar-with-dependencies.jar nlp-gate-generic-component-${ADES_RELATION_EXTRACTION_VERSION}.jar
cat > /usr/local/bin/ades-relation-extraction <<EOF
#!/bin/sh
exec java \$JAVA_OPTS -jar "${ADES_RELATION_EXTRACTION_HOME}/nlp-gate-generic-component-${ADES_RELATION_EXTRACTION_VERSION}.jar" -workdir "${ADES_RELATION_EXTRACTION_HOME}" -j jape_rules/main.jape "\$@"
EOF
chmod +x /usr/local/bin/ades-relation-extraction
#delete target, do not delete for now because it has the jape rules inside
#rm -R nlp_generic_annotation
#add bash for nextflow
apk add bash
if [ -f /etc/alpine-release ] ; then
# Removing not needed tools
apk del openjdk8 git maven
rm -rf /var/cache/apk/*
else
apt-get remove openjdk-8-jdk git maven
rm -rf /var/cache/dpkg
fi
#!/bin/sh
BASEDIR=/usr/local
ADES_RELATION_HOME="${BASEDIR}/share/ades_relation/"
ADES_RELATION_VERSION=1.0
# Exit on error
set -e
if [ $# -ge 1 ] ; then
ADES_RELATION_VERSION="$1"
fi
if [ -f /etc/alpine-release ] ; then
# Installing OpenJDK 8
apk add --update openjdk8-jre
# dict tagger development dependencies
apk add openjdk8 git maven
else
# Runtime dependencies
apt-get update
apt-get install openjdk-8-jre
# The development dependencies
apt-get install openjdk-8-jdk git maven
fi
mvn clean install -DskipTests
#rename jar
mv target/ades-relation-extraction-0.0.1-SNAPSHOT-jar-with-dependencies.jar ades-relation-extraction-${ADES_RELATION_VERSION}.jar
cat > /usr/local/bin/ades-relation-extraction <<EOF
#!/bin/sh
exec java \$JAVA_OPTS -jar "${ADES_RELATION_HOME}/ades-relation-extraction-${ADES_RELATION_VERSION}.jar" -workdir "${ADES_RELATION_HOME}" "\$@"
EOF
chmod +x /usr/local/bin/ades-relation-extraction
#delete target
rm -R target src pom.xml
#add bash for nextflow
apk add bash
if [ -f /etc/alpine-release ] ; then
# Removing not needed tools
apk del openjdk8 git maven
rm -rf /var/cache/apk/*
else
apt-get remove openjdk-8-jdk git maven
rm -rf /var/cache/dpkg
fi
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>es.bsc.inb.nlp</groupId>
<artifactId>ades-relation-extraction</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ades-relation-extraction</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>uk.ac.gate</groupId>
<artifactId>gate-core</artifactId>
<version>8.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
es.bsc.inb.ades.relation.extraction.main.App
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
package es.bsc.inb.ades.relation.extraction.model;
import java.util.ArrayList;
import java.util.List;
import gate.Annotation;
public class Finding implements Cloneable{
private Integer id;
private List<Annotation> annotations;
public Finding(Integer id) {
this.id = id;
this.annotations = new ArrayList<Annotation>();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public List<Annotation> getAnnotations() {
return annotations;
}
public void setAnnotations(List<Annotation> annotations) {
this.annotations = annotations;
}
public void addAnnotation(Annotation finding) {
annotations.add(finding);
}
public Finding clone() {
try {
return (Finding)super.clone();
} catch (CloneNotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment