mlo0ollm's picture
test
54599d6
from annotated_text import annotated_text
import ast
import streamlit as st
import openai
import os
import sys
from gpt_based_function import gpt_summary_generator, gpt_keyword_highlighter, gpt_text_naturalizer, gpt_explanation_generator, gpt_easier_text_generator, gpt_rater
import concurrent.futures
from tqdm import tqdm
# current_path = '/Users/kintch/PycharmProjects/jungu_sgi/summary_with_gpt'
# os.chdir(current_path)
# sys.path.append(current_path)
openai.api_key = os.getenv("OPENAI_API_KEY")
st.set_page_config(layout="wide")
user_text = """๋ฏผ์ฃผ์ฃผ์˜ ์‚ฌํšŒ๋Š” ๊ตญ๋ฏผ์ด ์ •์น˜์— ์ฐธ์—ฌํ•  ๊ถŒ๋ฆฌ๋ฅผ ๋ณด์žฅํ•œ๋‹ค. ๊ทธ๋Ÿฌํ•œ ๊ถŒ๋ฆฌ๋ฅผ ์ฐธ์ •๊ถŒ์ด๋ผ ํ•˜๋Š”๋ฐ, ์ด๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ โ€˜์„ ๊ฑฐโ€™๋กœ ์‹คํ˜„๋œ๋‹ค. ์„ ๊ฑฐ๋Š” ์‚ฌํšŒ ์ง‘๋‹จ์˜ ๋Œ€ํ‘œ์ž๋‚˜ ๊ณต์ง์ž๋ฅผ ์„ ์ถœํ•˜์—ฌ ๊ทธ๋“ค์—๊ฒŒ ๋Œ€ํ‘œ์„ฑ์„ ๋ถ€์—ฌํ•˜๋Š” ํ–‰์œ„์ด๋‹ค. ๊ทธ๋Ÿฌ๋ฏ€๋กœ ๋†’์€ ํˆฌํ‘œ์œจ์€ ๋ฏผ์ฃผ์ฃผ์˜์˜ ์ •๋‹น์„ฑ ํ™•๋ณด์™€ ๊นŠ์€ ๊ด€๋ จ์ด ์žˆ๋‹ค.
์„ ๊ฑฐ ํˆฌํ‘œ ์ œ๋„์—๋Š” ํˆฌํ‘œ๊ถŒ ํ–‰์‚ฌ๋ฅผ ํˆฌํ‘œ์ž์˜ ์ž์œ ์˜์‚ฌ์— ๋งก๊ธฐ๋Š” โ€˜์ž์œ  ํˆฌํ‘œ์ œโ€™์™€ ํˆฌํ‘œ๊ถŒ ํ–‰์‚ฌ๋ฅผ ๊ตญ๋ฏผ์˜ ์˜๋ฌด๋กœ ๊ฐ„์ฃผํ•˜๊ณ  ์ •๋‹นํ•œ ์‚ฌ์œ  ์—†์ด ๊ธฐ๊ถŒํ•˜๋ฉด ๋ฒ•์  ์ œ์žฌ๋ฅผ ๊ฐ€ํ•˜๋Š” โ€˜์˜๋ฌด ํˆฌํ‘œ์ œโ€™๊ฐ€ ์žˆ๋‹ค. ์šฐ๋ฆฌ๋‚˜๋ผ๋Š” ์ž์œ  ํˆฌํ‘œ์ œ๋ฅผ ์ฑ„ํƒํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ์ตœ๊ทผ ์น˜๋ฅธ ์„ ๊ฑฐ์˜ ํ‰๊ท  ํˆฌํ‘œ์œจ์ด 50ํผ์„ผํŠธ๋Œ€๋กœ ๋‚˜ํƒ€๋‚ฌ๋‹ค. ๊ฒฝ์ œ ๊ฐœ๋ฐœ ํ˜‘๋ ฅ ๊ธฐ๊ตฌ(OECD) ํšŒ์›๊ตญ ํ‰๊ท ์ด 70ํผ์„ผํŠธ๋Œ€์ธ ๊ฒƒ์„ ์ƒ๊ฐํ•˜๋ฉด ๋งค์šฐ ๋‚ฎ์€ ์ˆ˜์น˜๋ผ ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋Ÿฌํ•œ ์ƒํ™ฉ์ด ์ง€์†๋˜์ž ์˜๋ฌด ํˆฌํ‘œ์ œ๋ฅผ ๋„์ž…ํ•ด์•ผ ํ•œ๋‹ค๋Š” ์˜๊ฒฌ์ด ์ œ์‹œ๋˜์—ˆ๊ณ , ์ž์œ  ํˆฌํ‘œ์ œ๊ฐ€ ๋ฏผ์ฃผ์ฃผ์˜์˜ ์›์น™์— ๋งž์œผ๋ฏ€๋กœ ์ด๋ฅผ ์œ ์ง€ํ•ด์•ผ ํ•œ๋‹ค๋Š” ์˜๊ฒฌ๊ณผ ๋Œ€๋ฆฝํ•˜๊ณ  ์žˆ๋‹ค.
์˜๋ฌด ํˆฌํ‘œ์ œ๋ฅผ ๋„์ž…ํ•˜์ž๋Š” ์ธก์€ ๋‚ฎ์€ ํˆฌํ‘œ์œจ๋กœ ํˆฌํ‘œ ๊ฒฐ๊ณผ์˜ ์ •๋‹น์„ฑ์„ ํ™•๋ณดํ•˜์ง€ ๋ชปํ•˜๋Š” ๋ฌธ์ œ๊ฐ€ ๋งค์šฐ ์‹ฌ๊ฐํ•˜๋‹ค๊ณ  ์ฃผ์žฅํ•œ๋‹ค. ๋˜ ์˜๋ฌด ํˆฌํ‘œ์ œ์˜ ๊ฐ•์ œ์„ฑ๊ณผ ๋ฒ•์  ์ œ์žฌ๊ฐ€ ํˆฌํ‘œ์œจ์„ ๋†’์ด๋ฏ€๋กœ ํˆฌํ‘œ์œจ์ด ๋‚ฎ์•„์„œ ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ๋ณธ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ตญ๋ฏผ ๋Œ€๋ถ€๋ถ„์ด ํˆฌํ‘œ์— ์ฐธ์—ฌํ•˜๊ฒŒ ๋˜๋ฉด ์ •์น˜์ธ๋“ค์ด ๋ชจ๋“  ๊ณ„์ธต์˜ ์ง€์ง€๋ฅผ ๋ฐ›๊ธฐ ์œ„ํ•ด ์ •์ฑ… ๊ฒฝ์Ÿ๋ ฅ์„ ๋†’์ด๋ ค ํ•  ๊ฒƒ์ด๋ฏ€๋กœ ์ •์น˜ ์†Œ์™ธ ๊ณ„์ธต์— ๋”์šฑ ๊ด€์‹ฌ์„ ์Ÿ๋Š” ํšจ๊ณผ๊ฐ€ ์žˆ์„ ๊ฒƒ์ด๋ผ๊ณ  ์ด์•ผ๊ธฐํ•œ๋‹ค.
๋ฐ˜๋ฉด ์˜๋ฌด ํˆฌํ‘œ์ œ์— ๋ฐ˜๋Œ€ํ•˜๋Š” ์ธก์€ ํ˜„์žฌ ์šฐ๋ฆฌ๋‚˜๋ผ์˜ ํˆฌํ‘œ์œจ์ด ์ •์น˜ ์ง€๋„์ž๋“ค์˜ ๋Œ€ํ‘œ์„ฑ์„ ํ›ผ์†ํ•  ๋งŒํผ ์‹ฌ๊ฐํ•œ ์ƒํ™ฉ์€ ์•„๋‹ˆ๋ผ๊ณ  ์ฃผ์žฅํ•œ๋‹ค. ๋˜ ํˆฌํ‘œ์œจ์„ ๋†’์ด๋Š” ๊ฒƒ๋ณด๋‹ค ๊ตญ๋ฏผ์˜ ์‹ ๋ขฐ๋ฅผ ํšŒ๋ณตํ•˜๋Š” ๊ฒƒ์ด ๋” ์ค‘์š”ํ•˜๊ณ , ์‹œ๋ฏผ ๊ต์œก์ด๋‚˜ ๋ชจ์˜ ํˆฌํ‘œ ๊ต์œก ํ”„๋กœ๊ทธ๋žจ์œผ๋กœ๋„ ํˆฌํ‘œ์œจ ์ƒ์Šน์„ ๊ธฐ๋Œ€ํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉฐ ์˜๋ฌด ํˆฌํ‘œ์ œ์˜ ๋„์ž…๋งŒ์ด ํˆฌํ‘œ์œจ์ด๋‚˜ ์ •์น˜์  ๊ด€์‹ฌ์„ ๋†’์ด๋Š” ํ•ด๊ฒฐ ๋ฐฉ์•ˆ์€ ์•„๋‹ˆ๋ผ๊ณ  ์ด์•ผ๊ธฐํ•œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์˜๋ฌด ํˆฌํ‘œ์ œ๋ฅผ ๋„์ž…ํ•˜๋ฉด, ์„ ์ถœ๋œ ์ •์น˜์ธ๋“ค์ด ๋†’์€ ํˆฌํ‘œ์œจ์„ ํ•‘๊ณ„๋กœ ์•ˆํ•˜๋ฌด์ธ์˜ ํƒœ๋„๋ฅผ ๊ฐ–๋Š” ๋ถ€์ž‘์šฉ์ด ์ƒ๊ธด๋‹ค๋“ ๊ฐ€ ํ›„๋ณด์ž๋ฅผ ์ž˜ ๋ชจ๋ฅด๋Š” ์ƒํƒœ์—์„œ ํˆฌํ‘œํ•˜๋Š” ์ผ์ด ๋ฐœ์ƒํ•˜์—ฌ ๊ตญ๋ฏผ์˜ ๋œป์ด ์˜คํžˆ๋ ค ์™œ๊ณก๋  ์ˆ˜ ์žˆ๋‹ค๋ฉฐ ์šฐ๋ ค์˜ ๋ชฉ์†Œ๋ฆฌ๋ฅผ ๋‚ด๊ณ  ์žˆ๋‹ค."""
# gpt_summary = gpt_summary_generator(user_text)
user_text_paragraphs = user_text.split("\n") #๋ฌธ๋‹จ๋ณ„๋กœ ์ชผ๊ฐœ๊ธฐ
is_easier_button_pressed = [False]*len(user_text_paragraphs)
def run(list_sum):
with concurrent.futures.ThreadPoolExecutor() as executor:
results = list(tqdm(executor.map(gpt_keyword_highlighter, list_sum), total=len(list_sum)))
return results
# SHOUD BE ํ™œ์„ฑํ™”
# highlighted_texts_list = run(user_text_paragraphs)
## ํฌ์ธํŠธ ๋ถ€๋ถ„ ์ถ”๊ฐ€
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
# display_points() # ํฌ์ธํŠธ๋ฅผ ์‹ค์‹œ๊ฐ„์œผ๋กœ ์—…๋ฐ์ดํŠธ ํ•˜๊ธฐ ์œ„ํ•ด
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(user_text):
# st.header("์ง€๋ฌธ")
global text_container
text_container = st.container() # ์ถ”๊ฐ€๋œ ์ฝ”๋“œ
# ๋ฏธ๋ฆฌ ๊ณต๊ฐ„ ํ™•๋ณด
global text_placeholder
text_placeholder = text_container.empty()
text_placeholder.write(user_text, unsafe_allow_html=True)
#์„ ์–ธํ•œ ๋ณ€์ˆ˜ ๋‹ค๋ฅธ ํ•จ์ˆ˜์—์„œ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด return
return text_placeholder, text_container, user_text
def display_preset_func_btns(col):
# st.header("์ธ๊ณต์ง€๋Šฅ ์‚ฌ์šฉํ•˜๊ธฐ")
# ๋ฒ„ํŠผ row
cols = st.columns(2)
with cols[0]:
btn_gpt_keyword_func = st.button("ํ‚ค์›Œ๋“œ ์ฐพ์•„์ค˜")
if btn_gpt_keyword_func and st.session_state.points > 0: # ํฌ์ธํŠธ ์ฒดํฌ
update_points(-1) # ํฌ์ธํŠธ ๊ฐ์†Œ
st.session_state.history.append(["ํ‚ค์›Œ๋“œ ์ฐพ์•„์ค˜", -1, st.session_state.points])
global is_easier_button_pressed
is_easier_button_pressed = [True]*len(user_text_paragraphs)
# ๋‹ค๋ฅธ ๋กœ์ง ๊ณ ๋ ค
#๋‹ค๋ฅธ ์ง€๋ฌธ ๋„ฃ๊ธฐ
# global highlighted_texts_list
# highlighted_text = highlighted_texts_list[-1]
#
# # ๊ธฐ์กด ์ง€๋ฌธ ์ง€์šฐ๊ธฐ
# text_placeholder.empty()
#
# #text_container์— highlight๋œ ํ…์ŠคํŠธ๋ฅผ ์ถœ๋ ฅ
# with text_container:
# exec(highlighted_text)
# st.markdown(highlighted_text, unsafe_allow_html=True)
else:
if st.session_state.points == 0:
#ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ์‚ฌ์šฉํ• ์ˆ˜ ์—†๋‹ค๋Š” ๋ฌธ๊ตฌ ์ถ”๊ฐ€
st.write("ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ํ‚ค์›Œ๋“œ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.")
pass
with cols[1]:
global btn_gpt_easier_text_func
btn_gpt_easier_text_func = st.button("์‰ฝ๊ฒŒ ๋‹ค์‹œ ์•Œ๋ ค์ค˜")
if btn_gpt_easier_text_func and st.session_state.points > 0: # ํฌ์ธํŠธ ์ฒดํฌ
update_points(-1) # ํฌ์ธํŠธ ๊ฐ์†Œ
st.session_state.history.append(["์‰ฝ๊ฒŒ ๋‹ค์‹œ ์•Œ๋ ค์ค˜", -1, st.session_state.points])
# return btn_gpt_keyword_func, btn_gpt_easier_text_func
def display_users_summarization(col):
# st.header("์š”์•ฝ ๊ฒฐ๊ณผ")
global user_summary
user_summary = st.text_area("ํ•œ ๋ฌธ๋‹จ์”ฉ ์ฝ๊ณ  ์ „์ฒด ๊ธ€์„ ์š”์•ฝํ•ด๋ณด์„ธ์š”.", key='user_summary')
cols = st.columns(2)
with cols[0]:
global btn_gpt_naturalize_func
btn_gpt_naturalize_func = st.button("๊ธ€ ๋‹ค๋“ฌ๊ธฐ")
if btn_gpt_naturalize_func and st.session_state.points > 0: # ํฌ์ธํŠธ ์ฒดํฌ
update_points(-1) # ํฌ์ธํŠธ ๊ฐ์†Œ
st.session_state.history.append(["๊ธ€ ๋‹ค๋“ฌ๊ธฐ", -1, st.session_state.points])
with cols[1]:
btn_gpt_rating_func = st.button("์ฑ„์ ํ•˜๊ธฐ")
if btn_gpt_rating_func and st.session_state.points > 0: # ํฌ์ธํŠธ ์ฒดํฌ
update_points(1) # ํฌ์ธํŠธ ์ฆ๊ฐ€
st.session_state.history.append(["์ฑ„์ ํ•˜๊ธฐ", +1, st.session_state.points]) #fix from -1 to +1
gpt_rated_result = gpt_rater(user_summary)
st.write(f"์ฑ„์ ํ•˜๊ธฐ: {gpt_rated_result}")
# https://discuss.streamlit.io/t/streamlit-button-disable-enable/31293 # ๋ฒ„ํŠผ ๋น„ํ™œ์„ฑํ™” ๊ด€๋ จ ์ฐธ๊ณ  (์•„์ง์€ ์•ˆ๋จ)
pass
else:
if st.session_state.points == 0:
# ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ์‚ฌ์šฉํ• ์ˆ˜ ์—†๋‹ค๋Š” ๋ฌธ๊ตฌ ์ถ”๊ฐ€
st.write("ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ์ฑ„์ ํ•˜๊ธฐ๋ฅผ ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.")
pass
if btn_gpt_naturalize_func and st.session_state.points > 0:
naturalized_text = gpt_text_naturalizer(user_summary) # ๋‹ค์‹œ์“ฐ๊ธฐ ํ•จ์ˆ˜
st.write(f"๊ธ€ ๋‹ค๋“ฌ๊ธฐ: {naturalized_text}")
pass
else:
if st.session_state.points == 0:
st.write("ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ๊ธ€ ๋‹ค๋“ฌ๊ธฐ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.")
pass
btn_submit_summarized_text = st.button("์ œ์ถœํ•˜๊ธฐ")
if btn_submit_summarized_text:
# ๊ตฌ๊ธ€ ๋“œ๋ผ์ด๋ธŒ api ์ด์šฉํ•˜์—ฌ ์—…๋กœ๋“œ
st.write("์ œ์ถœ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.")
pass
def display_qna_with_gpt():
with st.container():
cols = st.columns(2)
# st.header("๊ฒฐ๊ณผ")
with cols[0]:
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])
user_input = st.text_area("์ถ”๊ฐ€ ์„ค๋ช…์ด ํ•„์š”ํ•˜๊ฑฐ๋‚˜ ๋‹ค์‹œ ์“ฐ๊ณ  ์‹ถ์€ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”.", key='user_input')
if btn_explanation and st.session_state.points > 0:
explanation = gpt_explanation_generator(user_input, user_text)
# ์ถ”๊ฐ€ ์„ค๋ช…
st.write(f"์ถ”๊ฐ€ ์„ค๋ช…: {explanation}")
pass
else:
if st.session_state.points == 0:
#ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ์‚ฌ์šฉํ• ์ˆ˜ ์—†๋‹ค๋Š” ๋ฌธ๊ตฌ ์ถ”๊ฐ€
st.write("ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ์ถ”๊ฐ€ ์„ค๋ช… ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.")
pass
if btn_gpt_easier_text_func and st.session_state.points > 0:
easier_text = gpt_easier_text_generator(user_input)
# ์‰ฝ๊ฒŒ ๋‹ค์‹œ ์•Œ๋ ค์ค˜์œผ๋กœ ๊ฒฐ๊ณผ ์ถœ๋ ฅ
st.write(f"์‰ฌ์šด ๊ธ€: {easier_text}")
pass
else:
if st.session_state.points == 0:
st.write("ํฌ์ธํŠธ๊ฐ€ ์—†์–ด์„œ ์‰ฝ๊ฒŒ ๋‹ค์‹œ ์•Œ๋ ค์ค˜ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.")
pass
def main():
st.title("์ฑ—GPT์™€ ํ•จ๊ป˜ ์š”์•ฝํ•˜๊ธฐ")
#ํฌ์ธํŠธ ์‹œ์Šคํ…œ ์„ค๋ช… ์ถ”๊ฐ€
st.sidebar.markdown("ํฌ์ธํŠธ๋Š” 3์ ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด์„œ, **ํ‚ค์›Œ๋“œ ์ฐพ์•„์ค˜**, **์‰ฝ๊ฒŒ ๋‹ค์‹œ ์•Œ๋ ค์ค˜**, **๊ธ€ ๋‹ค๋“ฌ๊ธฐ**๋ฅผ ํ•  ๋•Œ 1์ ์”ฉ ๊ฐ์†Œํ•ฉ๋‹ˆ๋‹ค. **์ถ”๊ฐ€ ์„ค๋ช…**๊ณผ **์ฑ„์ ํ•˜๊ธฐ**๋ฅผ ํ•  ๋•Œ 1์ ์”ฉ ์ฆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ํฌ์ธํŠธ๊ฐ€ 0์ ์ด ๋˜๋ฉด ๋” ์ด์ƒ ์ž‘์—…์„ ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ")
# col1, col2 = st.columns(2)
display_preset_func_btns(col)
# Paragraph Tabs
paragraph_tab1, paragraph_tab2, paragraph_tab3, paragraph_tab4 = st.tabs(["๋‹จ๋ฝ1", "๋‹จ๋ฝ2", "๋‹จ๋ฝ3", "๋‹จ๋ฝ4"])
with paragraph_tab1:
if is_easier_button_pressed[0]:
text = ast.literal_eval(highlighted_texts_list[0][15:-1])
annotated_text(*text) #exec ๋Œ€์‹  ์ธ์ž๋กœ ๋ฐ”๋กœ ์ „๋‹ฌ
else:
display_passage(user_text_paragraphs[0])
with paragraph_tab2:
display_passage(user_text_paragraphs[1])
with paragraph_tab3:
display_passage(user_text_paragraphs[2])
with paragraph_tab4:
display_passage(user_text_paragraphs[3])
# User Input Tabs
user_input_tab1, user_input_tab2 = st.tabs(["์š”์•ฝํ•˜๊ธฐ", "์ฑ—GPT์—๊ฒŒ ์งˆ๋ฌธํ•˜๊ธฐ"])
with user_input_tab1:
display_users_summarization(col)
with user_input_tab2:
display_qna_with_gpt()
#ํฌ์ธํŠธ ํ‘œ์‹œ
display_points()
#ํฌ์ธํŠธ ๋ณ€ํ™” ํ‘œ์‹œ
display_markdown_table()
if __name__ == "__main__":
main()