DLBot commited on
Commit
c377ead
·
1 Parent(s): fa4c47b

initial commit

Browse files
Files changed (2) hide show
  1. app.py +12 -0
  2. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from setfit import AbsaModel
3
+
4
+ model = AbsaModel.from_pretrained(
5
+ "tomaarsen/setfit-absa-paraphrase-mpnet-base-v2-restaurants-aspect",
6
+ "tomaarsen/setfit-absa-paraphrase-mpnet-base-v2-restaurants-polarity"
7
+ )
8
+ def predict(text):
9
+ return model.predict(text)
10
+
11
+ demo = gr.Interface(fn=predict, inputs="text", outputs="text")
12
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ setfit[absa]