File size: 680 Bytes
bc5386a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import keras
import joblib
from happytransformer import HappyTextToText
from IPython.display import FileLink
from happytransformer import TTTrainArgs
#args = TTTrainArgs(batch_size=8,num_train_epochs=10, learning_rate=1e-4)
#happy_tt = HappyTextToText("T5", "prithivida/grammar_error_correcter_v1")
#joblib.dump(happy_tt , 'finetuned_model_prithivida/grammar_error_correcter_v1')
happy_tt = joblib.load("../input/grammar-error-correcter-model/grammar_error_correcter_v1_loss_0.28348055481910706lrt_1e-05")
eval=[1.0]
def gram(st):
    #happy_tt
    result_2 = m_jlib.generate_text(st, args=beam_settings)
    print(result_2.text)
    return result_2.text
  
st=input()
gram(st)