This paper presents SimGrader system, a code grading system that grades student code based on the measurement of similarity. We extract the static features, runtime features and semantic features of the code to comprehensively grade the code.
Python 3.7.6
Pytorch 1.7.0
-
Install the required dependencies
pip install -r requirements.txt -
Install cpplint tool
pip install cpplint -
Install cppcheck tool-- https://cppcheck.sourceforge.io/
-
train the representation encoder using the "Enhancing Discrimination" folder:
-
Calculate tree edit distance for labeled
python CalculateTED.py -
Using contrastive learning to train code representation encoders
python transformation/Transformation.py python encoder/pretrain.py -
Predicting code closeness to fine-tuning encoder
python encoder/train.py
-
-
extract the features using the "Feature " folder:
python SimilarityFeature/CalSimilarity.py python StaticFeature/CalFeatures.py -
grade student code using the "Grade" folder:
python Grade/GradingWithSim.py python Grade/GradingWithML.py