Update app.py
Browse files
app.py
CHANGED
@@ -41,8 +41,21 @@ def get_sentiment_from_llm(sentence):
|
|
41 |
)[0],
|
42 |
skip_special_tokens=True)
|
43 |
return "\n".join(output.split('PPrint '))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
-
gr.Interface.from_pipeline(get_sentiment_from_llm,
|
46 |
-
title="Sentiment Analysis",
|
47 |
-
description="Sentiment analysis and keywords extraction. Powered by prompt tuned google/flan-t5-base",
|
48 |
-
).launch()
|
|
|
41 |
)[0],
|
42 |
skip_special_tokens=True)
|
43 |
return "\n".join(output.split('PPrint '))
|
44 |
+
|
45 |
+
sentiment_extr = gr.Interface(
|
46 |
+
fn=get_sentiment_from_llm,
|
47 |
+
inputs=gr.Textbox(label="Input Text", type="string"),
|
48 |
+
outputs=gr.Textbox(label="Generated Text", type="string"),
|
49 |
+
title="Sentiments analysis",
|
50 |
+
description="Sentiment analysis and keywords extraction. Powered by prompt tuned google/flan-t5-base",
|
51 |
+
)
|
52 |
+
|
53 |
+
with demo:
|
54 |
+
gr.TabbedInterface([sentiment_extr], ["Sentiment text analysis"])
|
55 |
+
|
56 |
+
demo.launch()
|
57 |
|
58 |
+
#gr.Interface.from_pipeline(get_sentiment_from_llm,
|
59 |
+
# title="Sentiment Analysis",
|
60 |
+
# description="Sentiment analysis and keywords extraction. Powered by prompt tuned google/flan-t5-base",
|
61 |
+
# ).launch()
|