app.py
app.py
import pandas as pd
import pickle
import os
import re
# Display results
return render_template('index.html', text=input_text,
predicted_label=label_prediction,
predicted_subclass=subclass_prediction)
if 'text' in df.columns:
# Clean and vectorize the text data
df['cleaned_text'] = df['text'].apply(clean_marathi_text)
X_vectorized =
tfidf_vectorizer.transform(df['cleaned_text'])
else:
return "Error: 'Text' column not found in the uploaded
CSV.", 400
except pd.errors.ParserError as e:
return f"Error reading the CSV file: {e}", 400
return redirect(url_for('index'))