Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
+
# Code Qualiy Evaluation Dataset
|
| 5 |
+
Welcome to the repository for our research paper: T. Wang and Z. Chen, "Analyzing Code Text Strings for Code Evaluation," 2023 IEEE International Conference on Big Data (BigData), Sorrento, Italy, 2023, pp. 5619-5628, doi: 10.1109/BigData59044.2023.10386406.
|
| 6 |
+
|
| 7 |
+
## Contents
|
| 8 |
+
This repository contains the following:
|
| 9 |
+
- License
|
| 10 |
+
- Dataset
|
| 11 |
+
- Fine-tuned Model
|
| 12 |
+
|
| 13 |
+
## Model Info
|
| 14 |
+
There are three BERT models, each fine-tuned on a dataset of 70,000 Python 3 solutions submitted by users for problems #1 through #100 on LeetCode:
|
| 15 |
+
- `bert_lc100_hp25`: This model classifies code based on the 25th percentile as its threshold. It is designed for identifying lower quartile code solutions in terms of quality or performance.
|
| 16 |
+
- `bert_lc100_hp50`: Operating with a median-based approach, this model uses the 50th percentile as its classification threshold. It is suitable for general assessments, providing a balanced view of code quality.
|
| 17 |
+
- `bert_lc100_regression`: Unlike the others, this is a regression model. It provides a nuanced prediction of the overall code quality score, offering a more detailed evaluation compared to the binary classification approach.
|
| 18 |
+
|
| 19 |
+
## Model Usage
|
| 20 |
+
**Installation**
|
| 21 |
+
First, ensure you have the latest version of the tf-models-official package. You can install it using the following command:```
|
| 22 |
+
pip install -q tf-models-official
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
**Loading the Model**
|
| 26 |
+
To utilize the bert_lc100_regression model within TensorFlow, follow these steps:
|
| 27 |
+
|
| 28 |
+
```
|
| 29 |
+
import tensorflow as tf
|
| 30 |
+
import tensorflow_text as text
|
| 31 |
+
model = tf.keras.models.load_model('saved_model/bert_lc100_regression/', compile=False)
|
| 32 |
+
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
**Making Predictions**
|
| 36 |
+
To assess the quality of code, given that `X_test` contains a list of code strings, use the model to predict as follows:
|
| 37 |
+
```
|
| 38 |
+
y_pred = model.predict(X_test)
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Reference
|
| 42 |
+
If you found the dataset useful in your research or applications, please cite using the following BibTeX:
|
| 43 |
+
```
|
| 44 |
+
@INPROCEEDINGS{10386406,
|
| 45 |
+
author={Wang, Tianyu and Chen, Zhixiong},
|
| 46 |
+
booktitle={2023 IEEE International Conference on Big Data (BigData)},
|
| 47 |
+
title={Analyzing Code Text Strings for Code Evaluation},
|
| 48 |
+
year={2023},
|
| 49 |
+
volume={},
|
| 50 |
+
number={},
|
| 51 |
+
pages={5619-5628},
|
| 52 |
+
keywords={Measurement;Deep learning;Codes;Bidirectional control;Organizations;Transformers;Software;code assessment;code annotation;deep learning;nature language processing;software assurance;code security},
|
| 53 |
+
doi={10.1109/BigData59044.2023.10386406}
|
| 54 |
+
}
|
| 55 |
+
```
|