Grammar_correction / manage.py
Jayaprakash's picture
create manage.py
bc5386a
raw
history blame contribute delete
680 Bytes
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)