Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
R Deep Learning Projects

You're reading from  R Deep Learning Projects

Product type Book
Published in Feb 2018
Publisher Packt
ISBN-13 9781788478403
Pages 258 pages
Edition 1st Edition
Languages

Bag of words benchmark


We came across one-hot embeddings while identifying fraudulent emails in Chapter 3, Fraud Detection with Autoencoders. The idea is to represent each word as a basis vector; that is, a vector with zeros except one coordinate. Hence, each document (a review in this case) is represented as a vector with ones and zeros. We went a bit further from that and used different weighting (tf-idf).

Let's revisit this model once again, but include n-grams instead of single words. This will be our benchmark for the more sophisticated word embeddings we will do later. 

Preparing the data

The data is a subset of the Stanford Large Movie Review dataset, originally published in:

Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. (2011). Learning Word Vectors for Sentiment Analysis. The 49th Annual Meeting of the Association for Computational Linguistics (ACL 2011).

This data is available to download at http://ai.stanford.edu/~amaas/data/sentiment...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}