Spaces:
Runtime error
Runtime error
Commit
·
0f80297
1
Parent(s):
d5960c1
update app
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import pandas as pd
|
|
| 2 |
import streamlit as st
|
| 3 |
from streamlit_text_rating.st_text_rater import st_text_rater
|
| 4 |
from sentiment import classify_sentiment
|
|
|
|
| 5 |
|
| 6 |
st.set_page_config( # Alternate names: setup_page, page, layout
|
| 7 |
layout="wide", # Can be "centered" or "wide". In the future also "dashboard", etc.
|
|
@@ -9,6 +10,7 @@ st.set_page_config( # Alternate names: setup_page, page, layout
|
|
| 9 |
page_title='None', # String or None. Strings get appended with "• Streamlit".
|
| 10 |
)
|
| 11 |
|
|
|
|
| 12 |
padding_top = 0
|
| 13 |
st.markdown(f"""
|
| 14 |
<style>
|
|
@@ -77,3 +79,12 @@ if select_task=='Detect Sentiment':
|
|
| 77 |
else:
|
| 78 |
response = st_text_rater(t + f"--> This statement is {sentiments[i]}",
|
| 79 |
color_background='rgb(233, 116, 81)',key=t)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import streamlit as st
|
| 3 |
from streamlit_text_rating.st_text_rater import st_text_rater
|
| 4 |
from sentiment import classify_sentiment
|
| 5 |
+
from zeroshot_clf import zero_shot_classification
|
| 6 |
|
| 7 |
st.set_page_config( # Alternate names: setup_page, page, layout
|
| 8 |
layout="wide", # Can be "centered" or "wide". In the future also "dashboard", etc.
|
|
|
|
| 10 |
page_title='None', # String or None. Strings get appended with "• Streamlit".
|
| 11 |
)
|
| 12 |
|
| 13 |
+
|
| 14 |
padding_top = 0
|
| 15 |
st.markdown(f"""
|
| 16 |
<style>
|
|
|
|
| 79 |
else:
|
| 80 |
response = st_text_rater(t + f"--> This statement is {sentiments[i]}",
|
| 81 |
color_background='rgb(233, 116, 81)',key=t)
|
| 82 |
+
|
| 83 |
+
if select_task=='Zero Shot Classification':
|
| 84 |
+
st.header("You are now performing Zero Shot Classification")
|
| 85 |
+
input_texts = st.text_input(label="Input text to classify into topics")
|
| 86 |
+
input_lables = st.text_input(label="Enter labels separated by commas")
|
| 87 |
+
|
| 88 |
+
if len(input_texts) !=0 and len(input_lables) != 0:
|
| 89 |
+
output=zero_shot_classification(input_texts, input_lables)
|
| 90 |
+
st.write(output)
|