JUNGU commited on
Commit
736d209
โ€ข
1 Parent(s): 4609110

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -17
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, please annotate the following text by highlighting the key terms central to its topic : {user_text}"
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}]