Skip to content

Instantly share code, notes, and snippets.

@asc-adean
Last active January 9, 2019 20:16
Show Gist options
  • Save asc-adean/a6c2127c2c7a24cdcc0da61562febc22 to your computer and use it in GitHub Desktop.
Save asc-adean/a6c2127c2c7a24cdcc0da61562febc22 to your computer and use it in GitHub Desktop.
NLU VM Setup
#!/bin/bash
# Yum update and install necessary packages
sudo yum update -y
sudo yum install yum-utils -y
sudo yum groupinstall development -y
sudo yum install https://centos7.iuscommunity.org/ius-release.rpm -y
for removePackage in $(rpm -qa | grep maria)
do
yum remove $removePackage -y
done
sudo yum install -y python36u python36u-pip python36u-devel autoconf automake binutils bison flex gcc gcc-c++ gettext \
libtool make patch pkgconfig redhat-rpm-config rpm-build rpm-sign ctags elfutils indent patchutils \
pkg-config python-opengl python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools \
qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl \
libgle3 python-dev dos2unix mysql-devel wget
# Install Python Pip and symlinks
sudo wget https://bootstrap.pypa.io/get-pip.py
sudo ln -s /usr/bin/python3.6 /usr/local/bin/python3
sudo ln -s /usr/local/bin/pip /usr/local/bin/pip3
sudo python3.6 get-pip.py
# Install spacy via Pip
sudo pip3 install spacy==2.0.5
sudo python3.6 -m spacy download en
sudo python3.6 -m spacy download en_core_web_lg
# Install snips-nlu via Pip
sudo pip3 install snips-nlu==0.16.1
sudo python3.6 -m snips_nlu download en
# Install Pip packages
for pipPackage in slackclient nltk psutil pandas httplib2 pyarmor gensim bson flask flask_cors pymongo duckling==1.7.3 Jpype1==0.6.2 linux-metrics pattern requests_toolbelt
do
sudo pip3 install $pipPackage
done
# Create qna directories
mkdir -p /home/qna/snips/{comp,log}
# Pull down the scripts from biab-nlu
cd /home/qna/snips
git init
git remote add origin git@github.com:vora/biab-nlu.git
git pull origin demo-stable
# Setup crontab for root user
echo '24 3 * * * cd /home/qna/snips/ && python3.6 /home/qna/snips/master_update_and_retrain.py > /home/qna/snips/log/pull_retrain.log.$$ 2>&1' >> /var/spool/cron/root
echo '*/3 * * * * /bin/bash /home/qna/snips/check_rasa_agent.sh > /home/qna/snips/log/app.log.$$ 2>&1' >> /var/spool/cron/root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment