MRNH's picture
Create README.md
63a965b
|
raw
history blame
932 Bytes
metadata
language:
  - en
pipeline_tag: text2text-generation
metrics:
  - f1
tags:
  - grammatical error correction
  - GEC
  - russian

This is a fine-tuned version of Multilingual Bart trained on Russian in particular on the public dataset RULEC-GEC for Grammatical Error Correction.

To initialize the model:

from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
model = MBartForConditionalGeneration.from_pretrained("MRNH/mbart-russian-grammar-corrector")

To generate text using the model:

tokenizer = MBart50TokenizerFast.from_pretrained("MRNH/mbart-russian-grammar-corrector", src_lang="ru_RU", tgt_lang="ru_RU")
input = tokenizer("I was here yesterday to studying",text_target="I was here yesterday to study", return_tensors='pt')
output = model.generate(input["input_ids"],attention_mask=input["attention_mask"],forced_bos_token_id=tokenizer_it.lang_code_to_id["ru_RU"])