Spaces:
Sleeping
Sleeping
add gpu
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ from transformers import pipeline
|
|
| 3 |
import pandas as pd
|
| 4 |
|
| 5 |
# Load the dataset
|
| 6 |
-
DATASET_URL = 'https://huggingface.co/datasets/ZennyKenny/demo_customer_nps/resolve/main/customer_feedback_dataset.csv'
|
| 7 |
from datasets import load_dataset
|
| 8 |
ds = load_dataset('ZennyKenny/demo_customer_nps')
|
| 9 |
df = pd.DataFrame(ds['train'])
|
|
@@ -19,6 +18,7 @@ login(token=hf_api_key)
|
|
| 19 |
pipe = pipeline("text-classification", model="distilbert/distilbert-base-uncased-finetuned-sst-2-english")
|
| 20 |
|
| 21 |
# Function to classify customer comments
|
|
|
|
| 22 |
def classify_comments():
|
| 23 |
results = []
|
| 24 |
for comment in df['customer_comment']:
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
|
| 5 |
# Load the dataset
|
|
|
|
| 6 |
from datasets import load_dataset
|
| 7 |
ds = load_dataset('ZennyKenny/demo_customer_nps')
|
| 8 |
df = pd.DataFrame(ds['train'])
|
|
|
|
| 18 |
pipe = pipeline("text-classification", model="distilbert/distilbert-base-uncased-finetuned-sst-2-english")
|
| 19 |
|
| 20 |
# Function to classify customer comments
|
| 21 |
+
@spaces.GPU
|
| 22 |
def classify_comments():
|
| 23 |
results = []
|
| 24 |
for comment in df['customer_comment']:
|