Karthikeyan commited on
Commit
30d4e59
1 Parent(s): 2b1d107

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,8 +19,8 @@ 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 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(
@@ -36,7 +36,7 @@ class SentimentAnalyzer:
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(
 
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, 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 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 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(