Spaces:
Runtime error
Runtime error
Karthikeyan
commited on
Commit
•
2b1d107
1
Parent(s):
7379211
Update app.py
Browse files
app.py
CHANGED
@@ -19,10 +19,9 @@ class SentimentAnalyzer:
|
|
19 |
# self.model="facebook/bart-large-mnli"
|
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 : <Sadness, Happiness, Joy, Fear, Disgust, Anger> and it's emotion score for the Mental Healthcare Doctor Chatbot and patient conversation text.\
|
23 |
your 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 1 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 |
-
analyze the text : '''{text}'''
|
26 |
"""
|
27 |
response = openai.Completion.create(
|
28 |
model="text-davinci-003",
|
@@ -37,9 +36,8 @@ class SentimentAnalyzer:
|
|
37 |
return message
|
38 |
|
39 |
def analyze_sentiment_for_graph(self, text):
|
40 |
-
prompt = f""" Your task is find the top 3 setiments : <labels = positive, negative, neutral> and it's sentiment score for the Mental Healthcare Doctor Chatbot and patient conversation text.\
|
41 |
-
your are analyze the text and provide the output in the following json format heigher to lower order: '''["label1","label2","label3"][score1,score2,score3]'''
|
42 |
-
analyze the text : '''{text}'''
|
43 |
"""
|
44 |
response = openai.Completion.create(
|
45 |
model="text-davinci-003",
|
|
|
19 |
# self.model="facebook/bart-large-mnli"
|
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, Joy, Fear, Disgust, Anger> and it's emotion score for the Mental Healthcare Doctor Chatbot and patient conversation text.\
|
23 |
your 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 1 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(
|
27 |
model="text-davinci-003",
|
|
|
36 |
return message
|
37 |
|
38 |
def analyze_sentiment_for_graph(self, text):
|
39 |
+
prompt = f""" Your task is find the top 3 setiments from labels for this converstion {text} : <labels = positive, negative, neutral> and it's sentiment score for the Mental Healthcare Doctor Chatbot and patient conversation text.\
|
40 |
+
your 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",
|