An open API service indexing awesome lists of open source software.

https://github.com/jalajthanaki/amazon_review_summarization

The repository contains the code which can summarize Amazon's review
https://github.com/jalajthanaki/amazon_review_summarization

Last synced: 5 months ago
JSON representation

The repository contains the code which can summarize Amazon's review

Awesome Lists containing this project

README

          

# Text-Summarization-with-Amazon-Reviews

The objective of this project is to build a seq2seq model that can create relevant summaries for reviews written about fine foods sold on Amazon. This dataset contains above 500,000 reviews, and is hosted on [Kaggle](https://www.kaggle.com/snap/amazon-fine-food-reviews). It's too large to host here, it's over 300MB.

To build our model we will use a two-layered bidirectional RNN with LSTMs on the input data and two layers, each with an LSTM using bahdanau attention on the target data. [Jaemin Cho's tutorial](https://github.com/j-min/tf_tutorial_plus/tree/master/RNN_seq2seq/contrib_seq2seq) for seq2seq was really helpful to get the code in working order because this is my first project with TensorFlow 1.1; some of the functions are very different from 1.0. The architecture for this model is similar to Xin Pan's and Peter Liu's, here's their [GitHub page.](https://github.com/tensorflow/models/tree/master/textsum)

This model uses [Conceptnet Numberbatch's](https://github.com/commonsense/conceptnet-numberbatch) pre-trained word vectors.

## dependencies

* pandas
* numpy
* nltk
* tensorflow 1.1
* python 3

## Install
```
pandas: $ sudo pip install pandas
numpy: $ sudo pip install numpy
nltk: $ sudo pip install nltk
tensorflow: $ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp34-cp34m-linux_x86_64.whl

```

## Demo Results
Here are some examples of reviews and their generated summaries:
- Description(1): The coffee tasted great and was at such a good price! I highly recommend this to everyone!
- Summary(1): great coffee

- Description(2): This is the worst cheese that I have ever bought! I will never buy it again and I hope you won’t either!
- Summary(2): omg gross gross

- Description(3): love individual oatmeal cups found years ago sam quit selling sound big lots quit selling found target expensive buy individually trilled get entire case time go anywhere need water microwave spoon know quaker flavor packets
- Summary(3): love it

I wrote an [article](https://medium.com/@Currie32/text-summarization-with-amazon-reviews-41801c2210b) about this project that explains parts of it in detail.

## Credit

Code credits for this code go to [David Currie](https://github.com/Currie32) I've merely created a wrapper and necessary changes to get people started.