duwing commited on
Commit
eae7f3b
ยท
verified ยท
1 Parent(s): f8a8ebd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
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
- value = st.query_params['q']
126
- if value:
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
- st.subheader("๊ธฐ์‚ฌ ์ œ๋ชฉ")
137
- st.write(title)
138
-
139
- st.subheader("๋ณธ๋ฌธ ๋‚ด์šฉ")
140
- st.write(content)
141
-
142
- st.subheader("๋Œ“๊ธ€")
143
- for comment in comments:
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("์Šคํฌ๋žฉ ์‹œ์ž‘"):