YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Korean Grammatical Error Correction Model

maintainer: Soyoung Yoon

Official repository: link

Dataset request form: link

Demo: link

Colab demo: link

Sample code

import torch
from transformers import PreTrainedTokenizerFast
from transformers import BartForConditionalGeneration

tokenizer = PreTrainedTokenizerFast.from_pretrained('Soyoung97/gec_kr')
model = BartForConditionalGeneration.from_pretrained('Soyoung97/gec_kr')

text = 'ν•œκ΅­μ–΄λŠ”μ–΄λ ΅λ‹€.'

raw_input_ids = tokenizer.encode(text)
input_ids = [tokenizer.bos_token_id] + raw_input_ids + [tokenizer.eos_token_id]
corrected_ids = model.generate(torch.tensor([input_ids]),
                                max_length=128,
                                eos_token_id=1, num_beams=4,
                                early_stopping=True, repetition_penalty=2.0)
output_text = tokenizer.decode(corrected_ids.squeeze().tolist(), skip_special_tokens=True)


output_text
>>> 'ν•œκ΅­μ–΄λŠ” μ–΄λ ΅λ‹€.'

Special thanks to the KoBART-summarization repository (referenced from it)

Downloads last month
99
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using Soyoung97/gec_kr 1