summerstay commited on
Commit
ae53f18
1 Parent(s): e321dec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -1,4 +1,21 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  from sentence_transformers import SentenceTransformer
3
 
4
  model_Q = SentenceTransformer('flax-sentence-embeddings/multi-QA_v1-mpnet-asymmetric-Q')
@@ -16,4 +33,5 @@ outputs = ['text'],
16
  title = 'get vectors',
17
  description = 'get vectors for search')
18
 
19
- interface.launch(inline = False)
 
 
1
  import gradio as gr
2
+
3
+ from transformers import pipeline
4
+
5
+ sentiment = pipeline("sentiment-analysis")
6
+
7
+ def get_sentiment(input_text):
8
+ return sentiment(input_text)
9
+
10
+ iface = gr.Interface(fn = get_sentiment,
11
+ inputs = "text",
12
+ outputs = ['text'],
13
+ title = 'Sentiment Analysis',
14
+ description="Get Sentiment Negative/Positive for the given input")
15
+
16
+ iface.launch(inline = False)
17
+ """
18
+ import gradio as gr
19
  from sentence_transformers import SentenceTransformer
20
 
21
  model_Q = SentenceTransformer('flax-sentence-embeddings/multi-QA_v1-mpnet-asymmetric-Q')
 
33
  title = 'get vectors',
34
  description = 'get vectors for search')
35
 
36
+ interface.launch(inline = False)
37
+ """