model documentation
Browse files
README.md
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
|
3 |
+
tags:
|
4 |
+
- bert
|
5 |
+
metrics:
|
6 |
+
- CodeBLEU
|
7 |
+
---
|
8 |
+
# Model Card for plbart-base
|
9 |
+
|
10 |
+
|
11 |
+
# Model Details
|
12 |
+
|
13 |
+
## Model Description
|
14 |
+
|
15 |
+
The PLBART model was proposed in Unified Pre-training for Program Understanding and Generation
|
16 |
+
|
17 |
+
- **Developed by:** UCLA NLP
|
18 |
+
- **Shared by [Optional]:** [Gunjan Chhablani](https://huggingface.co/gchhablani)
|
19 |
+
- **Model type:** Text2Text Generation
|
20 |
+
- **Language(s) (NLP):** More information needed
|
21 |
+
- **License:** More information needed
|
22 |
+
- **Related Models:** bert-base-multilingual-uncased
|
23 |
+
- **Parent Model:** plbart
|
24 |
+
- **Resources for more information:**
|
25 |
+
- [Associated Paper](https://arxiv.org/abs/2103.06333)
|
26 |
+
- [Model Documentation](https://huggingface.co/docs/transformers/model_doc/plbart)
|
27 |
+
|
28 |
+
# Uses
|
29 |
+
|
30 |
+
## Direct Use
|
31 |
+
|
32 |
+
The pre-trained model plbart-base has been trained using multilingual denoising task
|
33 |
+
|
34 |
+
## Downstream Use [Optional]
|
35 |
+
|
36 |
+
More information needed
|
37 |
+
|
38 |
+
## Out-of-Scope Use
|
39 |
+
More information needed
|
40 |
+
|
41 |
+
# Bias, Risks, and Limitations
|
42 |
+
|
43 |
+
|
44 |
+
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.
|
45 |
+
|
46 |
+
|
47 |
+
## Recommendations
|
48 |
+
|
49 |
+
|
50 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
51 |
+
|
52 |
+
|
53 |
+
# Training Details
|
54 |
+
|
55 |
+
## Training Data
|
56 |
+
|
57 |
+
More information needed
|
58 |
+
|
59 |
+
## Training Procedure
|
60 |
+
|
61 |
+
|
62 |
+
|
63 |
+
### Preprocessing
|
64 |
+
|
65 |
+
The model creators note in the [associated paper](https://arxiv.org/pdf/2103.06333.pdf)
|
66 |
+
> We tokenize all the data with a sentencepiece model (Kudo and Richardson, 2018) learned on 1/5’th of the pre-training data. We train sentencepiece to learn 50,000 subword tokens. One key challenge to aggregate data from different modalities is that some modalities may have more data, such as we have 14 times more data in PL than NL. Therefore, we mix and up/down sample the data following Conneau and Lample (2019) to alleviate the bias towards PL.
|
67 |
+
|
68 |
+
### Speeds, Sizes, Times
|
69 |
+
The model creators note in the [associated paper]()
|
70 |
+
> The effective batch size is maintained at 2048 instances.
|
71 |
+
|
72 |
+
# Evaluation
|
73 |
+
|
74 |
+
|
75 |
+
## Testing Data, Factors & Metrics
|
76 |
+
|
77 |
+
### Testing Data
|
78 |
+
The model creators note in the [associated paper](https://arxiv.org/pdf/2103.06333.pdf)
|
79 |
+
>CodeXGLUE (Lu et al., 2021) provided public dataset and corresponding train validation-test splits for all the tasks
|
80 |
+
|
81 |
+
### Factors
|
82 |
+
|
83 |
+
More information needed
|
84 |
+
|
85 |
+
### Metrics
|
86 |
+
|
87 |
+
More information needed
|
88 |
+
|
89 |
+
## Results
|
90 |
+
|
91 |
+
More information needed
|
92 |
+
|
93 |
+
# Model Examination
|
94 |
+
More information needed
|
95 |
+
|
96 |
+
# Environmental Impact
|
97 |
+
|
98 |
+
|
99 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
100 |
+
|
101 |
+
- **Hardware Type:** 8 Nvidia GeForce RTX 2080 Ti GPUs
|
102 |
+
- **Hours used:** More information needed
|
103 |
+
- **Cloud Provider:** More information needed
|
104 |
+
- **Compute Region:** More information needed
|
105 |
+
- **Carbon Emitted:** More information needed
|
106 |
+
|
107 |
+
# Technical Specifications [optional]
|
108 |
+
|
109 |
+
## Model Architecture and Objective
|
110 |
+
|
111 |
+
PLBart is a multilingual encoder-decoder (sequence-to-sequence) model primarily intended for code-to-text, text-to-code, code-to-code tasks. As the model is multilingual it expects the sequences in a different format. A special language id token is added in both the source and target text. The source text format is X [eos, src_lang_code] where X is the source text.
|
112 |
+
|
113 |
+
## Compute Infrastructure
|
114 |
+
The model creators note in the [associated paper](https://arxiv.org/pdf/2103.06333.pdf)
|
115 |
+
> PLBART uses the same architecture as BARTbase (Lewis et al., 2020), it uses the sequence-to-sequence Transformer architecture (Vaswani et al., 2017), with 6 layers of encoder and 6 layers of decoder with model dimension of 768 and 12 heads (∼140M parameters). The only exception is, we include an additional layer normalization layer on top of both the encoder and decoder following Liu et al. (2020),
|
116 |
+
|
117 |
+
### Hardware
|
118 |
+
|
119 |
+
More information needed
|
120 |
+
|
121 |
+
### Software
|
122 |
+
|
123 |
+
More information needed
|
124 |
+
|
125 |
+
# Citation
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
**BibTeX:**
|
130 |
+
```
|
131 |
+
@misc{https://doi.org/10.48550/arxiv.2103.06333,
|
132 |
+
doi = {10.48550/ARXIV.2103.06333},
|
133 |
+
|
134 |
+
url = {https://arxiv.org/abs/2103.06333},
|
135 |
+
|
136 |
+
author = {Ahmad, Wasi Uddin and Chakraborty, Saikat and Ray, Baishakhi and Chang, Kai-Wei},
|
137 |
+
|
138 |
+
keywords = {Computation and Language (cs.CL), Programming Languages (cs.PL), FOS: Computer and information sciences, FOS: Computer and information sciences},
|
139 |
+
|
140 |
+
title = {Unified Pre-training for Program Understanding and Generation},
|
141 |
+
|
142 |
+
publisher = {arXiv},
|
143 |
+
|
144 |
+
year = {2021},
|
145 |
+
|
146 |
+
copyright = {arXiv.org perpetual, non-exclusive license}
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
```
|
151 |
+
|
152 |
+
**APA:**
|
153 |
+
More information needed
|
154 |
+
|
155 |
+
# Glossary [optional]
|
156 |
+
|
157 |
+
>CodeBLEU is a metric for measuring the quality of the synthesized code (Ren et al., 2020). Unlike BLEU, CodeBLEU also considers grammatical and logical correctness based on the abstract syntax tree and the data-flow structure.
|
158 |
+
|
159 |
+
# More Information [optional]
|
160 |
+
|
161 |
+
More information needed
|
162 |
+
|
163 |
+
# Model Card Authors [optional]
|
164 |
+
|
165 |
+
|
166 |
+
UCLA NLP in collaboration with Ezi Ozoani and the Hugging Face team
|
167 |
+
|
168 |
+
# Model Card Contact
|
169 |
+
More information needed
|
170 |
+
|
171 |
+
# How to Get Started with the Model
|
172 |
+
|
173 |
+
Use the code below to get started with the model.
|
174 |
+
|
175 |
+
<details>
|
176 |
+
<summary> Click to expand </summary>
|
177 |
+
|
178 |
+
```python
|
179 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
180 |
+
|
181 |
+
tokenizer = AutoTokenizer.from_pretrained("uclanlp/plbart-base")
|
182 |
+
|
183 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("uclanlp/plbart-base")
|
184 |
+
|
185 |
+
```
|
186 |
+
</details>
|