Spaces:
Runtime error
Runtime error
Karthikeyan
commited on
Commit
•
3b837bc
1
Parent(s):
30d4e59
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ class SentimentAnalyzer:
|
|
20 |
openai.api_key=os.getenv("OPENAI_API_KEY")
|
21 |
def emotion_analysis(self,text):
|
22 |
prompt = f""" Your task is find the top 3 emotion for this converstion {text}: <Sadness, Happiness, Fear, Disgust, Anger> and it's emotion score for the Mental Healthcare Doctor Chatbot and patient conversation text.\
|
23 |
-
|
24 |
The scores should be in the range of 0.0 to 1.0, where 1.0 represents the highest intensity of the emotion.
|
25 |
"""
|
26 |
response = openai.Completion.create(
|
@@ -36,8 +36,8 @@ class SentimentAnalyzer:
|
|
36 |
return message
|
37 |
|
38 |
def analyze_sentiment_for_graph(self, text):
|
39 |
-
prompt = f""" Your task is find the setiments
|
40 |
-
|
41 |
"""
|
42 |
response = openai.Completion.create(
|
43 |
model="text-davinci-003",
|
|
|
20 |
openai.api_key=os.getenv("OPENAI_API_KEY")
|
21 |
def emotion_analysis(self,text):
|
22 |
prompt = f""" Your task is find the top 3 emotion for this converstion {text}: <Sadness, Happiness, Fear, Disgust, Anger> and it's emotion score for the Mental Healthcare Doctor Chatbot and patient conversation text.\
|
23 |
+
you are analyze the text and provide the output in the following list format heigher to lower order: ["emotion1","emotion2","emotion3"][score1,score2,score3]''' [with top 3 result having the highest score]
|
24 |
The scores should be in the range of 0.0 to 1.0, where 1.0 represents the highest intensity of the emotion.
|
25 |
"""
|
26 |
response = openai.Completion.create(
|
|
|
36 |
return message
|
37 |
|
38 |
def analyze_sentiment_for_graph(self, text):
|
39 |
+
prompt = f""" Your task is find the setiments for this converstion {text} : <labels = positive, negative, neutral> and it's sentiment score for the Mental Healthcare Doctor Chatbot and patient conversation text.\
|
40 |
+
you are analyze the text and provide the output in the following json format heigher to lower order: '''["label1","label2","label3"][score1,score2,score3]'''
|
41 |
"""
|
42 |
response = openai.Completion.create(
|
43 |
model="text-davinci-003",
|