Python library dependencies:
- torch>=1.0.1
- scipy>=0.14.0
- numpy -v: 1.19.1
- gensim -v: 3.8.1
- NLTK -v: 3.5
- sklearn -v: 1.19.0
Dataset: Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, and Kai-Wei Chang. A transformer-based approach for source code summarization. ACL 2020, Online, July 5-10, 2020, pages 4998–5007. Association for Computational Linguistics, 2020.
-
tf_idf_vec.py
python tf_idf_vec.py
You can get the TF_IDF vetor of input file, please place this input file into the data folder, and run:
-
K-means.py
python K-means.py
In this way, the data that needs to be data augmentation can be obtained.
-
eda_uad_bert_augment.py
-
eda_uda_bert.py
python eda_uad_bert_augment.py --input=train.txt --output=augmented.txt --num_aug=20
You can specify your own with --output. You can also specify the number of generated augmented sentences per original sentence using --num_aug.
-
split.py
python split.py
You need to split augmented.txt into javadoc.original and code.original_subtoken.