def generate_sorted_movie_vocab(movies_df, movie_counts):
  """Generate vocabulary for movies, and sort by usage count."""
  vocab_movies = []
  for movie_id, title, genres in movies_df.values:
    count = movie_counts[movie_id] if movie_id in movie_counts else 0
    vocab_movies.append([movie_id, title, genres, count])
  vocab_movies.sort(key=lambda x: x[3], reverse=True)
  return vocab_movies