-
-
Save Tony607/67eaf91b4040b39c639e3e27414de405 to your computer and use it in GitHub Desktop.
source: How to generate realistic yelp restaurant reviews with Keras | DLology
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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