0% found this document useful (0 votes)
94 views

Department of Computer Science and Engineering Coding Assignment For Deep Learning CSE754

The document summarizes a student project to build a text classification model using a convolutional neural network (CNN) to classify customer reviews as positive or negative. The model was trained on labeled datasets and achieved 78.24% accuracy on a customer review dataset, 76.6% accuracy on a movie review dataset, and approximately 90% accuracy on a subjectivity dataset, performing comparably to results from other authors. Key steps included labeling, splitting, and training the data, and comparing results based on accuracy metrics. Challenges included version incompatibilities between TensorFlow versions and other Python libraries.

Uploaded by

Rithvik Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Department of Computer Science and Engineering Coding Assignment For Deep Learning CSE754

The document summarizes a student project to build a text classification model using a convolutional neural network (CNN) to classify customer reviews as positive or negative. The model was trained on labeled datasets and achieved 78.24% accuracy on a customer review dataset, 76.6% accuracy on a movie review dataset, and approximately 90% accuracy on a subjectivity dataset, performing comparably to results from other authors. Key steps included labeling, splitting, and training the data, and comparing results based on accuracy metrics. Challenges included version incompatibilities between TensorFlow versions and other Python libraries.

Uploaded by

Rithvik Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Department of Computer Science and

Engineering

Coding Assignment for Deep Learning


CSE754

Title:CNN for sentence classification


Student USN Student Name
1MS18CS045 Fayyaz Ahmed Mohammad
1MS18CS096 Prashanth S
1MS18CS100 Rithvik S Shetty
1MS18CS127 Tharun E

M.S. RAMAIAH INSTITUTE OF TECHNOLOGY


(Autonomous Institute, Affiliated to VTU)
Report

Introduction:
Analysing the customer reviews to judge the quality of the product by it often
helps in making the better decisions on choosing the right product. But, the
problem arises when there are a large number of reviews. There are 2
approaches to resolve the problem. The first one, is using the number associated
with the review(called rating), which expresses the amount of satisfaction. The
latter one is by using the text classification technique, which classifies the
review into 2 classes namely- positive and negative respectively. In this work,
we have developed a text classification model which is built using
CNN(Convolutional Neural Network).
Problem Statement:
The task is to build a text classification model using CNN and classify the text
using the model. Finally we are required to evaluate the accuracy of the text
classification against the sample data.
Structure Chart:

Fig Shows the overall process flow of the model


Implementation and Results

Input:

The two seperate of input files each containing negative and positive customer
reviews respectively.

Output:

The output is the model generated by the training part of the data. It’s accuracy
is then evaluated against the remaining test part of the data.

The output Consists of:

1. Step

Indicates the number of epochs the training is being carried out.

2. Loss

The Gradient descent value obtained using the Adam optimizer.

3. Accuracy

The model accuracy is represented as a fraction.

Algorithm:

Steps:

1. Labelling

The datasets are labelled to identify the raw data to add more meaning and
context to the model so that it can help efficiently in supervised learning.

2. Splitting the data

The data was split into 90% and 10% fractions. Assigning data points to the
former and remaining to the latter.
3. Training

The datasets are trained to help and understand how sophisticated results are
produced in order to make predictions and fulfill the desired task.

4. Comparing the datasets

The datasets are compared based on the algorithm’s flow of work. The
comparison is both qualitative and quantitative and investigates object detection
labels with respect to size, location, and contextual information.

Results:
The tests are carried out through these metrics:

1. Accuracy based on Customer Review dataset (Hu and Liu, 2004)


Classification accuracy tells us how well the algorithm has done to classify an
object to its original class.

Metric scores:
1.accuracy obtained by the author = 0.798
2.accuracy obtained by us = 0.7824
The results were mixed as the work on regularizing the fine-tuning process is
expected.

2. Accuracy based on Movie Review dataset (Pang and Lee, 2008)

Metric scores:
1. Accuracy obtained by the author = 0.761
2. Accuracy obtained by us = 0.756

3. Accuracy based on Subjectivity dataset (Pang and Lee, 2005)

We have achieved the author’s expectations with our model which is


approximately 90%.
These results suggest that the pre-trained vectors are good, ‘universal’ feature
extractors and can be utilized across datasets. Fine-tuning the pre-trained
vectors for each task gives still further improvements.
A simple CNN with one layer of convolution performs remarkably well. Our
results add to the well-established evidence that unsupervised pre-training of
word vectors is an important ingredient in deep learning.

Epilogue:
The most troublesome parts during the implementation of the project was the
version incompatibilities between tensorflow 1 and tensorflow 2 and some other
python libraries as well. All in all we learnt to use version specific tensorflow
containers for addressing this problem and it will be useful when we try to
execute older tensorflow repositories.

Attachments:
Github link:
https://github.com/tharunedara/cnn-sentence-classification

You might also like