zhixiusue commited on
Commit
abcabae
ยท
verified ยท
1 Parent(s): 480c6df

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +8 -8
streamlit_app.py CHANGED
@@ -95,23 +95,23 @@ def recommend_video(embedder, user_conditions, video_infos):
95
  return sorted(scored, reverse=True, key=lambda x: x[0])[:3]
96
 
97
  # Streamlit UI
98
- st.title("๐ŸŽฏ ํ•™์Šต ์กฐ๊ฑด ๊ธฐ๋ฐ˜ ์œ ํŠœ๋ธŒ ์ถ”์ฒœ๊ธฐ")
99
  st.write("ํ•™์Šต ๋ชฉํ‘œ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์กฐ๊ฑด์„ ์ถ”์ถœํ•˜๊ณ  ์œ ํŠœ๋ธŒ ์˜์ƒ์„ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค.")
100
 
101
- user_input = st.text_input("๐Ÿ’ฌ ํ•™์Šต ๋ชฉํ‘œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”", "๋”ฅ๋Ÿฌ๋‹์„ ์‹ค์Šต ์œ„์ฃผ๋กœ 30๋ถ„ ์•ˆ์— ๋ฐฐ์šฐ๊ณ  ์‹ถ์–ด์š”")
102
- if st.button("๐Ÿ” ์ถ”์ฒœ ์‹œ์ž‘"):
103
  tokenizer, model = load_model()
104
  embedder = load_embedder()
105
 
106
- entities = predict_entities(user_input, tokenizer, model)
107
- st.subheader("๐Ÿ“Œ ์ถ”์ถœ๋œ ์กฐ๊ฑด")
108
- st.json(entities)
109
 
110
  search_query = " ".join([v for v in entities.values() if v])
111
  video_candidates = search_youtube_videos(search_query)
112
  top_recommendations = recommend_video(embedder, entities, video_candidates)
113
 
114
- st.subheader("๐Ÿ“บ ์ถ”์ฒœ ์œ ํŠœ๋ธŒ ์˜์ƒ")
115
  for score, video in top_recommendations:
116
  st.markdown(f"**{video['title']}** ")
117
- st.markdown(f"๐Ÿ”— [๋งํฌ](https://www.youtube.com/watch?v={video['video_id']})")
 
95
  return sorted(scored, reverse=True, key=lambda x: x[0])[:3]
96
 
97
  # Streamlit UI
98
+ st.title("EduTube Navigator")
99
  st.write("ํ•™์Šต ๋ชฉํ‘œ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์กฐ๊ฑด์„ ์ถ”์ถœํ•˜๊ณ  ์œ ํŠœ๋ธŒ ์˜์ƒ์„ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค.")
100
 
101
+ user_input = st.text_input("ํ•™์Šต ๋ชฉํ‘œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”", "๋”ฅ๋Ÿฌ๋‹์„ ์‹ค์Šต ์œ„์ฃผ๋กœ 30๋ถ„ ์•ˆ์— ๋ฐฐ์šฐ๊ณ  ์‹ถ์–ด์š”")
102
+ if st.button("์ถ”์ฒœ ์‹œ์ž‘"):
103
  tokenizer, model = load_model()
104
  embedder = load_embedder()
105
 
106
+ #entities = predict_entities(user_input, tokenizer, model)
107
+ #st.subheader("๐Ÿ“Œ ์ถ”์ถœ๋œ ์กฐ๊ฑด")
108
+ #st.json(entities)
109
 
110
  search_query = " ".join([v for v in entities.values() if v])
111
  video_candidates = search_youtube_videos(search_query)
112
  top_recommendations = recommend_video(embedder, entities, video_candidates)
113
 
114
+ st.subheader("์ถ”์ฒœ ์œ ํŠœ๋ธŒ ์˜์ƒ")
115
  for score, video in top_recommendations:
116
  st.markdown(f"**{video['title']}** ")
117
+ st.markdown(f"๐Ÿ”—[๋งํฌ](https://www.youtube.com/watch?v={video['video_id']})")