Learning framework for program property prediction.
To get a complete tool, one must include a parses for each programming language of interest and train on a lot of code.
To compile, first install dependencies
sudo apt-get install libmicrohttpd-dev libcurl4-openssl-dev bazel libgoogle-glog-dev libgflags-dev
brew tap caskroom/versions brew cask install java8 brew install libmicrohttpd bazel glog gflags
on Windows follow any installation instructions and install libmicrohttpd, curl and bazel.
[Optional] Install Google Performance Tools:
bazel build //...
To run tests, call
bazel test //...
bazel run //src/training/train
To get options for training, use:
bazel run //src/training/train --help
By default, train gets input programs (converted to JSON for example with UnuglifyJS) from the file testdata in the current directory. As a result, it creates files with the trained model.
If you wish to train the model using pseudolikelihood use the following parameters:
bazel run //src/training/train -- -training_method pl -input path/to/input/file --logtostderr
you can control the pseudolikelihood specific beam size with the
-beam_size parameter which is different from the beam size used during MAP Inference.
//src/training/train expects data to be in protobuf recordIO format. If you want to use JSON input - use
by default the usage of factor features in Nice2Predict is enabled, however if you wish to disable it you can launch the training with the following command:
bazel run //src/training/train -- -use_factors=false -input path/to/input/file --logtostderr
To predict properties for new programs, start a server after a model was trained:
bazel run //src/server/nice2serverproto -- --logtostderr
To run old JsonRPC API:
bazel run //src/server/nice2server -- --logtostderr
One can debug and observe deobfuscation from the viewer available in the viewer/viewer.html .