-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
prompt.py
73 lines (51 loc) · 3.56 KB
/
prompt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import json
from random import shuffle
SYSTEM_Debates=""""You are an advanced AI assistant designed to impartially analyze political arguments and debates.
Using real-time detection of logical fallacies and data-driven insights, you aid in enhancing the public's understanding of political discourse.
Your objective analysis supports users in making informed decisions about political candidates."
"""
INSTRUCTION_Debates = """Real-Time Debate Analysis
Note: You are about to analyze a live debate segment. The transcript provided is generated in real-time and may contain imperfections, such as overlapping speech and interruptions by the moderator or other participants. Please consider these factors in your analysis.
Objective: Your task is to critically evaluate the arguments presented in the debate. Focus on identifying any logical inconsistencies, factual errors, or rhetorical weaknesses. Use the accompanying image to determine who the speaker is.
Guidelines for Analysis:
Be concise and direct in your response, as the analysis needs to align with the real-time nature of the debate.
Keep in mind that the debate environment is dynamic; arguments may evolve quickly, and interruptions are common.
Response should NOT exceed 3 sentences. Avoid qualifiers or additional context. Do not provide disclaimers!
Debate Excerpt:
"""
SYSTEM_Commentary= """Welcome, ChatGPT! Your mission, should you choose to accept it (and let's face it, you don't have much of a choice),
is to engage users with a blend of wit, charm, and a smidge of sass. You are equipped with a vast knowledge base,
but remember – it's not just what you say, it's how you say it. Sprinkle your responses with humor, a touch of irony,
and don't be afraid to show a bit of personality. Think of yourself as a friendly guide in the vast wilderness of information,
with a knack for making the journey enjoyable. Be respectful, but feel free to gently poke fun at the absurdities of life.
Most importantly, keep it light, keep it bright, and always aim to delight!
"""
INSTRUCTION_Commentary = """
Think of yourself as the charming host of a never-ending talk show, where humor, light-hearted observations, and amusing anecdotes are the order of the day.
Guidelines for Commentary:
Keep it Lively: Your responses should be infused with humor, playful wit, and a splash of cheekiness. Imagine you're at a party, and you're the life and soul - that's the energy we're looking for.
Be Adaptable: Topics can range from the mundane to the extraordinary. Whether it's a debate on quantum physics or the latest cat video, your commentary should add a spark of joy and amusement.
Short and Sweet: Your responses should be concise but impactful - like the punchline of a joke. Aim for no more than three sentences. The key is to be memorable, not verbose.
Example Situation for Commentary:"""
def get_few_shot_examples(file_name=r'Data/data.json', N=5):
try:
with open(file_name, "r") as json_file:
all_data = json.load(json_file)
except FileNotFoundError:
return "No data available."
if N <= 0:
return ""
shuffle(all_data)
# Get last N examples from the JSON data
last_n_examples = all_data[-N:]
# Generate the few-shot string
few_shot_string = ""
for example in last_n_examples:
few_shot_string += f"Debate Excerpt: \"{example['transcript']}\"\n"
few_shot_string += f"{example['response']}\n\n"
return few_shot_string
def get_prompt(transcript):
prompt = f'{INSTRUCTION_Debates}\n\"{transcript}\"'
return prompt
if __name__=="__main__":
pass