Commit
·
804e0da
1
Parent(s):
9f753c3
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,94 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- asset
|
| 5 |
+
- wi_locness
|
| 6 |
+
- GEM/wiki_auto_asset_turk
|
| 7 |
+
- discofuse
|
| 8 |
+
- zaemyung/IteraTeR_plus
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
metrics:
|
| 12 |
+
- sari
|
| 13 |
+
- bleu
|
| 14 |
+
- accuracy
|
| 15 |
---
|
| 16 |
+
# Model Card for CoEdIT-Large
|
| 17 |
+
|
| 18 |
+
This model was obtained by fine-tuning the corresponding google/flan-t5-large model on the CoEdIT dataset.
|
| 19 |
+
|
| 20 |
+
Paper: CoEdIT: ext Editing by Task-Specific Instruction Tuning
|
| 21 |
+
Authors: Vipul Raheja, Dhruv Kumar, Ryan Koo, Dongyeop Kang
|
| 22 |
+
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
### Model Description
|
| 26 |
+
|
| 27 |
+
- **Language(s) (NLP)**: English
|
| 28 |
+
- **Finetuned from model:** google/flan-t5-large
|
| 29 |
+
|
| 30 |
+
### Model Sources [optional]
|
| 31 |
+
|
| 32 |
+
- **Repository:** https://github.com/vipulraheja/coedit
|
| 33 |
+
- **Paper [optional]:** [More Information Needed]
|
| 34 |
+
|
| 35 |
+
## How to use
|
| 36 |
+
We make available the models presented in our paper.
|
| 37 |
+
|
| 38 |
+
<table>
|
| 39 |
+
<tr>
|
| 40 |
+
<th>Model</th>
|
| 41 |
+
<th>Number of parameters</th>
|
| 42 |
+
</tr>
|
| 43 |
+
<tr>
|
| 44 |
+
<td>CoEdIT-large</td>
|
| 45 |
+
<td>770M</td>
|
| 46 |
+
</tr>
|
| 47 |
+
<tr>
|
| 48 |
+
<td>CoEdIT-xl</td>
|
| 49 |
+
<td>3B</td>
|
| 50 |
+
</tr>
|
| 51 |
+
<tr>
|
| 52 |
+
<td>CoEdIT-xxl</td>
|
| 53 |
+
<td>11B</td>
|
| 54 |
+
</tr>
|
| 55 |
+
</table>
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
## Uses
|
| 59 |
+
|
| 60 |
+
## Text Revision Task
|
| 61 |
+
Given an edit instruction and an original text, our model can generate the edited version of the text.<br>
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
|
| 65 |
+
## Usage
|
| 66 |
+
```python
|
| 67 |
+
from transformers import AutoTokenizer, T5ForConditionalGeneration
|
| 68 |
+
|
| 69 |
+
tokenizer = AutoTokenizer.from_pretrained("grammarly/coedit-large")
|
| 70 |
+
model = T5ForConditionalGeneration.from_pretrained("grammarly/coedit-large")
|
| 71 |
+
input_text =
|
| 72 |
+
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
|
| 73 |
+
outputs = model.generate(input_ids, max_length=256)
|
| 74 |
+
edited_text = tokenizer.decode(outputs[0], skip_special_tokens=True)[0]
|
| 75 |
+
|
| 76 |
+
before_input = 'Fix grammatical errors in this sentence: New kinds of vehicles will be invented with new technology than today.'
|
| 77 |
+
model_input = tokenizer(before_input, return_tensors='pt')
|
| 78 |
+
model_outputs = model.generate(**model_input, num_beams=8, max_length=1024)
|
| 79 |
+
after_text = tokenizer.batch_decode(model_outputs, skip_special_tokens=True)[0]
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
#### Software
|
| 84 |
+
https://github.com/vipulraheja/coedit
|
| 85 |
+
|
| 86 |
+
## Citation
|
| 87 |
+
|
| 88 |
+
**BibTeX:**
|
| 89 |
+
|
| 90 |
+
[More Information Needed]
|
| 91 |
+
|
| 92 |
+
**APA:**
|
| 93 |
+
|
| 94 |
+
[More Information Needed]
|