metadata
pipeline_tag: text2text-generation
widget:
- text: Hellooooo
example_title: Ex 0
- text: believ
example_title: Ex 1
language:
- en
tags:
- spell
- spell correction
- spelling
- spelling correction
- english
- english spelling
Model Card for Model ID
This is a model for word-based spell correction tasks. This model is generated by fine-tuning bart base model.
This model works best for ''WORD-BASED'' spell correction(not so good with the sequence of words
).
How to Get Started with the Model
from transformers import AutoTokenizer, TFBartForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("veghar/spell_correct_bart_base")
model = TFBartForConditionalGeneration.from_pretrained("veghar/spell_correct_bart_base")
text='believ'
text_tok=tokenizer(text,padding=True, return_tensors='tf')
input_ids = text_tok['input_ids']
outputs = model.generate(input_ids=input_ids, max_length=10,num_return_sequences=3)
corrected_sentences = tokenizer.batch_decode(outputs, skip_special_tokens=True)
print('Misspelled word:', text)
print('Corrected word:', corrected_sentences)
>>Misspelled word: believ
>>Corrected word: ['believe', 'belief', 'believer']