Spaces:
Sleeping
Sleeping
rename worker
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def classify_comments():
|
|
| 28 |
results = []
|
| 29 |
for comment in df['customer_comment']:
|
| 30 |
# Classify the sentiment first
|
| 31 |
-
sentiment =
|
| 32 |
prompt = f"What category best describes this comment? '{comment}' Please answer using only the name of the category: Product Experience, Customer Support, Price of Service, Other."
|
| 33 |
category = generator(prompt, max_length=30)[0]['generated_text']
|
| 34 |
categories.append(category)
|
|
|
|
| 28 |
results = []
|
| 29 |
for comment in df['customer_comment']:
|
| 30 |
# Classify the sentiment first
|
| 31 |
+
sentiment = classifier(comment)[0]['label']
|
| 32 |
prompt = f"What category best describes this comment? '{comment}' Please answer using only the name of the category: Product Experience, Customer Support, Price of Service, Other."
|
| 33 |
category = generator(prompt, max_length=30)[0]['generated_text']
|
| 34 |
categories.append(category)
|