Add basic model card
Browse files
README.md
CHANGED
@@ -13,4 +13,29 @@ tags:
|
|
13 |
- seq2seq
|
14 |
- bart
|
15 |
- cows-l2h
|
16 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
- seq2seq
|
14 |
- bart
|
15 |
- cows-l2h
|
16 |
+
---
|
17 |
+
|
18 |
+
This model has been trained on 80% of the COWS-L2H dataset for grammatical error correction of Spanish text. The corpus was sentencized, so the model has been fine-tuned for SENTENCE CORRECTION. This model will likely not perform well on an entire paragraph. To correct a paragraph, sentencize the text and run the model for each sentence.
|
19 |
+
|
20 |
+
BLEU: 0.797 on COWS-L2H
|
21 |
+
|
22 |
+
Example usage:
|
23 |
+
|
24 |
+
```python
|
25 |
+
from transformers import AutoTokenizer, BartForConditionalGeneration
|
26 |
+
|
27 |
+
tokenizer = AutoTokenizer.from_pretrained("SkitCon/gec-spanish-BARTO-COWS-L2H")
|
28 |
+
model = BartForConditionalGeneration.from_pretrained("SkitCon/gec-spanish-BARTO-COWS-L2H")
|
29 |
+
|
30 |
+
input_sentences = ["Yo va al tienda.", "Espero que tú ganas."]
|
31 |
+
|
32 |
+
tokenized_text = tokenizer(input_sentences, return_tensors="pt")
|
33 |
+
|
34 |
+
input_ids = source_enc["input_ids"].squeeze()
|
35 |
+
attention_mask = source_enc["attention_mask"].squeeze()
|
36 |
+
|
37 |
+
outputs = model.generate(input_ids=input_ids, attention_mask=attention_mask)
|
38 |
+
|
39 |
+
for sentence in tokenizer.batch_decode(outputs, skip_special_tokens=True):
|
40 |
+
print(sentence)
|
41 |
+
```
|