| from happytransformer import HappyTextToText, TTSettings | |
| input_text = input('Enter your mispelled text: ') | |
| happy_tt = HappyTextToText('T5', load_path='.') | |
| beam_settings = TTSettings(num_beams=5, min_length=1, max_length=100) | |
| output_text_1 = happy_tt.generate_text( | |
| f'grammar: {input_text}', | |
| args=beam_settings, | |
| ) | |
| print(output_text_1.text) | |