Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def preprocess_input(short_description, impact, priority, category, urgency):
|
|
41 |
input_data[column] = label_encoders[column].fit_transform(input_data[column])
|
42 |
short_description = input_data['short_description'].iloc[0].lower()
|
43 |
# Tokenize text data
|
44 |
-
sequences = tokenizer.texts_to_sequences(short_description)
|
45 |
print("Short description",input_data['short_description'].iloc[0])
|
46 |
print("Sequence",sequences)
|
47 |
if not sequences:
|
@@ -55,8 +55,9 @@ def preprocess_input(short_description, impact, priority, category, urgency):
|
|
55 |
# Normalize numerical features
|
56 |
numerical_features = input_data[['impact', 'priority', 'category', 'urgency', 'sentiment_score']]
|
57 |
scaler = StandardScaler()
|
58 |
-
scaled_numerical_features = scaler.fit_transform(numerical_features)
|
59 |
|
|
|
|
|
60 |
# Prepare the final input features
|
61 |
X_input = np.concatenate([padded_sequences, scaled_numerical_features], axis=1)
|
62 |
return X_input, input_data['sentiment_score'].iloc[0]
|
|
|
41 |
input_data[column] = label_encoders[column].fit_transform(input_data[column])
|
42 |
short_description = input_data['short_description'].iloc[0].lower()
|
43 |
# Tokenize text data
|
44 |
+
sequences = tokenizer.texts_to_sequences([short_description])
|
45 |
print("Short description",input_data['short_description'].iloc[0])
|
46 |
print("Sequence",sequences)
|
47 |
if not sequences:
|
|
|
55 |
# Normalize numerical features
|
56 |
numerical_features = input_data[['impact', 'priority', 'category', 'urgency', 'sentiment_score']]
|
57 |
scaler = StandardScaler()
|
|
|
58 |
|
59 |
+
scaled_numerical_features = scaler.fit_transform(numerical_features)
|
60 |
+
|
61 |
# Prepare the final input features
|
62 |
X_input = np.concatenate([padded_sequences, scaled_numerical_features], axis=1)
|
63 |
return X_input, input_data['sentiment_score'].iloc[0]
|