text_plain_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

csv = pd.read_csv('/kaggle/input/trip-advisor-hotel-reviews/tripadvisor_hotel_reviews.csv')
csv = csv.rename(columns={'Review': 'review', 'Rating': 'rating'})
csv['rating'] = csv['rating'] - 1

reviews = csv['review'].tolist()
ratings = csv['rating'].tolist()
features = {}

train_test_split = 0.8
reviews_train = reviews[:round(train_test_split * len(reviews))]
reviews_test = reviews[round(train_test_split * len(reviews)):]
ratings_train = ratings[:round(train_test_split * len(ratings))]
ratings_test = ratings[round(train_test_split * len(ratings)):]
print('Train: {} reviews, {} ratings'.format(len(reviews_train), len(ratings_train)))
print('Test: {} reviews, {} ratings'.format(len(reviews_test), len(ratings_test)))