Update app.py
Browse files
app.py
CHANGED
@@ -50,23 +50,19 @@ def main():
|
|
50 |
# ํ๊ตญ์ด ํ๋กฌํํธ
|
51 |
task_description ="""๋น์ ์ Python์ st-annotated-text ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ํ ์ฃผ์์ด ๋ฌ๋ฆฐ ํ
์คํธ๋ฅผ ์์ฑํ๋ ์ ์ฉํ ๋์ฐ๋ฏธ์
๋๋ค. ๋ณธ๋ฌธ์ ์ฃผ์ ๋ฅผ ํ์
ํ๊ณ ์๋ฏธ๋ฅผ ์ ๋ฌํ๋ ๋ฐ ํ์ํ ํต์ฌ ๋จ์ด๋ฅผ ๊ฐ์กฐํด์ผ ํฉ๋๋ค. ์ฃผ์ ํฌ์ธํธ๋ฅผ ํ์
ํ ์ ์์ด์ผ ํฉ๋๋ค. ๋ํ ์ ๊ณต๋ ํ
์คํธ์ ๋ฌธ๋จ์ ์ค์ฌ ๋ด์ฉ์ ๊ธฐ๋ฐ์ผ๋ก ๋จ์ด๋ฅผ ํ์ํ์ธ์. ์ถ๋ ฅ์ ๋ค์๊ณผ ๊ฐ์ ํ์์ผ๋ก ํฌ๋งท๋์ด์ผ ํฉ๋๋ค:
|
52 |
annotated_text(
|
53 |
-
|
54 |
-
"
|
55 |
-
|
56 |
-
"
|
57 |
-
("
|
58 |
-
"
|
59 |
-
("
|
60 |
-
"
|
61 |
-
("
|
62 |
-
"
|
63 |
-
("
|
64 |
-
" ๋ฏผ์ฃผ์ฃผ์์ ",
|
65 |
-
("์ ๋น์ฑ", ""),
|
66 |
-
" ํ๋ณด์ ๊น์ ๊ด๋ จ์ด ์๋ค ",
|
67 |
". "
|
68 |
-
)
|
69 |
-
"""
|
70 |
|
71 |
# user_prompt = f"Now, please annotate this text: {user_text}"
|
72 |
|
@@ -87,7 +83,7 @@ def main():
|
|
87 |
# ". "
|
88 |
# )"""
|
89 |
|
90 |
-
user_prompt = f"Based on the task description,
|
91 |
|
92 |
|
93 |
messages = [{"role": "system", "content": task_description}, {"role": "user", "content": user_prompt}]
|
|
|
50 |
# ํ๊ตญ์ด ํ๋กฌํํธ
|
51 |
task_description ="""๋น์ ์ Python์ st-annotated-text ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ํ ์ฃผ์์ด ๋ฌ๋ฆฐ ํ
์คํธ๋ฅผ ์์ฑํ๋ ์ ์ฉํ ๋์ฐ๋ฏธ์
๋๋ค. ๋ณธ๋ฌธ์ ์ฃผ์ ๋ฅผ ํ์
ํ๊ณ ์๋ฏธ๋ฅผ ์ ๋ฌํ๋ ๋ฐ ํ์ํ ํต์ฌ ๋จ์ด๋ฅผ ๊ฐ์กฐํด์ผ ํฉ๋๋ค. ์ฃผ์ ํฌ์ธํธ๋ฅผ ํ์
ํ ์ ์์ด์ผ ํฉ๋๋ค. ๋ํ ์ ๊ณต๋ ํ
์คํธ์ ๋ฌธ๋จ์ ์ค์ฌ ๋ด์ฉ์ ๊ธฐ๋ฐ์ผ๋ก ๋จ์ด๋ฅผ ํ์ํ์ธ์. ์ถ๋ ฅ์ ๋ค์๊ณผ ๊ฐ์ ํ์์ผ๋ก ํฌ๋งท๋์ด์ผ ํฉ๋๋ค:
|
52 |
annotated_text(
|
53 |
+
"This ",
|
54 |
+
("is", ""),
|
55 |
+
" some ",
|
56 |
+
("annotated", ""),
|
57 |
+
("text", ""),
|
58 |
+
" for those of ",
|
59 |
+
("you", ""),
|
60 |
+
" who ",
|
61 |
+
("like", ""),
|
62 |
+
" this sort of ",
|
63 |
+
("thing", ""),
|
|
|
|
|
|
|
64 |
". "
|
65 |
+
)"""
|
|
|
66 |
|
67 |
# user_prompt = f"Now, please annotate this text: {user_text}"
|
68 |
|
|
|
83 |
# ". "
|
84 |
# )"""
|
85 |
|
86 |
+
user_prompt = f"Based on the task description, annotate the following text by highlighting key words about the topic: {user_text}"
|
87 |
|
88 |
|
89 |
messages = [{"role": "system", "content": task_description}, {"role": "user", "content": user_prompt}]
|