Jovana Gentić 🦆
"Text generation: Food reviews" is a next word prediction model. We used LSTMs, CNNs, and transformers to learn to generate new reviews based on beggining of sentence we give to the model. This repo is written in Tensorflow.
To download dataset, go to https://www.kaggle.com/datasets/snap/amazon-fine-food-reviews. Dataset folder should be called dataset
and it should be placed in the same folder as preprocess.py
.
This dataset consists of ~390,000 unique fine foods reviews from amazon.
pip install -r requirements
To prepare vocabulary for the model, execute command:
python preprocess.py
To train the model, execute command:
python train.py
To generate new reviews, change the temperature and the starting sentence input to the model in generate.py
, and execute command:
python generate.py