|
from annotated_text import annotated_text |
|
import streamlit as st |
|
import openai |
|
import os |
|
|
|
|
|
openai.api_key = os.getenv("OPENAI_API_KEY") |
|
st.set_page_config(layout="wide") |
|
|
|
|
|
|
|
if 'points' not in st.session_state: |
|
st.session_state.points = 3 |
|
if 'history' not in st.session_state: |
|
st.session_state.history = [] |
|
|
|
def update_points(value): |
|
""" ํฌ์ธํธ ์
๋ฐ์ดํธ """ |
|
st.session_state.points += value |
|
|
|
|
|
def display_points(): |
|
""" ํฌ์ธํธ ํ์ """ |
|
st.sidebar.header(f"Current Points: {st.session_state.points}") |
|
|
|
def display_markdown_table(): |
|
"""์ง๊ธ๊น์ง ์ฌ์ฉํ ๊ธฐ๋ฅ๊ณผ ํฌ์ธํธ๋ฅผ ํ์ํ๋ ํ์คํ ๋ฆฌ ํจ์, ๊ธฐ๋ฅ์ ๋๋ฅธ ์์์ ํฌ์ธํธ ๋ณํ์ ํ์ฌ ํฌ์ธํธ๋ฅผ ํ๋ก ์ ๋ฆฌ""" |
|
markdown_table = """| ์์ | ์ ํํ ๊ธฐ๋ฅ | ํฌ์ธํธ ๋ณํ | ํ์ฌ ํฌ์ธํธ | |
|
| --- | --- | --- | --- | |
|
""" |
|
for i, step in enumerate(st.session_state.history): |
|
markdown_table += f"| {i+1} | {step[0]} | {step[1]} | {step[2]} |\n" |
|
st.sidebar.markdown(markdown_table) |
|
|
|
|
|
|
|
|
|
col, _ = st.columns(2) |
|
|
|
def display_passage(col): |
|
st.header("์ง๋ฌธ") |
|
global text_container |
|
text_container = st.container() |
|
|
|
global text_placeholder |
|
text_placeholder = text_container.empty() |
|
global user_text |
|
user_text = """๋ฏผ์ฃผ์ฃผ์ ์ฌํ๋ ๊ตญ๋ฏผ์ด ์ ์น์ ์ฐธ์ฌํ ๊ถ๋ฆฌ๋ฅผ ๋ณด์ฅํ๋ค. ๊ทธ๋ฌํ ๊ถ๋ฆฌ๋ฅผ ์ฐธ์ ๊ถ์ด๋ผ ํ๋๋ฐ, ์ด๋ ๊ธฐ๋ณธ์ ์ผ๋ก โ์ ๊ฑฐโ๋ก ์คํ๋๋ค. ์ ๊ฑฐ๋ ์ฌํ ์ง๋จ์ ๋ํ์๋ ๊ณต์ง์๋ฅผ ์ ์ถํ์ฌ ๊ทธ๋ค์๊ฒ ๋ํ์ฑ์ ๋ถ์ฌํ๋ ํ์์ด๋ค. ๊ทธ๋ฌ๋ฏ๋ก ๋์ ํฌํ์จ์ ๋ฏผ์ฃผ์ฃผ์์ ์ ๋น์ฑ ํ๋ณด์ ๊น์ ๊ด๋ จ์ด ์๋ค.<br><br> |
|
์ ๊ฑฐ ํฌํ ์ ๋์๋ ํฌํ๊ถ ํ์ฌ๋ฅผ ํฌํ์์ ์์ ์์ฌ์ ๋งก๊ธฐ๋ โ์์ ํฌํ์ โ์ ํฌํ๊ถ ํ์ฌ๋ฅผ ๊ตญ๋ฏผ์ ์๋ฌด๋ก ๊ฐ์ฃผํ๊ณ ์ ๋นํ ์ฌ์ ์์ด ๊ธฐ๊ถํ๋ฉด ๋ฒ์ ์ ์ฌ๋ฅผ ๊ฐํ๋ โ์๋ฌด ํฌํ์ โ๊ฐ ์๋ค. ์ฐ๋ฆฌ๋๋ผ๋ ์์ ํฌํ์ ๋ฅผ ์ฑํํ๊ณ ์๋๋ฐ, ์ต๊ทผ ์น๋ฅธ ์ ๊ฑฐ์ ํ๊ท ํฌํ์จ์ด 50ํผ์ผํธ๋๋ก ๋ํ๋ฌ๋ค. ๊ฒฝ์ ๊ฐ๋ฐ ํ๋ ฅ ๊ธฐ๊ตฌ(OECD) ํ์๊ตญ ํ๊ท ์ด 70ํผ์ผํธ๋์ธ ๊ฒ์ ์๊ฐํ๋ฉด ๋งค์ฐ ๋ฎ์ ์์น๋ผ ํ ์ ์๋ค. ์ด๋ฌํ ์ํฉ์ด ์ง์๋์ ์๋ฌด ํฌํ์ ๋ฅผ ๋์
ํด์ผ ํ๋ค๋ ์๊ฒฌ์ด ์ ์๋์๊ณ , ์์ ํฌํ์ ๊ฐ ๋ฏผ์ฃผ์ฃผ์์ ์์น์ ๋ง์ผ๋ฏ๋ก ์ด๋ฅผ ์ ์งํด์ผ ํ๋ค๋ ์๊ฒฌ๊ณผ ๋๋ฆฝํ๊ณ ์๋ค.<br><br> |
|
์๋ฌด ํฌํ์ ๋ฅผ ๋์
ํ์๋ ์ธก์ ๋ฎ์ ํฌํ์จ๋ก ํฌํ ๊ฒฐ๊ณผ์ ์ ๋น์ฑ์ ํ๋ณดํ์ง ๋ชปํ๋ ๋ฌธ์ ๊ฐ ๋งค์ฐ ์ฌ๊ฐํ๋ค๊ณ ์ฃผ์ฅํ๋ค. ๋ ์๋ฌด ํฌํ์ ์ ๊ฐ์ ์ฑ๊ณผ ๋ฒ์ ์ ์ฌ๊ฐ ํฌํ์จ์ ๋์ด๋ฏ๋ก ํฌํ์จ์ด ๋ฎ์์ ๋ฐ์ํ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์๋ค๊ณ ๋ณธ๋ค. ๊ทธ๋ฆฌ๊ณ ๊ตญ๋ฏผ ๋๋ถ๋ถ์ด ํฌํ์ ์ฐธ์ฌํ๊ฒ ๋๋ฉด ์ ์น์ธ๋ค์ด ๋ชจ๋ ๊ณ์ธต์ ์ง์ง๋ฅผ ๋ฐ๊ธฐ ์ํด ์ ์ฑ
๊ฒฝ์๋ ฅ์ ๋์ด๋ ค ํ ๊ฒ์ด๋ฏ๋ก ์ ์น ์์ธ ๊ณ์ธต์ ๋์ฑ ๊ด์ฌ์ ์๋ ํจ๊ณผ๊ฐ ์์ ๊ฒ์ด๋ผ๊ณ ์ด์ผ๊ธฐํ๋ค.<br><br> |
|
๋ฐ๋ฉด ์๋ฌด ํฌํ์ ์ ๋ฐ๋ํ๋ ์ธก์ ํ์ฌ ์ฐ๋ฆฌ๋๋ผ์ ํฌํ์จ์ด ์ ์น ์ง๋์๋ค์ ๋ํ์ฑ์ ํผ์ํ ๋งํผ ์ฌ๊ฐํ ์ํฉ์ ์๋๋ผ๊ณ ์ฃผ์ฅํ๋ค. ๋ ํฌํ์จ์ ๋์ด๋ ๊ฒ๋ณด๋ค ๊ตญ๋ฏผ์ ์ ๋ขฐ๋ฅผ ํ๋ณตํ๋ ๊ฒ์ด ๋ ์ค์ํ๊ณ , ์๋ฏผ ๊ต์ก์ด๋ ๋ชจ์ ํฌํ ๊ต์ก ํ๋ก๊ทธ๋จ์ผ๋ก๋ ํฌํ์จ ์์น์ ๊ธฐ๋ํ ์ ์๋ค๋ฉฐ ์๋ฌด ํฌํ์ ์ ๋์
๋ง์ด ํฌํ์จ์ด๋ ์ ์น์ ๊ด์ฌ์ ๋์ด๋ ํด๊ฒฐ ๋ฐฉ์์ ์๋๋ผ๊ณ ์ด์ผ๊ธฐํ๋ค. ๊ทธ๋ฆฌ๊ณ ์๋ฌด ํฌํ์ ๋ฅผ ๋์
ํ๋ฉด, ์ ์ถ๋ ์ ์น์ธ๋ค์ด ๋์ ํฌํ์จ์ ํ๊ณ๋ก ์ํ๋ฌด์ธ์ ํ๋๋ฅผ ๊ฐ๋ ๋ถ์์ฉ์ด ์๊ธด๋ค๋ ๊ฐ ํ๋ณด์๋ฅผ ์ ๋ชจ๋ฅด๋ ์ํ์์ ํฌํํ๋ ์ผ์ด ๋ฐ์ํ์ฌ ๊ตญ๋ฏผ์ ๋ป์ด ์คํ๋ ค ์๊ณก๋ ์ ์๋ค๋ฉฐ ์ฐ๋ ค์ ๋ชฉ์๋ฆฌ๋ฅผ ๋ด๊ณ ์๋ค.<br><br> |
|
""" |
|
text_placeholder.write(user_text, unsafe_allow_html=True) |
|
|
|
return text_placeholder, text_container, user_text |
|
|
|
|
|
def display_summary(col): |
|
st.header("์์ฝ ๊ฒฐ๊ณผ") |
|
global user_summary |
|
user_summary = st.text_area("์์ฝ๊ฒฐ๊ณผ๋ฅผ ์ ์ถํ์ธ์.") |
|
|
|
cols = st.columns(2) |
|
with cols[0]: |
|
btn_submit = st.button("์ ์ถ") |
|
if btn_submit: |
|
|
|
st.write("์ ์ถ ๋์์ต๋๋ค.") |
|
pass |
|
|
|
with cols[1]: |
|
btn_score = st.button("์ฑ์ ํ๊ธฐ") |
|
if btn_score and st.session_state.points > 0: |
|
update_points(1) |
|
st.session_state.history.append(["์ฑ์ ํ๊ธฐ", -1, st.session_state.points]) |
|
|
|
lubric = """์ฑ์ ๊ธฐ์ค ์: ๋ฌธ์ฅ์ ์ฃผ์ ๋ฅผ ํ์
ํ๊ณ , ์ฃผ์ ๋ด์ฉ์ ํ์
ํ ์ ์๋ค. ์ค: ๋ฌธ์ฅ์ ์ฃผ์ ๋ฅผ ํ์
ํ ์ ์๋ค. ํ: ๋ฌธ์ฅ์ ์ฃผ์ ๋ฅผ ํ์
ํ ์ ์๋ค.""" |
|
|
|
explanation_task = f"{lubric}์ ๊ธฐ์ค์ผ๋ก {user_summary}์ ๋ด์ฉ์ ์ฑ์ ํด์ฃผ์ธ์. ์ฑ์ ๊ธฐ์ค์ ๊ณต๊ฐํ์ง ๋ง๊ณ ์, ์ค,ํ๋ก ๋๋๊ณ ๊ฐ๋จํ ์ด์ ๋ฅผ ์๋ ค์ฃผ์ธ์." |
|
messages = [ |
|
{"role": "system", "content": "You are a helpful assistant. use only korean"}, |
|
{"role": "user", "content": explanation_task} |
|
] |
|
|
|
response = openai.ChatCompletion.create( |
|
model="gpt-3.5-turbo-16k", |
|
messages=messages, |
|
temperature=0.1, |
|
max_tokens=2500 |
|
) |
|
|
|
explanation = response['choices'][0]['message']['content'] |
|
st.write(f"์ฑ์ ํ๊ธฐ: {explanation}") |
|
pass |
|
else: |
|
if st.session_state.points == 0: |
|
|
|
st.write("ํฌ์ธํธ๊ฐ ์์ด์ ์ฑ์ ํ๊ธฐ๋ฅผ ํ ์ ์์ต๋๋ค.") |
|
pass |
|
|
|
def display_input_btns(col): |
|
st.header("์ธ๊ณต์ง๋ฅ ์ฌ์ฉํ๊ธฐ") |
|
global user_input |
|
user_input = st.text_area("๋ด์ฉ์ ๋ฃ๊ณ ๋ฒํผ์ ๋๋ฌ์ฃผ์ธ์:", "์ถ๊ฐ ์ค๋ช
์ด ํ์ํ๊ฑฐ๋ ๋ค์ ์ฐ๊ณ ์ถ์ ๋ด์ฉ์ ์
๋ ฅํ์ธ์.") |
|
|
|
|
|
cols = st.columns(4) |
|
with cols[0]: |
|
btn_keyword = st.button("ํค์๋ ์ฐพ๊ธฐ") |
|
if btn_keyword and st.session_state.points > 0: |
|
update_points(-1) |
|
st.session_state.history.append(["ํค์๋ ์ฐพ๊ธฐ", -1, st.session_state.points]) |
|
|
|
highlighted_text = """**๋ฏผ์ฃผ์ฃผ์ ์ฌํ**๋ ๊ตญ๋ฏผ์ด ์ ์น์ ์ฐธ์ฌํ ๊ถ๋ฆฌ๋ฅผ ๋ณด์ฅํ๋ค. ๊ทธ๋ฌํ ๊ถ๋ฆฌ๋ฅผ **์ฐธ์ ๊ถ**์ด๋ผ ํ๋๋ฐ, ์ด๋ ๊ธฐ๋ณธ์ ์ผ๋ก โ์ ๊ฑฐโ๋ก ์คํ๋๋ค. ์ ๊ฑฐ๋ ์ฌํ ์ง๋จ์ ๋ํ์๋ ๊ณต์ง์๋ฅผ ์ ์ถํ์ฌ ๊ทธ๋ค์๊ฒ ๋ํ์ฑ์ ๋ถ์ฌํ๋ ํ์์ด๋ค. ๊ทธ๋ฌ๋ฏ๋ก **๋์ ํฌํ์จ**์ ๋ฏผ์ฃผ์ฃผ์์ **์ ๋น์ฑ ํ๋ณด**์ ๊น์ ๊ด๋ จ์ด ์๋ค. |
|
|
|
**์ ๊ฑฐ ํฌํ ์ ๋**์๋ ํฌํ๊ถ ํ์ฌ๋ฅผ ํฌํ์์ ์์ ์์ฌ์ ๋งก๊ธฐ๋ โ**์์ ํฌํ์ **โ์ ํฌํ๊ถ ํ์ฌ๋ฅผ ๊ตญ๋ฏผ์ ์๋ฌด๋ก ๊ฐ์ฃผํ๊ณ ์ ๋นํ ์ฌ์ ์์ด ๊ธฐ๊ถํ๋ฉด ๋ฒ์ ์ ์ฌ๋ฅผ ๊ฐํ๋ โ**์๋ฌด ํฌํ์ **โ๊ฐ ์๋ค. ์ฐ๋ฆฌ๋๋ผ๋ ์์ ํฌํ์ ๋ฅผ ์ฑํํ๊ณ ์๋๋ฐ, ์ต๊ทผ ์น๋ฅธ ์ ๊ฑฐ์ ํ๊ท ํฌํ์จ์ด 50ํผ์ผํธ๋๋ก ๋ํ๋ฌ๋ค. ๊ฒฝ์ ๊ฐ๋ฐ ํ๋ ฅ ๊ธฐ๊ตฌ(**OECD**) ํ์๊ตญ ํ๊ท ์ด 70ํผ์ผํธ๋์ธ ๊ฒ์ ์๊ฐํ๋ฉด ๋งค์ฐ ๋ฎ์ ์์น๋ผ ํ ์ ์๋ค. ์ด๋ฌํ ์ํฉ์ด ์ง์๋์ ์๋ฌด ํฌํ์ ๋ฅผ ๋์
ํด์ผ ํ๋ค๋ ์๊ฒฌ์ด ์ ์๋์๊ณ , ์์ ํฌํ์ ๊ฐ ๋ฏผ์ฃผ์ฃผ์์ ์์น์ ๋ง์ผ๋ฏ๋ก ์ด๋ฅผ ์ ์งํด์ผ ํ๋ค๋ ์๊ฒฌ๊ณผ ๋๋ฆฝํ๊ณ ์๋ค. |
|
|
|
**์๋ฌด ํฌํ์ ๋ฅผ ๋์
ํ์๋ ์ธก**์ ๋ฎ์ ํฌํ์จ๋ก ํฌํ ๊ฒฐ๊ณผ์ **์ ๋น์ฑ์ ํ๋ณด**ํ์ง ๋ชปํ๋ ๋ฌธ์ ๊ฐ ๋งค์ฐ ์ฌ๊ฐํ๋ค๊ณ ์ฃผ์ฅํ๋ค. ๋ ์๋ฌด ํฌํ์ ์ ๊ฐ์ ์ฑ๊ณผ ๋ฒ์ ์ ์ฌ๊ฐ ํฌํ์จ์ ๋์ด๋ฏ๋ก ํฌํ์จ์ด ๋ฎ์์ ๋ฐ์ํ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์๋ค๊ณ ๋ณธ๋ค. ๊ทธ๋ฆฌ๊ณ ๊ตญ๋ฏผ ๋๋ถ๋ถ์ด ํฌํ์ ์ฐธ์ฌํ๊ฒ ๋๋ฉด ์ ์น์ธ๋ค์ด ๋ชจ๋ ๊ณ์ธต์ ์ง์ง๋ฅผ ๋ฐ๊ธฐ ์ํด ์ ์ฑ
๊ฒฝ์๋ ฅ์ ๋์ด๋ ค ํ ๊ฒ์ด๋ฏ๋ก **์ ์น ์์ธ ๊ณ์ธต**์ ๋์ฑ ๊ด์ฌ์ ์๋ ํจ๊ณผ๊ฐ ์์ ๊ฒ์ด๋ผ๊ณ ์ด์ผ๊ธฐํ๋ค. |
|
|
|
๋ฐ๋ฉด **์๋ฌด ํฌํ์ ์ ๋ฐ๋ํ๋ ์ธก**์ ํ์ฌ ์ฐ๋ฆฌ๋๋ผ์ ํฌํ์จ์ด ์ ์น ์ง๋์๋ค์ ๋ํ์ฑ์ ํผ์ํ ๋งํผ ์ฌ๊ฐํ ์ํฉ์ ์๋๋ผ๊ณ ์ฃผ์ฅํ๋ค. ๋ ํฌํ์จ์ ๋์ด๋ ๊ฒ๋ณด๋ค **๊ตญ๋ฏผ์ ์ ๋ขฐ๋ฅผ ํ๋ณต**ํ๋ ๊ฒ์ด ๋ ์ค์ํ๊ณ , ์๋ฏผ ๊ต์ก์ด๋ ๋ชจ์ ํฌํ ๊ต์ก ํ๋ก๊ทธ๋จ์ผ๋ก๋ ํฌํ์จ ์์น์ ๊ธฐ๋ํ ์ ์๋ค๋ฉฐ ์๋ฌด ํฌํ์ ์ ๋์
๋ง์ด ํฌํ์จ์ด๋ ์ ์น์ ๊ด์ฌ์ ๋์ด๋ ํด๊ฒฐ ๋ฐฉ์์ ์๋๋ผ๊ณ ์ด์ผ๊ธฐํ๋ค. ๊ทธ๋ฆฌ๊ณ ์๋ฌด ํฌํ์ ๋ฅผ ๋์
ํ๋ฉด, ์ ์ถ๋ ์ ์น์ธ๋ค์ด ๋์ ํฌํ์จ์ ํ๊ณ๋ก **์ํ๋ฌด์ธ์ ํ๋**๋ฅผ ๊ฐ๋ ๋ถ์์ฉ์ด ์๊ธด๋ค๋ ๊ฐ ํ๋ณด์๋ฅผ ์ ๋ชจ๋ฅด๋ ์ํ์์ ํฌํํ๋ ์ผ์ด ๋ฐ์ํ์ฌ **๊ตญ๋ฏผ์ ๋ป์ด ์คํ๋ ค ์๊ณก**๋ ์ ์๋ค๋ฉฐ ์ฐ๋ ค์ ๋ชฉ์๋ฆฌ๋ฅผ ๋ด๊ณ ์๋ค. |
|
""" |
|
|
|
|
|
|
|
|
|
|
|
text_placeholder.empty() |
|
|
|
with text_container: |
|
st.markdown(highlighted_text, unsafe_allow_html=True) |
|
else: |
|
if st.session_state.points == 0: |
|
|
|
st.write("ํฌ์ธํธ๊ฐ ์์ด์ ํค์๋๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.") |
|
pass |
|
|
|
with cols[1]: |
|
global btn_explanation |
|
btn_explanation= st.button("์ถ๊ฐ ์ค๋ช
") |
|
if btn_explanation and st.session_state.points > 0: |
|
update_points(1) |
|
st.session_state.history.append(["์ถ๊ฐ ์ค๋ช
", 1, st.session_state.points]) |
|
|
|
with cols[2]: |
|
global btn_simple |
|
btn_simple = st.button("์ฌ์ด ํํ") |
|
if btn_simple and st.session_state.points > 0: |
|
update_points(-1) |
|
st.session_state.history.append(["์ฌ์ด ํํ", -1, st.session_state.points]) |
|
|
|
|
|
with cols[3]: |
|
global btn_rewrite |
|
btn_rewrite = st.button("๋ค์ ์ฐ๊ธฐ") |
|
if btn_rewrite and st.session_state.points > 0: |
|
update_points(-1) |
|
st.session_state.history.append(["๋ค์ ์ฐ๊ธฐ", -1, st.session_state.points]) |
|
|
|
|
|
return btn_keyword, btn_explanation, btn_simple, btn_rewrite |
|
|
|
|
|
def display_output(): |
|
with st.container(): |
|
st.header("๊ฒฐ๊ณผ") |
|
if btn_explanation and st.session_state.points > 0: |
|
explanation_task = f"Explain the term '{user_input}' in a simple manner, based on the context of the following passage: {user_text}" |
|
|
|
messages = [ |
|
{"role": "system", "content": "You are a helpful assistant that explains complex topics in a way that an elementary school student can understand. use only korean"}, |
|
{"role": "user", "content": explanation_task} |
|
] |
|
|
|
response = openai.ChatCompletion.create( |
|
model="gpt-3.5-turbo-16k", |
|
messages=messages, |
|
temperature=0.1, |
|
max_tokens=200 |
|
) |
|
|
|
explanation = response['choices'][0]['message']['content'] |
|
|
|
|
|
st.write(f"์ถ๊ฐ ์ค๋ช
: {explanation}") |
|
pass |
|
else: |
|
if st.session_state.points == 0: |
|
|
|
st.write("ํฌ์ธํธ๊ฐ ์์ด์ ์ถ๊ฐ ์ค๋ช
๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.") |
|
|
|
pass |
|
|
|
if btn_simple and st.session_state.points > 0: |
|
explanation_task = f"Describe the fingerprint of '{user_text}' in a way that an elementary school student could understand." |
|
|
|
messages = [ |
|
{"role": "system", "content": "You are a helpful assistant that explains complex topics in a way that an elementary school student can understand. use only korean"}, |
|
{"role": "user", "content": explanation_task} |
|
] |
|
|
|
response = openai.ChatCompletion.create( |
|
model="gpt-3.5-turbo-16k", |
|
messages=messages, |
|
temperature=0.11, |
|
max_tokens=2500 |
|
) |
|
|
|
explanation = response['choices'][0]['message']['content'] |
|
|
|
|
|
st.write(f"์ฌ์ด ๊ธ: {explanation}") |
|
pass |
|
else: |
|
if st.session_state.points == 0: |
|
st.write("ํฌ์ธํธ๊ฐ ์์ด์ ์ฌ์ด ํํ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.") |
|
pass |
|
|
|
if btn_rewrite and st.session_state.points > 0: |
|
explanation_task = f"Rewrite the contents of '{user_input}' so that it will pass the writing test." |
|
|
|
messages = [ |
|
{"role": "system", "content": "You are a helpful assistant. use only korean"}, |
|
{"role": "user", "content": explanation_task} |
|
] |
|
|
|
response = openai.ChatCompletion.create( |
|
model="gpt-3.5-turbo-16k", |
|
messages=messages, |
|
temperature=0.1, |
|
max_tokens=2500 |
|
) |
|
|
|
explanation = response['choices'][0]['message']['content'] |
|
|
|
st.write(f"๋ค์ ์ฐ๊ธฐ: {explanation}") |
|
pass |
|
else: |
|
if st.session_state.points == 0: |
|
st.write("ํฌ์ธํธ๊ฐ ์์ด์ ๋ค์ ์ฐ๊ธฐ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.") |
|
|
|
pass |
|
|
|
|
|
def main(): |
|
st.title("ํ๊ตญ์ด ํ์ต์๋ฅผ ์ํ HCI tools") |
|
|
|
st.sidebar.markdown("ํฌ์ธํธ๋ 3์ ๋ถํฐ ์์ํด์, **ํค์๋ ์ฐพ๊ธฐ**, **์ฌ์ด ํํ**, **๋ค์ ์ฐ๊ธฐ**๋ฅผ ํ ๋ 1์ ์ฉ ๊ฐ์ํฉ๋๋ค. **์ถ๊ฐ ์ค๋ช
**๊ณผ **์ฑ์ ํ๊ธฐ**๋ฅผ ํ ๋ 1์ ์ฉ ์ฆ๊ฐํฉ๋๋ค. ํฌ์ธํธ๊ฐ 0์ ์ด ๋๋ฉด ๋ ์ด์ ์์
์ ํ ์ ์์ต๋๋ค. ") |
|
|
|
col1, col2 = st.columns(2) |
|
|
|
with col1: |
|
display_passage(col1) |
|
display_summary(col1) |
|
with col2: |
|
btn_keyword, btn_explanation, btn_simple, btn_rewrite = display_input_btns(col2) |
|
display_output() |
|
|
|
display_points() |
|
|
|
display_markdown_table() |
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
main() |