- Clone the repository.
git clone https://github.com/martin-wey/ast-probe
cd ast-probe
- Create a python3 virtual environment and install
requirements.txt
.
python3 -m venv <name_of_your_env>
source <name_of_your_env>/bin/activate
pip install -r requirements.txt
We run out experiments using Python 3.9.10. In the requirements.txt
, we include the PyTorch and CUDA versions that we used to report the results of the paper.
- Install all tree-sitter grammars:
mkdir grammars
cd grammars
git clone https://github.com/tree-sitter/tree-sitter-python.git
git clone https://github.com/tree-sitter/tree-sitter-javascript.git
git clone https://github.com/tree-sitter/tree-sitter-go.git
git clone https://github.com/tree-sitter/tree-sitter-php.git
git clone https://github.com/tree-sitter/tree-sitter-ruby.git
git clone https://github.com/tree-sitter/tree-sitter-java.git
cd ..
python src/data/build_grammars.py
- Add the project directory to your Python path.
export PYTHONPATH="${PYTHONPATH}:~/ast-probe/"
- [Optional] Execute all tests.
python -m unittest discover
At this point, the repository is ready to run the scripts. Please, check the README.md
to execute the scripts and replicate the experiments of the paper.