From the course: Develop ML Models with Python and T-SQL
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Demo: Loading data for sentiment analysis
From the course: Develop ML Models with Python and T-SQL
Demo: Loading data for sentiment analysis
- [Instructor] In the first part of demo three, we're going to load text data and use it for sentiment analysis. This data is found in a text file called Yelp_Reviews.txt. Essentially, it contains 991 different records containing two separate columns that are tab delimited. We have the actual review followed by the sentiment, and this repeats for all 991 records all throughout the file. So let's get started by importing it. Looking at our script, we're going to utilize the pyodbc and the PANDAS modules. We're going to specify the path of the file. Then we're going to use the pandas module to be able to read that text file. Although it's text, we're going to utilize the read_CSV method, and we're going to specify the path of the file, how it's delimited. In this case, it's using the tab delimiter, and we're going to assign names to the separate columns: review and sentiment. We establish a connection to the database, instantiate our cursor object, and like we've done before, we check…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Project overview1m 23s
-
Demo: Training the model for linear regression4m 15s
-
(Locked)
Demo: Using the model for linear regression predictions2m 22s
-
(Locked)
Demo: Loading classification data2m 7s
-
(Locked)
Demo: Training and using the model for classification predictions3m 45s
-
(Locked)
Demo: Loading data for sentiment analysis2m 31s
-
(Locked)
Demo: Training and using the model for sentiment analysis predictions3m 47s
-
(Locked)
Demo: Loading housing data for pipeline, cross validation, and hyperparameters1m 10s
-
(Locked)
Demo: Using data for pipeline, cross validation, and hyperparameters5m 32s
-
(Locked)
-