vivek9 commited on
Commit
f46e82e
1 Parent(s): 6c6814a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +38 -52
README.md CHANGED
@@ -1,58 +1,44 @@
1
- ---
2
- license: openrail
3
- ---
4
- \documentclass{article}
5
- \usepackage{hyperref}
6
-
7
- \title{Amazon Fine Food Sentiment Analysis with BERT}
8
- \author{Vivek Kumar Trivedi}
9
- \date{\today}
10
-
11
- \begin{document}
12
- \maketitle
13
-
14
- \section{About the Model}
15
- This repository contains code for a sentiment analysis that predicts the sentiment of Amazon fine food reviews using a finetuned BERT Base model from the Hugging Face Transformers library. The model also includes an interface built using Gradio, allowing users to interactively input reviews and receive sentiment predictions.
16
-
17
- \section{Amazon Fine Food Reviews Dataset}
18
- The sentiment analysis model is trained on the Amazon Fine Food Reviews dataset with the following details:
19
- \begin{itemize}
20
- \item Number of reviews: 568,454
21
- \item Number of users: 256,059
22
- \item Number of products: 74,258
23
- \item Timespan: October 1999 — October 2012
24
- \item Number of attributes/columns in the data: 10
25
- \end{itemize}
26
-
27
- \section{Model Architecture}
28
- In the training procedure, the forward pass of the sentiment analysis model is structured as follows:
29
- \begin{verbatim}
30
- self.bert = BertModel.from_pretrained(MODEL_NAME)
31
- self.drop = nn.Dropout(p=0.3)
32
- self.out = nn.Linear(self.bert.config.hidden_size, n_classes)
33
- \end{verbatim}
34
-
35
- \section{Files in the Repository}
36
- \begin{itemize}
37
- \item \texttt{amazon\_finefood\_sentiment\_analysis\_training.ipynb}: This Jupyter Notebook contains the code for training the sentiment analysis model on the Amazon Fine Food Reviews dataset.
38
- \item \texttt{amazon\_finefood\_sentiment\_analysis\_interface.ipynb}: This Jupyter Notebook includes the code for building the Gradio interface that utilizes the trained model for sentiment prediction.
39
- \item \texttt{sentiment\_analysis\_finetune\_bert.pkl}: This pickled file stores the trained sentiment analysis model in a serialized format.
40
- \end{itemize}
41
-
42
- \section{Usage}
43
  To run the code and interact with the sentiment analysis demo:
44
- \begin{enumerate}
45
- \item Open the \texttt{amazon\_finefood\_sentiment\_analysis\_interface.ipynb} notebook.
46
- \item Set the file path to the \texttt{sentiment\_analysis\_finetune\_bert.pkl} file, which contains the trained model.
47
- \item Execute the notebook cells to set up the Gradio interface and make predictions on Amazon fine food reviews.
48
- \end{enumerate}
49
 
50
- Feel free to experiment with the interface, input different reviews, and observe the model's sentiment predictions and confidence scores.
 
 
 
 
51
 
52
- For any questions or issues, please feel free to open an issue in this repository.
53
 
54
- \section{Acknowledgments}
55
- The sentiment analysis model is based on the BERT architecture developed by Google and made available through the Hugging Face Transformers library. The Amazon Fine Food Reviews dataset is used for training and evaluating the model's performance. Gradio is used to create the interactive user interface for sentiment prediction.
56
 
 
57
 
58
- \end{document}
 
1
+ # Amazon Fine Food Sentiment Analysis with BERT
2
+
3
+ This repository contains code for a sentiment analysis demo that predicts the sentiment of Amazon fine food reviews using a finetuned BERT Base model from the Hugging Face Transformers library. The demo also includes an interface built using Gradio, allowing users to interactively input reviews and receive sentiment predictions.
4
+
5
+ ## About the Demo
6
+
7
+ The sentiment analysis model is trained on the Amazon Fine Food Reviews dataset, which includes:
8
+
9
+ - Number of reviews: 568,454
10
+ - Number of users: 256,059
11
+ - Number of products: 74,258
12
+ - Timespan: Oct 1999 — Oct 2012
13
+ - Number of Attributes/Columns in data: 10
14
+
15
+ ## Model Architecture
16
+
17
+ **Model Architecture:**
18
+
19
+ - `self.bert`: BERT Base model loaded from pre-trained weights.
20
+ - `self.drop`: Dropout layer applied for regularization.
21
+ - `self.out`: Linear layer mapping BERT hidden size to sentiment classes.
22
+
23
+ **Files in the Repository:**
24
+
25
+ - `amazon_finefood_sentiment_analysis_training.ipynb`: Code for training the sentiment analysis model.
26
+ - `amazon_finefood_sentiment_analysis_interface.ipynb`: Code for building the Gradio interface.
27
+ - `sentiment_analysis_finetune_bert.pkl`: Trained sentiment analysis model in serialized format.
28
+
29
+ **Usage:**
30
+
 
 
 
 
 
 
 
 
 
 
 
 
31
  To run the code and interact with the sentiment analysis demo:
 
 
 
 
 
32
 
33
+ 1. Open `amazon_finefood_sentiment_analysis_interface.ipynb`.
34
+ 2. Set the file path to `sentiment_analysis_finetune_bert.pkl`.
35
+ 3. Execute the notebook cells to set up the Gradio interface and make predictions.
36
+
37
+ Feel free to experiment with the interface, input different reviews, and observe sentiment predictions and confidence scores.
38
 
39
+ For questions/issues, open an issue in this repository.
40
 
41
+ **Acknowledgments:**
 
42
 
43
+ The sentiment analysis model uses BERT architecture from Hugging Face Transformers. The Amazon Fine Food Reviews dataset is for training. Gradio is used for the interactive interface.
44