Spaces:
Runtime error
Runtime error
Commit
·
add931b
1
Parent(s):
72a77ec
edited prompts
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ def gpt_respond(have_key, tab_name, message, chat_history, max_convo_length = 10
|
|
| 52 |
formatted_prompt = format_chat_prompt(message, chat_history, max_convo_length)
|
| 53 |
print('GPT ling ents Prompt + Context:')
|
| 54 |
print(formatted_prompt)
|
| 55 |
-
bot_message = chat(user_prompt = f'''
|
| 56 |
chat_history.insert(0, (message, bot_message))
|
| 57 |
return "", chat_history
|
| 58 |
|
|
@@ -96,7 +96,7 @@ def gpt_strategies_respond(have_key, strategy, task_name, task_ling_ent, message
|
|
| 96 |
formatted_system_prompt = ""
|
| 97 |
if (task_name == "POS Tagging"):
|
| 98 |
if (strategy == "S1"):
|
| 99 |
-
formatted_system_prompt = f'''
|
| 100 |
elif (strategy == "S2"):
|
| 101 |
formatted_system_prompt = f'''POS tag the following sentence using Universal POS tag set: "{message}"'''
|
| 102 |
elif (strategy == "S3"):
|
|
@@ -105,7 +105,7 @@ def gpt_strategies_respond(have_key, strategy, task_name, task_ling_ent, message
|
|
| 105 |
formatted_system_prompt = f'''"{demon_pos}". Using the POS tag structure above, POS tag the following sentence: "{message}"'''
|
| 106 |
elif (task_name == "Chunking"):
|
| 107 |
if (strategy == "S1"):
|
| 108 |
-
formatted_system_prompt = f'''
|
| 109 |
elif (strategy == "S2"):
|
| 110 |
formatted_system_prompt = f'''Chunk the following sentence in CoNLL 2000 format with BIO tags: "{message}"'''
|
| 111 |
elif (strategy == "S3"):
|
|
|
|
| 52 |
formatted_prompt = format_chat_prompt(message, chat_history, max_convo_length)
|
| 53 |
print('GPT ling ents Prompt + Context:')
|
| 54 |
print(formatted_prompt)
|
| 55 |
+
bot_message = chat(user_prompt = f'''Output any <{tab_name}> in the following sentence one per line: "{formatted_prompt}"''')
|
| 56 |
chat_history.insert(0, (message, bot_message))
|
| 57 |
return "", chat_history
|
| 58 |
|
|
|
|
| 96 |
formatted_system_prompt = ""
|
| 97 |
if (task_name == "POS Tagging"):
|
| 98 |
if (strategy == "S1"):
|
| 99 |
+
formatted_system_prompt = f'''Output any {task_ling_ent} in the following sentence one per line: "{message}"'''
|
| 100 |
elif (strategy == "S2"):
|
| 101 |
formatted_system_prompt = f'''POS tag the following sentence using Universal POS tag set: "{message}"'''
|
| 102 |
elif (strategy == "S3"):
|
|
|
|
| 105 |
formatted_system_prompt = f'''"{demon_pos}". Using the POS tag structure above, POS tag the following sentence: "{message}"'''
|
| 106 |
elif (task_name == "Chunking"):
|
| 107 |
if (strategy == "S1"):
|
| 108 |
+
formatted_system_prompt = f'''Output any {task_ling_ent} in the following sentence one per line: "{message}"'''
|
| 109 |
elif (strategy == "S2"):
|
| 110 |
formatted_system_prompt = f'''Chunk the following sentence in CoNLL 2000 format with BIO tags: "{message}"'''
|
| 111 |
elif (strategy == "S3"):
|