Coder Social home page Coder Social logo

kavitha-kothandaraman / sentiment-classification-using-nlp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 74 KB

To generate Word Embeddings and retrieve outputs of each layer with Keras based on the Sentiment Classification task

Jupyter Notebook 100.00%
word-embeddings glove-embeddings glove-vectors nlp natural-language-processing sentiment-classification classification-task imdb review labels embeddings dataset

sentiment-classification-using-nlp's Introduction

Sentiment-Classification

Objective

To generate Word Embeddings and retrieve outputs of each layer with Keras based on the Classification task

Description

Word embeddings are a type of word representation that allows words with similar meaning to have a similar representation.

It is a distributed representation for the text that is perhaps one of the key breakthroughs for the impressive performance of deep learning methods on challenging natural language processing problems.

We will use the IMDb dataset to learn word embeddings as we train our dataset. This dataset contains 25,000 movie reviews from IMDB, labeled with a sentiment (positive or negative).

Dataset

The Dataset of 25,000 movie reviews from IMDB, labeled by sentiment (positive/negative). Reviews have been preprocessed, and each review is encoded as a sequence of word indexes (integers). For convenience, the words are indexed by their frequency in the dataset, meaning the for that has index 1 is the most frequent word. Use the first 20 words from each review to speed up training, using a max vocab size of 10,000.

As a convention, "0" does not stand for a specific word, but instead is used to encode any unknown word.

Steps followed

1.Import test and train data

2.Import the labels ( train and test)

3.Get the word index and then Create a key-value pair for word and word_id

4.Build a Sequential Model using Keras for the Sentiment Classification task

5.Report the Accuracy of the model

6.Retrieve the output of each layer in Keras for a given single test sample from the trained model you built

sentiment-classification-using-nlp's People

Contributors

kavitha-kothandaraman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.