Skip to content

A framework for training and evaluating AI models on a variety of openly available dialog datasets.

License

Notifications You must be signed in to change notification settings

hwaranlee/ParlAI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

You may be able to use the library without this requirements, but the library is tested only from the below environment.

  • One or more GeForce GTX 1080 Ti graphics cards (driver should be installed)
  • CentOS 7

Installation

  1. Install bzip2
sudo yum install bzip2

Follow instructions.

  1. Install Anaconda with Python 3.6
cd ~
mkdir Downloads
cd ~/Downloads
wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
bash Anaconda3-5.1.0-Linux-x86_64.sh

Follow instructions.
Answer 'yes' to prepend the Anaconda3 install location to PATH in your .bashrc.
Answer 'no' not to install Microsoft VSCode.

  1. Install NVIDIA CUDA Toolkit 9.1
wget https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda_9.1.85_387.26_linux
wget https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/1/cuda_9.1.85.1_linux
wget https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/2/cuda_9.1.85.2_linux
wget https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/3/cuda_9.1.85.3_linux
sudo sh cuda_9.1.85_387.26_linux

Follow instructions.
Do not install NVIDIA Accelerated Graphics Driver, if you have already installed it.

sudo sh cuda_9.1.85.1_linux
sudo sh cuda_9.1.85.2_linux
sudo sh cuda_9.1.85.3_linux

Follow instructions.

  1. Install PyTorch
conda install pytorch torchvision cuda91 -c pytorch

Follow instructions.

  1. Install ParlAI
python setup.py develop
  1. Copy files
  • Bot
    cc/exp-ko_multi_20180316/dict_file_100000.dict
    cc/exp-opensub_ko_nlg/dict_file_100000.dict
    cc/exp/exp-emb200-hs2048-lr0.0001-multi2018_30000/exp-emb200-hs2048-lr0.0001-multi2018_30000
    cc/exp/exp-emb200-hs1024-lr0.0001-oknlg/exp-emb200-hs1024-lr0.0001-oknlg
    data/word2vec_ko/ko.bin
  • Emotional Bot
    cc/exp-opensub_kemo_all/dict_file_100000.dict
    cc/exp-opensub_ko_nlg/dict_file_100000.dict
    cc/exp/exp-emb200-hs2048-lr0.0001-allK/exp-emb200-hs2048-lr0.0001-allK
    cc/exp/exp-emb200-hs1024-lr0.0001-oknlg/exp-emb200-hs1024-lr0.0001-oknlg
    data/word2vec_ko/ko.bin
  • Context-Aware Emotional Bot
    cc/exp-opensub_kemo_20190226/dict_file_100000.dict
    cc/exp-opensub_ko_nlg/dict_file_100000.dict
    cc/exp/exp-emb200-hs4096-lr0.0001-emotional_hred/exp-emb200-hs4096-lr0.0001-emotional_hred
    cc/exp/exp-emb200-hs1024-lr0.0001-oknlg/exp-emb200-hs1024-lr0.0001-oknlg
    data/word2vec_ko/ko.bin
  1. Install KoNLPy
sudo yum install gcc-c++ java-1.7.0-openjdk-devel python-devel
pip install JPype1-py3
pip install konlpy
  1. Install Gensim
pip install gensim

Usage

  • Bot
from examples.bot import Bot

bot = Bot('exp/exp-emb200-hs2048-lr0.0001-multi2018_30000/exp-emb200-hs2048-lr0.0001-multi2018_30000', 'exp-ko_multi_20180316/dict_file_100000.dict', True)
answer = bot.reply('안녕')
  • Emotional Bot
from examples.bot import Bot

bot = Bot('exp/exp-emb200-hs2048-lr0.0001-allK/exp-emb200-hs2048-lr0.0001-allK', 'exp-opensub_kemo_all/dict_file_100000.dict', True)
answer, emotion = bot.reply('안녕', 'Neutral') # The second parameter can be one of these: Neutral, Happiness, Anger, Sadness, Surprise, Fear, Disgust.
  • Context-Aware Emotional Bot
from examples.bot import Bot

bot = Bot('exp/exp-emb200-hs4096-lr0.0001-emotional_hred/exp-emb200-hs4096-lr0.0001-emotional_hred', 'exp-opensub_kemo_20190226/dict_file_100000.dict', True)
answer, emotion = bot.reply('안녕', 'Neutral', 'test0') # The second parameter can be one of these: Neutral, Happiness, Anger, Sadness, Surprise, Fear, Disgust.

The last parameter of the Bot constructor determines whether to use CUDA or not.
False is not tested.

About

A framework for training and evaluating AI models on a variety of openly available dialog datasets.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 91.9%
  • HTML 3.3%
  • Shell 2.6%
  • Lua 1.2%
  • JavaScript 0.5%
  • C++ 0.3%
  • Other 0.2%