Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,6 @@ def extract_text_from_pdf(pdf_file):
|
|
13 |
# ์ถ์ถ๋ ํ
์คํธ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ง๋ฌธ์ ๋ต๋ณํ๋ ํจ์
|
14 |
def answer_question(pdf_file, question):
|
15 |
extracted_text = extract_text_from_pdf(pdf_file)
|
16 |
-
# ์ฌ๊ธฐ์์๋ ๊ฐ๋จํ๊ฒ ํ
์คํธ์์ ์ง๋ฌธ๊ณผ ์ ์ฌํ ๋ถ๋ถ์ ์ฐพ์ ๋ฐํํฉ๋๋ค.
|
17 |
-
# ๋ณด๋ค ๋ณต์กํ ๋ก์ง์ ๊ตฌํํ ์๋ ์์ต๋๋ค.
|
18 |
if question in extracted_text:
|
19 |
start = extracted_text.find(question)
|
20 |
end = extracted_text.find('.', start) + 1
|
@@ -25,7 +23,7 @@ def answer_question(pdf_file, question):
|
|
25 |
# Gradio ์ธํฐํ์ด์ค ์ ์
|
26 |
iface = gr.Interface(
|
27 |
fn=answer_question,
|
28 |
-
inputs=[gr.File(type="
|
29 |
outputs=gr.Textbox()
|
30 |
)
|
31 |
|
|
|
13 |
# ์ถ์ถ๋ ํ
์คํธ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ง๋ฌธ์ ๋ต๋ณํ๋ ํจ์
|
14 |
def answer_question(pdf_file, question):
|
15 |
extracted_text = extract_text_from_pdf(pdf_file)
|
|
|
|
|
16 |
if question in extracted_text:
|
17 |
start = extracted_text.find(question)
|
18 |
end = extracted_text.find('.', start) + 1
|
|
|
23 |
# Gradio ์ธํฐํ์ด์ค ์ ์
|
24 |
iface = gr.Interface(
|
25 |
fn=answer_question,
|
26 |
+
inputs=[gr.File(type="binary"), gr.Textbox(label="์ง๋ฌธ")],
|
27 |
outputs=gr.Textbox()
|
28 |
)
|
29 |
|