Skip to content

Code for the NAACL'21 paper On the Embeddings of Variables in Recurrent Neural Networks for Source Code

License

Notifications You must be signed in to change notification settings

nadiinchi/dynamic_embeddings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RNNs with Dynamic Embeddings for Source Code Processing

The official PyTorch implementation of:

  • On the Embeddings of Variables in Recurrent Neural Networks for Source Code [arxiv] (accepted to NAACL'21)

Repository structure

  • code_completion: code for the code completion task (additional preprocessing, models, training etc)
  • var_misuse: code for the variable misuse task (additional preprocessing, models, training etc)

Please refer to these subfolders for each task's instructions.

Data

The experiments were conducted on the Python150k and JavaScript150k datasets, resplitted according to https://github.com/bayesgroup/code_transformers. Please follow this instruction to obtain data.

Run

The experiments were run on a system with Linux 3.10.0 using Tesla V100 GPU. The implementation is based on PyTorch>=1.5.

Running experiments:

  1. Download and resplit data, see this instruction for details;
  2. Preprocess data for a task you are interested in, see code_completion or var_misuse for details;
  3. Run the experiment you are interested in, see code_completion or var_misuse for details.

Attribution

Parts of this code are based on the following repositories:

Citation

If you found this code useful, please cite our paper

@inproceedings{chirkova2021embeddings,
      title={On the Embeddings of Variables in Recurrent Neural Networks for Source Code}, 
      author={Nadezhda Chirkova},
      booktitle={North American Chapter of the Association for Computational Linguistics}
      year={2021}, 
}

About

Code for the NAACL'21 paper On the Embeddings of Variables in Recurrent Neural Networks for Source Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages