Esempio n. 1
0
    def make_predictions(self, hotel_name, platforms):
        all_reviews = self.read_from_platforms(hotel_name, platforms)
        reviews_df = self.make_dataframe(all_reviews)

        nnm = NNModel()
        predited_df = nnm.generate_predictions(reviews_df)

        print(predited_df.shape)

        predited_df.to_csv(
            'C:/Users/acfelk/Documents/IIT_Files/final year/FYP/fyp_workfiles/final_project/backend/predicted_data/'
            + hotel_name + '_' + platforms + '_predicted.csv')

        return predited_df
Esempio n. 2
0
def check_predict_ratings():
    data = pd.read_csv('test_data/test_revs.csv')

    nn_model = NNModel()

    predicted_df = nn_model.generate_predictions(data)

    predicted_df.to_csv('test_data/predicted_revs.csv')

    data = pd.read_csv('test_data/predicted_revs.csv')

    if data['pred_rating'] is not None:
        print('Testing passed - Reviews Precited Successfully !')
        os.remove('test_data/predicted_revs.csv')
    else:
        print('Review Prediction has failed')