miscjose commited on
Commit
125041f
1 Parent(s): ee686c5

Updated titles

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -69,13 +69,17 @@ def get_recommendation(query, number_of_recommendations, genres, themes, rating,
69
  weighted_scores = get_n_weighted_scores(filtered_anime, query, number_of_recommendations, float(objective_weight), float(subjective_weight))
70
  for idx, (key, score, review_index) in enumerate(weighted_scores, start=1):
71
  data = embeddings[key]
 
 
 
 
72
  english = data['english']
73
  description = data['description']
74
  review = data['reviews'][review_index]['text']
75
  image = data['image']
76
 
77
- results.append(gr.Image(label=f"{english}",value=image, height=435, width=500, visible=True))
78
- results.append(gr.Textbox(label=f"Recommendation {idx}: {english}", value=description, max_lines=7, visible=True))
79
  results.append(gr.Textbox(label=f"Most Relevant User Review",value=review, max_lines=7, visible=True))
80
 
81
  for _ in range(10-number_of_recommendations):
 
69
  weighted_scores = get_n_weighted_scores(filtered_anime, query, number_of_recommendations, float(objective_weight), float(subjective_weight))
70
  for idx, (key, score, review_index) in enumerate(weighted_scores, start=1):
71
  data = embeddings[key]
72
+ if not data['english']:
73
+ name = data['japanese']
74
+ else:
75
+ name = data['english']
76
  english = data['english']
77
  description = data['description']
78
  review = data['reviews'][review_index]['text']
79
  image = data['image']
80
 
81
+ results.append(gr.Image(label=f"Recommendation {idx}: {name}",value=image, height=435, width=500, visible=True))
82
+ results.append(gr.Textbox(label=f"Synopsis", value=description, max_lines=7, visible=True))
83
  results.append(gr.Textbox(label=f"Most Relevant User Review",value=review, max_lines=7, visible=True))
84
 
85
  for _ in range(10-number_of_recommendations):