|
import pandas as pd |
|
from fastai.text.all import * |
|
from datasets import load_dataset |
|
|
|
learn = text_classifier_learner(dls, AWD_LSTM, drop_mult=0.5, metrics=accuracy,cbs=callbacks).to_fp16() |
|
learn = learn.load_encoder('finetunedClass.pth') |
|
|
|
def predict(frase): |
|
pred = learn.predict(frase) |
|
return pred |
|
|
|
gr.Interface(fn=predict, inputs="text", outputs="text", examples=['i had been talking to coach claudia barcomb and coach ali boe for a long time and they both made me feel very welcomed at union']).launch(share=False) |