This is the guide released for the paper "Neuro-Symbolic Language Models for Type Inference."
- Python >= 3.9
- Linux
Clone this repository and run the following command in the root directory to install the required dependencies:
pip install -r requirements.txt
- To extract the file, use the following command:
unzip data/data.zip -d path/to/data
- Set up language models such as Llama and CodeLlama locally:
- Generate high-level programs using these LLMs.
python high_level.py
- Run the interpreters to execute the programs.
python program_interpreter.py
To evaluate the Nester results, use the following command to calculate the Exact Match metric:
python nester/evaluate.py -s predictions.json -t testset.json -m -c
For match to parametric evaluation, simply add the -i option:
python nester/evaluate.py -s predictions.json -t testset.json -m -c -i
- PyTorch
Below is an example illustration from Nester:
We include the predictions of Nester in our dataset and its ablation results in the predictions/ folder.
