ABSA / app.py
DLBot's picture
initial commit
c377ead
raw
history blame contribute delete
361 Bytes
import gradio as gr
from setfit import AbsaModel
model = AbsaModel.from_pretrained(
"tomaarsen/setfit-absa-paraphrase-mpnet-base-v2-restaurants-aspect",
"tomaarsen/setfit-absa-paraphrase-mpnet-base-v2-restaurants-polarity"
)
def predict(text):
return model.predict(text)
demo = gr.Interface(fn=predict, inputs="text", outputs="text")
demo.launch()