Skip to content

Latest commit

 

History

History
54 lines (46 loc) · 3.45 KB

INSTALL.md

File metadata and controls

54 lines (46 loc) · 3.45 KB

Using Docker for replication

Install docker

Install docker for your environment. We have tested on docker version 18.09.1, build 4c52b90 on Ubuntu 18.04. One may also follow the official install instructions from here: https://docs.docker.com/install

Download data

Download some required data from this link, unzip and place in the home directory. We refer this unzipped folder as the data folder throughout this documentation. You may also put the data directory anywhere but while running the docker containers, you need to provide the absolute path of this directory. The following instructions are written with the assumption that the unzipped data folder is placed in the home directory. Please adapt the absolute path of the data folder according to your environment and USER_NAME.

The template command for running the containers is

# Pull the container
docker pull jibesh/nl2type:TAG
# Execute the script
docker run -v PATH_TO_DATA_DIR:/data jibesh/nl2type:TAG

PS: You might need to prepend sudo to each of the following commands

Download the containers and run experiments

  1. To replicate the results from Table 1 of our paper, run the following commands:
docker pull jibesh/nl2type:table1
docker run -v /home/USER_NAME/data:/data jibesh/nl2type:table1

Results are printed on the terminal which corresponds to the first row of Table 1 (Approach: NL2Type) of our paper. The final output of this command is placed in data/paper/results/results.csv

  1. To replicate the results for the model trained only on names and not on the comments is
docker pull jibesh/nl2type:table1_no_comments
docker run -v /home/USER_NAME/data:/data jibesh/nl2type:table1_no_comments

Results are printed on the terminal which corresponds to the second row of Table 1 (Approach: NL2Type w/o comments) of our paper. The final output of this command is placed in data/paper/results/predictions_paper_no_comments.csv

  1. To use the model to make predictions using the same test data as used in the paper, run the following commands. The test data is placed in data/paper/raw_csv/test.csv
docker pull jibesh/nl2type:from_vecs
docker run -v /home/USER_NAME/data:/data jibesh/nl2type:from_vecs

The final output of this command is placed in data/paper/results_new_enriched.csv. This script first vectorizes the data in this test file and uses the same model as used in the paper to make predictions. This corresponds to steps 3, 4 and 5 in Figure 2 in the paper.

  1. Finally, if you want to use our tool using your own set of JavaScript files, you may run the following commands. Please ensure that the used JavaScript files have some JSDoc annotations since these will be used for extracting the natural language information used for training and testing the model. Additionally, there need be enough JavaScript files to learn from and providing only a few examples might not give the desired output. The set of JavaScript files must be placed in the data folder to the path → /data/demo/files. To use the JavaScript files used by us, you may download some of them from this link. Next run the following commands.
docker pull jibesh/nl2type:demo
docker run -v /home/USER_NAME/data:/data jibesh/nl2type:demo

The predictions for the given files will be data/demo/results/results.csv