stanfordnlp / phrasenode

Mapping natural language commands to web elements
Other
37 stars 13 forks source link

Mapping natural language commands to web elements

Data

Due to its large size, the data is hosted outside Github: https://nlp.stanford.edu/projects/phrasenode/

You can download the dataset by running the script as follows.

bash download_dataset.sh

Setup

The code was developed in the following environment:

To install dependencies:

Alternatively, use the docker image ppasupat/phrasenode For latest image: docker pull ppasupat/phrasenode:1.06

Quick start

If you just want to see something happen:

export WEBREP_DATA=./data
./main.py configs/base.txt configs/model/encoding.txt configs/node-embedder/allan.txt -n testrun

Configurations

Here are the configerations used in the final experiments:

Note that the visual neighbor is off by default. To turn it on, use general/neighbors.txt.

Experiment management

All training runs are managed by the PhraseNodeTrainingRuns object. For example, to get training run #141, do this:

runs = PhraseNodeTrainingRuns()   # Note the final "s"
run = runs[141]  # a PhraseNodeTrainingRun object

A TrainingRun is responsible for constructing a model, training it, saving it and reloading it (see superclasses gtd.ml.TrainingRun and gtd.ml.TorchTrainingRun for details.)

The most important methods on PhraseNodeTrainingRun are:

TensorBoard

Statistics are logged to TensorBoard. To view:

tensorboard --logdir=data/experiments

Demo Chrome extension

Referenece

Panupong Pasupat, Tian-Shun Jiang, Evan Liu, Kelvin Guu, Percy Liang.
Mapping natural language commands to web elements.
Conference on Empirical Methods in Natural Language Processing (EMNLP), 2018.

CodaLab: https://worksheets.codalab.org/worksheets/0x0097f249cd944284a81af331093c3579/