Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -118,31 +118,31 @@ def processing_data(comments):
|
|
118 |
|
119 |
def main():
|
120 |
global sentiment_model
|
|
|
|
|
|
|
121 |
sentiment_model = create_sentiment_bert()
|
122 |
st.title("๋๊ธ ํํฐ๋ง ์๋น์ค")
|
123 |
|
124 |
# URL ์
๋ ฅ ๋ฐ๊ธฐ
|
125 |
-
|
126 |
-
|
127 |
url = st.text_input("url์ ์
๋ ฅํ์ธ์",value=st.query_params['q'])
|
128 |
-
else:
|
129 |
-
url = st.text_input("url์ ์
๋ ฅํ์ธ์")
|
130 |
-
|
131 |
-
|
132 |
-
if value:
|
133 |
title, content, comments = get_comments(url)
|
|
|
|
|
|
|
|
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
if evaluation_predict(comment) == 1:
|
145 |
-
st.write(comment)
|
146 |
|
147 |
|
148 |
if st.button("์คํฌ๋ฉ ์์"):
|
|
|
118 |
|
119 |
def main():
|
120 |
global sentiment_model
|
121 |
+
title = ''
|
122 |
+
content = ''
|
123 |
+
comments = []
|
124 |
sentiment_model = create_sentiment_bert()
|
125 |
st.title("๋๊ธ ํํฐ๋ง ์๋น์ค")
|
126 |
|
127 |
# URL ์
๋ ฅ ๋ฐ๊ธฐ
|
128 |
+
if "q" in st.query_params:
|
129 |
+
value = st.query_params['q']
|
130 |
url = st.text_input("url์ ์
๋ ฅํ์ธ์",value=st.query_params['q'])
|
|
|
|
|
|
|
|
|
|
|
131 |
title, content, comments = get_comments(url)
|
132 |
+
|
133 |
+
# ๊ฒฐ๊ณผ ํ์
|
134 |
+
st.subheader("๊ธฐ์ฌ ์ ๋ชฉ")
|
135 |
+
st.write(title)
|
136 |
|
137 |
+
st.subheader("๋ณธ๋ฌธ ๋ด์ฉ")
|
138 |
+
st.write(content)
|
139 |
+
|
140 |
+
st.subheader("๋๊ธ")
|
141 |
+
for comment in comments:
|
142 |
+
if evaluation_predict(comment) == 1:
|
143 |
+
st.write(comment)
|
144 |
+
else:
|
145 |
+
url = st.text_input("url์ ์
๋ ฅํ์ธ์")
|
|
|
|
|
146 |
|
147 |
|
148 |
if st.button("์คํฌ๋ฉ ์์"):
|