Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,94 @@
|
|
1 |
# Identifier-Renaming
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
|
|
1 |
# Identifier-Renaming
|
2 |
+
|
3 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
4 |
+
Generating higher quality variable names for code by renaming masked variable names.
|
5 |
+
## Model Details
|
6 |
+
|
7 |
+
### Model Description
|
8 |
+
|
9 |
+
<!-- Provide a longer summary of what this model is. -->
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
- **Developed by:** SMART Lab, Dalhousie University
|
14 |
+
- **Funded by:** [More Information Needed]
|
15 |
+
- **Model type:** Masked Language model
|
16 |
+
- **Language(s) (NLP):** Coded in Python to handle Java code
|
17 |
+
- **Finetuned from model:** GraphCodeBERT
|
18 |
+
|
19 |
+
### Model Sources [optional]
|
20 |
+
|
21 |
+
<!-- Provide the basic links for the model. -->
|
22 |
+
|
23 |
+
- **Repository:** https://github.com/SMART-Dal/Identifier-Renaming
|
24 |
+
|
25 |
+
## Uses
|
26 |
+
|
27 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
28 |
+
Input Java code snippets with all instances of a particular variable name replaced by "[MASK]"<br>
|
29 |
+
Input the number of tokens desired in the variable name (how long should it be). Else, input "0" to get a random number of tokens sampled from
|
30 |
+
training data distribution<br>
|
31 |
+
The code snippets must ideally be entire classes for best results. A prediction for the masked variable name is presented as output.
|
32 |
+
|
33 |
+
### Out-of-Scope Use
|
34 |
+
|
35 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
36 |
+
This non-fine-tuned version of the model is designed for generic code completion tasks. The fine-tuned model is designed to focus solely on identifier names.<br>
|
37 |
+
Ensure all instances of a particular variable name are masked.
|
38 |
+
[More Information Needed]
|
39 |
+
|
40 |
+
## Bias, Risks, and Limitations
|
41 |
+
|
42 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
43 |
+
Training is only done for a relatively small dataset and few epochs, and thus, the model might be under-trained. <br>
|
44 |
+
Even with the correct output, the syntax of the model can be occasionally dubious.<br>
|
45 |
+
Model is not perfect and identifier renamings must be reviewed till performance in test settings is not evaluated.
|
46 |
+
|
47 |
+
[More Information Needed]
|
48 |
+
|
49 |
+
### Recommendations
|
50 |
+
|
51 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
52 |
+
|
53 |
+
Use model as described and verify outputs before using them.
|
54 |
+
## How to Get Started with the Model
|
55 |
+
|
56 |
+
Clone the repository and load model state dict using 'model_26_2'
|
57 |
+
|
58 |
+
|
59 |
+
### Training Details
|
60 |
+
|
61 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
62 |
+
Trained on a subset of a dataset of 1000 classes with 612 lines of code on average for 3 epochs and a Learning Rate of 2e-5.
|
63 |
+
[More Information Needed]
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
## Evaluation
|
68 |
+
227 Java classes used for evaluation
|
69 |
+
|
70 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
71 |
+
Perplexty of Base Model: 37580
|
72 |
+
Perplexity of Fine-tuned Model: 23
|
73 |
+
|
74 |
+
|
75 |
+
[More Information Needed]
|
76 |
+
|
77 |
+
#### Factors
|
78 |
+
|
79 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
80 |
+
|
81 |
+
[More Information Needed]
|
82 |
+
|
83 |
+
#### Metrics
|
84 |
+
|
85 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
86 |
+
Perplexity is used to evaluate the performance of the model. It judges how surprising it is for a model to predict the given text.
|
87 |
+
|
88 |
+
|
89 |
+
<!-- Relevant interpretability work for the model goes here -->
|
90 |
+
|
91 |
+
[More Information Needed]
|
92 |
+
|
93 |
+
|
94 |
|