The calculation of Code Style Similarity is shown in code_style_sim.py
.
In this Python file, we evaluate the Code Style Similarity between exemplar codes
and rewritten codes in four datasets generated by different LLMs.
The function cal_codebleu_for_one_pair
in codebleu.py
calculates
CodeBLEU between two code snippets.
The function calc_score
in rouge.py
calculates ROUGE-L between two code snippets.
The method corpus_bleu
in bleu.py
calculates BLEU between two code snippets.