Skip to content

Instantly share code, notes, and snippets.

@Tony607
Created February 23, 2018 09:26
Show Gist options
  • Save Tony607/67eaf91b4040b39c639e3e27414de405 to your computer and use it in GitHub Desktop.
Save Tony607/67eaf91b4040b39c639e3e27414de405 to your computer and use it in GitHub Desktop.
source: How to generate realistic yelp restaurant reviews with Keras | DLology
# Read thow two CSV files to pandas dataframes
df_business=pd.read_csv('../dataset/business.csv')
df_review=pd.read_csv('../dataset/review.csv')
# Filter 'Restaurants' businesses
restaurants = df_business[df_business['categories'].str.contains('Restaurants')]
# Filter 5-stars reviews
five_star=df_review[df_review['stars']==5]
# merge the reviews with restaurants by key 'business_id'
# This keep only 5-star restaurants reviews
combo=pd.merge(restaurants_clean, five_star, on='business_id')
# review texts column
rnn_fivestar_reviews_only=combo[['text']]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment