JoshuaZywoo commited on
Commit
68ffcfc
·
verified ·
1 Parent(s): 223059a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -27,15 +27,14 @@ candidate_tasks = [
27
  def generate_response(intent, human=True):
28
  if human:
29
  prompt = (
30
- f"Write a customer service message for intent '{intent}' using 3 clearly separated segments: "
31
- "[Greeting] + [You currently have Plan X with ¥X/month. We recommend Plan Y offering XXGB at ¥Y/month.] + [Would you like to switch now?] "
32
- "Use placeholder numbers and express one sentence per section."
33
  )
34
  else:
35
  prompt = (
36
- f"Resolve customer request: '{intent}' in one short sentence directly addressing their need. Use clear and polite tone with placeholder plan/price."
37
  )
38
- return text_generator(prompt, max_new_tokens=80, do_sample=True)[0]['generated_text']
39
 
40
  urgent_emotions = {"anger", "frustration", "anxiety", "urgency", "afraid", "annoyed"}
41
  moderate_emotions = {"confused", "sad", "tired", "concerned", "sadness"}
 
27
  def generate_response(intent, human=True):
28
  if human:
29
  prompt = (
30
+ f"You are a telecom customer service agent. For the customer intent '{intent}', provide a helpful reply using this 3-part format: "
31
+ "[Greeting: short polite opener.] [Middle: Mention customer is currently using Plan X at ¥X/month (fictional), recommend Plan Y with XXGB at ¥Y/month (fictional).] [Ending: Ask if they want to proceed.]"
 
32
  )
33
  else:
34
  prompt = (
35
+ f"You are a helpful telecom AI assistant. Answer the customer intent '{intent}' in a short, friendly, single sentence. Offer relevant support or recommendation directly, using fictional placeholders like Plan X, ¥X, 10GB etc."
36
  )
37
+ return text_generator(prompt, max_new_tokens=80, do_sample=False)[0]['generated_text']
38
 
39
  urgent_emotions = {"anger", "frustration", "anxiety", "urgency", "afraid", "annoyed"}
40
  moderate_emotions = {"confused", "sad", "tired", "concerned", "sadness"}