new-classifier / preprocess.py
dinusha11's picture
Create preprocess.py
7721643 verified
raw
history blame contribute delete
312 Bytes
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