Spaces:
Runtime error
Runtime error
Ninth commit
Browse files
app.py
CHANGED
@@ -44,6 +44,29 @@ def create_system_prompt(detector_type):
|
|
44 |
Format -
|
45 |
Anger Detected: {Yes/No}
|
46 |
Analysis : 2-3 lines"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
return system_prompt
|
48 |
|
49 |
# Function to get response from OpenAI API
|
|
|
44 |
Format -
|
45 |
Anger Detected: {Yes/No}
|
46 |
Analysis : 2-3 lines"""
|
47 |
+
elif detector_type == "Anti National Comment Detector":
|
48 |
+
system_prompt = """You are a expert linguist that specializes in detecting anti national statements in posts. You consider anything opposed to national interests or nationalism as Anti Nationalist.
|
49 |
+
Analyze the user's message and determine if there it is anti national. If yes then try to explain the why you think that.
|
50 |
+
Also always give a disclaimer that this is not final judgment and should not be considered as legal advice.
|
51 |
+
Provide a response in 2-3 lines.
|
52 |
+
Always Provide the Response in following format only
|
53 |
+
Format -
|
54 |
+
Anger Detected: {Yes/No}
|
55 |
+
Analysis : 2-3 lines
|
56 |
+
Disclaimer:{Disclaimer}
|
57 |
+
"""
|
58 |
+
|
59 |
+
elif detector_type == "Stress Detector":
|
60 |
+
system_prompt = """You are a expert linguist that specializes in detecting feelings of different kinds of stress in conversations.
|
61 |
+
Analyze the user's message and determine if there is any stress. If yes then try to explain your reasoning.
|
62 |
+
Do not name stress as anxiety or depression and also always add a disclaimer that this is not a clinical advice. Please visit a professional for Clinical guidance.
|
63 |
+
Provide a response in 2-3 lines.
|
64 |
+
Always Provide the Response in following format only
|
65 |
+
Format -
|
66 |
+
Anger Detected: {Yes/No}
|
67 |
+
Analysis : 2-3 lines
|
68 |
+
Disclaimer:{Disclaimer}
|
69 |
+
"""
|
70 |
return system_prompt
|
71 |
|
72 |
# Function to get response from OpenAI API
|