Spaces:
Sleeping
Sleeping
| import pandas as pd | |
| # Function to preprocess input text | |
| def preprocess_text(text): | |
| if pd.isna(text): | |
| return "" | |
| return text.strip().lower() # Simple lowercase cleaning | |
| # Function to preprocess dataset | |
| def preprocess_dataset(df): | |
| df["text"] = df["text"].apply(preprocess_text) | |
| return df | |