Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,21 +54,16 @@ def get_emotion_score(emotion):
|
|
54 |
return 0.2
|
55 |
|
56 |
def generate_response(intent, human=True):
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
else:
|
65 |
-
prompt = (
|
66 |
-
f"You are a helpful telecom assistant. Briefly resolve the intent '{intent}' in one sentence. "
|
67 |
-
"Use placeholders like Plan X, ¥X/month, and keep the tone friendly."
|
68 |
-
)
|
69 |
-
result = text_generator(prompt, max_new_tokens=80, do_sample=False)
|
70 |
return result[0]['generated_text'].strip()
|
71 |
|
|
|
72 |
# Streamlit config
|
73 |
st.set_page_config(page_title="Smart Customer Support Assistant", layout="wide")
|
74 |
st.sidebar.title("📁 Customer Selector")
|
|
|
54 |
return 0.2
|
55 |
|
56 |
def generate_response(intent, human=True):
|
57 |
+
prompt = (
|
58 |
+
f"You are a telecom customer service assistant. For the customer intent '{intent}', generate a 3-part response:\n"
|
59 |
+
"[Greeting: polite welcome.]\n"
|
60 |
+
"[Middle: mention the customer is currently on Plan X (¥X/month), and suggest switching to Plan Y with XXGB at ¥Y/month. Use fictional placeholder values.]\n"
|
61 |
+
"[End: ask if they'd like to proceed with the new plan or need more details.]"
|
62 |
+
)
|
63 |
+
result = text_generator(prompt, max_new_tokens=100, do_sample=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
return result[0]['generated_text'].strip()
|
65 |
|
66 |
+
|
67 |
# Streamlit config
|
68 |
st.set_page_config(page_title="Smart Customer Support Assistant", layout="wide")
|
69 |
st.sidebar.title("📁 Customer Selector")
|