File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,16 @@ def load_data(file):
27
27
st .write ("Column Names:" )
28
28
st .write (reviews_df .columns .tolist ())
29
29
30
+ # Check for 'review' or 'user-review' columns
31
+ review_column = None
30
32
if 'review' in reviews_df .columns :
33
+ review_column = 'review'
34
+ elif 'user-review' in reviews_df .columns :
35
+ review_column = 'user-review'
36
+
37
+ if review_column :
31
38
st .write ("Sentiment Analysis:" )
32
- sentiment_df , analyzed_df = analyze_reviews (reviews_df )
39
+ sentiment_df , analyzed_df = analyze_reviews (reviews_df , review_column )
33
40
st .write (sentiment_df )
34
41
35
42
st .write ("Analyzed DataFrame with Sentiments:" )
@@ -39,6 +46,6 @@ def load_data(file):
39
46
recommendations = recommend_movies (analyzed_df )
40
47
st .write (recommendations )
41
48
else :
42
- st .error ("The uploaded CSV file does not contain a 'review' column." )
49
+ st .error ("The uploaded CSV file does not contain a 'review' or 'user-review' column." )
43
50
else :
44
51
st .write ("Please upload a CSV file to proceed." )
You can’t perform that action at this time.
0 commit comments