Update streamlit_app.py
Browse files- 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("
|
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"๐
|
|
|
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']})")
|