Views
No views yet
pip install happytransformer 1from happytransformer import HappyTextToText, TTSettings
2happy_tt = HappyTextToText("T5", "aiassociates/t5-small-grammar-correction-german")
3args = TTSettings(num_beams=5, min_length=1)
4# Add the prefix "grammar: " before each input
5result = happy_tt.generate_text("grammar: hier ein kleines beispiel was haltet ihr von der korrektur", args=args)
6print(result.text) # Hier ein kleines Beispiel: Was haltet ihr von der Korrektur?