Skip to Main Content
Python Artificial Intelligence Projects for Beginners
book

Python Artificial Intelligence Projects for Beginners

by Dr. Joshua Eckroth
July 2018
Beginner content levelBeginner
162 pages
3h 25m
English
Packt Publishing
Content preview from Python Artificial Intelligence Projects for Beginners

Detecting positive or negative sentiments in user reviews

In this section, we're going to look at detecting positive and negative sentiments in user reviews. In other words, we are going to detect whether the user is typing a positive comment or a negative comment about the product or service. We're going to use Word2Vec and Doc2Vec specifically and the gensim Python library for those services. There are two categories, which are positive and negative, and we have over 3,000 different reviews to look at. These come from Yelp, IMDb, and Amazon. Let's begin the code by importing the gensim library, which provides Word2Vec and Doc2Vec for logging to note status of the messages:

First, we will see how to load a pre-built Word2Vec model, provided ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Artificial Intelligence with Python

Artificial Intelligence with Python

Prateek Joshi

Publisher Resources

ISBN: 9781789539462Supplemental Content