gaspar-avit commited on
Commit
4e1e792
·
1 Parent(s): ac9d9ab

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -152,6 +152,8 @@ def load_dataset():
152
 
153
  # Create dataframe
154
  data = pd.read_csv('movies_metadata.csv', low_memory=False)
 
 
155
 
156
  return data
157
 
@@ -203,8 +205,7 @@ def generate_poster(movie_data):
203
 
204
  st.text("")
205
  st.text("")
206
- st.title("""
207
- #### Synopsis: """)
208
  st.text("Synopsis summary: " + synopsis_sum)
209
  st.text("")
210
 
@@ -219,8 +220,7 @@ def generate_poster(movie_data):
219
 
220
  st.text("")
221
  st.text("")
222
- st.title("""
223
- #### Resulting poster: """)
224
  col1, col2, col3 = st.columns(3)
225
 
226
  with col1:
@@ -286,12 +286,14 @@ if __name__ == "__main__":
286
  is_clicked_rerun = None
287
 
288
  if is_clicked:
289
- poster = generate_poster(data[data.title==selected_movie])
290
 
 
291
  if poster is not None:
292
  buffer1, col1, buffer2 = st.columns([1.3, 1, 1])
293
  is_clicked_rerun = col1.button(label="Rerun with same movie!")
294
 
295
  if is_clicked_rerun:
296
- poster = generate_poster(data[data.title==selected_movie])
 
297
 
 
152
 
153
  # Create dataframe
154
  data = pd.read_csv('movies_metadata.csv', low_memory=False)
155
+ data['year'] = data["release_date"].map(lambda x: x.split('-')[0] if isinstance(x, str) else '0')
156
+ data['title_year'] = data['title'] + ' (' + data['year'] + ')'
157
 
158
  return data
159
 
 
205
 
206
  st.text("")
207
  st.text("")
208
+ st.subheader("Synopsis:")
 
209
  st.text("Synopsis summary: " + synopsis_sum)
210
  st.text("")
211
 
 
220
 
221
  st.text("")
222
  st.text("")
223
+ st.subheader("Resulting poster:")
 
224
  col1, col2, col3 = st.columns(3)
225
 
226
  with col1:
 
286
  is_clicked_rerun = None
287
 
288
  if is_clicked:
289
+ poster = generate_poster(data[data.title_year==selected_movie])
290
 
291
+ """
292
  if poster is not None:
293
  buffer1, col1, buffer2 = st.columns([1.3, 1, 1])
294
  is_clicked_rerun = col1.button(label="Rerun with same movie!")
295
 
296
  if is_clicked_rerun:
297
+ poster = generate_poster(data[data.title_year==selected_movie])
298
+ """
299