mayf commited on
Commit
b7d5df4
·
verified ·
1 Parent(s): dafe1b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -104,12 +104,16 @@ def main():
104
  # Generate appropriate reply
105
  response_pipeline = load_response_pipeline()
106
  if max_label in ["Positive", "Very Positive"]:
107
- prompt = f"You are a friendly customer success representative. The customer said: \"{review}\". Write a warm, appreciative reply celebrating their positive experience."
 
 
 
108
  else:
109
  prompt = (
110
  f"You are a helpful customer support specialist. The customer said: \"{review}\". "
111
- f"Key topics: {[kw for kw, _ in keywords]}. "
112
- "Ask 1-2 clarifying questions to understand their concerns, then suggest specific improvements or next steps."
 
113
  )
114
  result = response_pipeline(prompt)
115
  reply = result[0]['generated_text'].strip()
@@ -118,4 +122,6 @@ def main():
118
  st.write(reply)
119
 
120
  if __name__ == '__main__':
 
121
  main()
 
 
104
  # Generate appropriate reply
105
  response_pipeline = load_response_pipeline()
106
  if max_label in ["Positive", "Very Positive"]:
107
+ prompt = (
108
+ f"You are a friendly customer success representative. The customer said: \"{review}\". "
109
+ "Write a warm, appreciative reply celebrating their positive experience."
110
+ )
111
  else:
112
  prompt = (
113
  f"You are a helpful customer support specialist. The customer said: \"{review}\". "
114
+ f"Identified issues: {', '.join([kw for kw, _ in keywords])}. "
115
+ "First, ask 1-2 clarifying questions to better understand their situation. "
116
+ "Then, provide two concrete suggestions or next steps to address these issues, grounded in their feedback."
117
  )
118
  result = response_pipeline(prompt)
119
  reply = result[0]['generated_text'].strip()
 
122
  st.write(reply)
123
 
124
  if __name__ == '__main__':
125
+ main() '__main__':
126
  main()
127
+