forked from collab-uniba/EMTK_docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
FROM python:2.7 | ||
|
||
# Install Git LFS | ||
RUN echo 'deb http://http.debian.net/debian stretch-backports main' > /etc/apt/sources.list.d/stretch-backports-main.list && \ | ||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ | ||
apt-get -y update && \ | ||
apt-get -y install git-lfs && \ | ||
git lfs install | ||
|
||
# ============================================= # | ||
# Clone the datasets and projects' repositories # | ||
# ============================================= # | ||
|
||
# Dataset | ||
RUN git clone https://github.com/collab-uniba/EMTK_datasets.git datasets | ||
|
||
# Emotions | ||
RUN git clone https://github.com/collab-uniba/Emotion_and_Polarity_SO.git emotions | ||
RUN wget -P /emotions/java/lib http://nlp.stanford.edu/software/stanford-corenlp-models-current.jar | ||
|
||
# Polarity | ||
RUN git lfs clone https://github.com/collab-uniba/Senti4SD.git polarity | ||
|
||
|
||
# ====== # | ||
# PYTHON # | ||
# ====== # | ||
|
||
# Install python requirements | ||
COPY requirements.txt / | ||
RUN pip install --upgrade pip && \ | ||
pip install -r /requirements.txt | ||
RUN python -m nltk.downloader all | ||
RUN rm requirements.txt | ||
|
||
|
||
# ==== # | ||
# JAVA # | ||
# ==== # | ||
|
||
# Install Java 8 JRE | ||
RUN apt-get -y update && \ | ||
apt-get -y install default-jre | ||
|
||
|
||
# ====== # | ||
# R-base # | ||
# ====== # | ||
|
||
# Install R | ||
RUN apt-get -y update && \ | ||
apt-get -y install r-base | ||
|
||
# Install R requirements | ||
COPY requirements.R / | ||
RUN Rscript requirements.R | ||
RUN rm requirements.R | ||
|
||
# ========== # | ||
# ENTRYPOINT # | ||
# ========== # | ||
|
||
# Copy the main bash script onto the image and make it a command | ||
COPY ./emtk / | ||
RUN ln -s /emtk /usr/bin/emtk | ||
|
||
# Run the bash inside the container when it starts | ||
ENTRYPOINT [ "/bin/bash" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
module=$1 | ||
if [ $module = "polarity" ] | ||
then | ||
# POLARITY MODULE | ||
cd ./polarity/ClassificationTask/ | ||
exec sh classificationTask.sh ${@:2} | ||
|
||
elif [ $module = "emotions" ] | ||
then | ||
# EMOTIONS MODULE | ||
task=$2 | ||
|
||
if [ $task = "train" ] | ||
then | ||
|
||
# Train | ||
cd ./emotions | ||
exec sh train.sh ${@:3} | ||
elif [ $task = "classify" ] | ||
then | ||
|
||
# Classify | ||
cd ./emotions | ||
exec sh classify.sh ${@:3} | ||
else | ||
# wrong/missing task name | ||
echo "Check the first argument after 'emotions':" | ||
echo "There is no task named '$1'!" | ||
fi | ||
|
||
else | ||
# WRONG/MISSING MODULE NAME | ||
echo "Check the first argument after './emtk.sh':" | ||
echo "There is no module named '$1'!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#check if caret is present | ||
#if not, it will be installed | ||
if(!require("caret", quietly = TRUE)) { | ||
install.packages(c("caret"), dependencies = c("Imports", "Depends","LinkingTo"), repos = "http://cran.mirror.garr.it/mirrors/CRAN/") | ||
} | ||
|
||
#check if LiblineaR is present | ||
#if not, it will be installed | ||
if(!require("LiblineaR", quietly = TRUE)) { | ||
install.packages(c("LiblineaR"), dependencies = c("Imports", "Depends","LinkingTo"), repos = "http://cran.mirror.garr.it/mirrors/CRAN/") | ||
} | ||
|
||
#check if e1071 is present | ||
#if not, it will be installed | ||
if(!require("e1071", quietly = TRUE)) { | ||
install.packages(c("e1071"), dependencies = c("Imports", "Depends","LinkingTo"), repos = "http://cran.mirror.garr.it/mirrors/CRAN/") | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
scipy==0.12.0 | ||
numpy==1.9.0 | ||
scikit-learn==0.15.1 | ||
nltk==3.0.0 | ||
pattern==2.6 | ||
nose==1.3.7 |