https://github.com/atharva-naik/sync
Implementation for SYNC: Structurally guided Hard Negative Curricula for Generalizable Neural Code Search
https://github.com/atharva-naik/sync
Last synced: 30 days ago
JSON representation
Implementation for SYNC: Structurally guided Hard Negative Curricula for Generalizable Neural Code Search
- Host: GitHub
- URL: https://github.com/atharva-naik/sync
- Owner: atharva-naik
- License: mit
- Created: 2023-09-17T00:58:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-16T23:42:57.000Z (about 1 year ago)
- Last Synced: 2025-02-05T04:08:30.377Z (3 months ago)
- Language: Python
- Size: 6.32 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **SYNC**
Implementation for SYNC: Structurally guided Hard Negative Curricula for Generalizable Neural Code Search## Environment
To recreate our computational environment we provide a YML file export of our conda environment (py3.7.yml)
```
conda env create -f py3.7.yml
```## **Data:**
You can download all the files from here: https://drive.google.com/drive/folders/1LFm1lrjKxYHAm9Dq7fKx8m0ZNtRv88wI?usp=sharing
(put in data folder).and
`triple` files from here: https://drive.google.com/drive/folders/18796d0_F9hpv6sV7-2RBQA4DMMVxLlVL?usp=sharing (put in triples folder).
Download the pre-generated negative samples for SYNC () and DISCO ().
## **Running Instructions:**
Running instructions for training models and baselines.
(**NOTE:** for the ```_ood.sh``` scripts just adjust the experiment folder path or ```-en``` argument)### **Baselines:**
Simple baselines:**nBOW:**
```
bash scripts/train_nbow.sh
bash scripts/nbow_ood.sh
```**RNN:**
```
bash scripts/train_rnn.sh
bash scripts/rnn_ood.sh
```**CNN:**
```
bash scripts/train_cnn.sh
bash scripts/cnn_ood.sh
```**Regular triplet training:**
CodeBERT:
```
bash scripts/codebert.sh
bash scripts/codebert_ood.sh
```
GraphCodeBERT:
```
bash scripts/graphcodebert.sh
bash scripts/graphcodebert_ood.sh
```
UniXcoder:
```
bash scripts/unixcoder.sh
bash scripts/unixcoder_ood.sh
```**DNS:**
CodeBERT:
```
bash scripts/codebert_dns.sh
bash scripts/codebert_ood.sh
```
GraphCodeBERT:
```
bash scripts/graphcodebert_dns.sh
bash scripts/graphcodebert_ood.sh
```
UniXcoder:
```
bash scripts/unixcoder_dns.sh
bash scripts/unixcoder_ood.sh
```**DISCO:**
CodeBERT:
```
bash scripts/codebert_disco.sh
bash scripts/codebert_ood.sh
```
GraphCodeBERT:
```
bash scripts/graphcodebert_disco.sh
bash scripts/graphcodebert_ood.sh
```
UniXcoder:
```
bash scripts/unixcoder_disco.sh
bash scripts/unixcoder_ood.sh
```CodeRetriever:
CodeBERT:
```
bash scripts/codebert_code_retriever.sh
bash scripts/codebert_ood.sh
```
GraphCodeBERT:
```
bash scripts/graphcodebert_code_retriever.sh
bash scripts/graphcodebert_ood.sh
```
UniXcoder:
```
bash scripts/unixcoder_code_retriever.sh
bash scripts/unixcoder_ood.sh
```### **SYNC experiments:**
CodeBERT:
```
bash scripts/codebert_sync.sh
bash scripts/codebert_ood.sh
```
GraphCodeBERT:
```
bash scripts/graphcodebert_sync.sh
bash scripts/graphcodebert_ood.sh
```
UniXcoder:
```
bash scripts/unixcoder_sync.sh
bash scripts/unixcoder_ood.sh
```## **Citation:**
```
@inproceedings{naik23sync,
title = {SYNC: A Structurally guided Hard Negative Curricula for
Generalizable Neural Code Search},
author = {Atharva Naik and Soumtira Das and Jyothi Vedurada and Somak Aditya},
booktitle = {The Asia-Pacific Chapter of the Association for Computational Linguistics},
month = {November},
year = {2023}
}
```