Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -46,9 +46,10 @@ data = {
|
|
46 |
df = pd.DataFrame(data)
|
47 |
|
48 |
# Encoding the contexts using One-Hot Encoding (memory-efficient)
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
# Encoding emotions
|
53 |
emotions_target = pd.Categorical(df['emotion']).codes
|
54 |
emotion_classes = pd.Categorical(df['emotion']).categories
|
|
|
46 |
df = pd.DataFrame(data)
|
47 |
|
48 |
# Encoding the contexts using One-Hot Encoding (memory-efficient)
|
49 |
+
try:
|
50 |
+
encoder = OneHotEncoder(handle_unknown='ignore', sparse_output=True)
|
51 |
+
except TypeError:
|
52 |
+
encoder = OneHotEncoder(handle_unknown='ignore', sparse=True)
|
53 |
# Encoding emotions
|
54 |
emotions_target = pd.Categorical(df['emotion']).codes
|
55 |
emotion_classes = pd.Categorical(df['emotion']).categories
|