Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Text Mining Tweets with Twitter & Tidytext

Text Mining Tweets with Twitter & Tidytext

Learn about how customers view your brand with data science! Use the twitter API to collect tweets related to your organization. Use Sentiment Analysis to learn whether your band is being positively or negatively discussed. Then package your analysis in a Shiny Twitter Hashtag Sentiment Analyzer for Brand Intelligence!

71262b1f27ccad7e2bf0c8a2ca518b93?s=128

Matt Dancho

April 08, 2020
Tweet

Transcript

  1. With Twitter API & Tidytext Matt Dancho & David Curry

    Business Science Learning Lab Text Mining Tweets
  2. Learning Lab Structure • Presentation (20 min) • Demo’s (30

    min) • Pro-Tips (15 mins)
  3. Shiny API Series • Lab 28 - Shiny Real Estate

    App ◦ Zillow API • Lab 29 - Shiny Oil & Gas App ◦ Quandl API • Lab 30 - Shiny Finance App ◦ Tidyquant API • Lab 31 - Shiny Marketing App ◦ Google Analytics API • Lab 32 - Shiny Twitter App ◦ Twitter API
  4. Learning Labs PRO Every 2-Weeks 1-Hour Course Recordings + Code

    + Slack $19/month university.business-science.io Lab 32 - Shiny API Series, Pt 5 Shiny + Twitter + Tidytext Lab 31 - Shiny API Series, Pt 4 Shiny + Google Analytics + Prophet Lab 30 - Shiny API Series, Pt 3 Shiny + Finance + Excel + R + Tidyquant Lab 29 - Shiny API Series, Pt 2 Shiny + Quandl + ARIMA for Energy Forecasting Lab 28 - Shiny API Series, Pt 1 Shiny + Zillow for Real Estate Lab 27 - Marketing Series, Pt 4 Google Trends Automation with Shiny Lab 26 - Marketing Series, Pt 3 Customer Journey with Machine Learning Lab 25 - Marketing Series, Pt 2 Attribution with ChannelAttribution Continuous Learning Advanced Topics
  5. Agenda • Demo ◦ Twitter Hashtag Sentiment Analyzer • Business

    Case ◦ Uses of Sentiment Analysis • Twitter API ◦ What’s Available? (80/20) • Text Mining & Sentiment ◦ What is it? ◦ How do we do it? • 30-Min Demo ◦ Twitter API ◦ Sentiment Analysis ◦ Shiny Hashtag Analyzer [LL PRO] • Career Acceleration ◦ Shiny capabilities ◦ Build your career
  6. Bonuses for LL PRO Members Today Bonus #1 - Shiny

    Hashtag App Bonus #2 - Geocoding for FREE Script $19
  7. Business Case Study Brand Intelligence

  8. Brand Assessment Ideas spread. What are your customers saying?

  9. Positive Sentiment Positive Sentiment Can highlight where people are positively

    viewing your brand. Keep this up! “Community” “Sustainability ”
  10. Negative Sentiment Negative Sentiment Can highlight key issues your customers

    care about. “Recycling”
  11. Twitter Hashtag Tracker Ideas spread. What are your customers saying?

  12. Demo

  13. Twitter API in R

  14. Twitter In 2019, Twitter had 145 Million Daily Active Users

    Twitter has an open developer API • Tweet-Level Data • Screen name • Tweet Text
  15. Twitter Developer API: https://developer.twitter.com/en

  16. rtweet: https://rtweet.info/

  17. Obtaining Access: https://rtweet.info/articles/auth.html

  18. Twitter Data https://rtweet.info/articles/intro.html

  19. Text Analysis With Tidytext

  20. Tidytext https://www.tidytextmining.com/ Key Points • 1M downloads (super popular) •

    Easy to use • Integrates tools for tokenizing & sentiment analysis • Works in tidyverse My experience I’m not an expert in text. But I feel like one now. Key Point: Simple & Good.
  21. How Tidytext Works Tokenizing Tweet Data

  22. Sentiment Analysis Bing Dictionary Afinn Dictionary Assign words values (sentiment

    or polarity)
  23. Sentiment Analysis

  24. Workflow From zero to Twitter Sentiment Automation

  25. Workflow Step-By-Step Start Finish 1 2 3 Twitter API Connect

    to Twitter Preprocess & Visualize Data Tidytext Tokenize data Apply Sentiment Analysis Shiny App that automates the Brand Sentiment Analysis
  26. Shiny is Critical to Production! Leaflet Map to show search

    radius Plotly Polarity Viz for isolating tweets Word Cloud to Summarize Polarity
  27. 30-Min Demo Tidy Text + Twitter + Shiny

  28. None
  29. Career Acceleration And how Shiny Apps help

  30. Shiny is Critical to Production! Leaflet Map to show search

    radius Plotly Polarity Viz for isolating tweets Word Cloud to Summarize Data
  31. Career Tip #1: Give Businesses Apps Apps are what businesses

    need Businesses can’t scale reports Businesses have cloud & servers (AWS / Azure) Businesses need your analysis in the right form You can solve these problems with shiny apps Apps solve these challenges
  32. Career Tip #2: Say no to reports No

  33. Career Tip #3: Say YES to apps. Yes apps.business-science.io

  34. Advanced Visualization Advanced Data Wrangling Advanced Functional Programming & Modeling

    Advanced Machine Learning Visualization Data Cleaning & Manipulation Data Science Algorithms & Iteration Business Reporting Business Analysis with R (DS4B 101-R) Data Science For Business with R (DS4B 201-R) Web Apps & Shiny Developer (DS4B 102-R + DS4B 202A-R) Web Apps Data Science Foundations 7 Weeks Machine Learning & Business Consulting 10 Weeks Web Application Development 12 Weeks -TRACK Project-Based Courses with Business Application Business Science University R-Track 4-Course R-Track System
  35. Key Benefits - Fundamentals - Weeks 1-5 (25 hours of

    Video Lessons) - Data Manipulation (dplyr) - Time series (lubridate) - Text (stringr) - Categorical (forcats) - Visualization (ggplot2) - Programming & Iteration (purrr) - 3 Challenges - Machine Learning - Week 6 (8 hours of Video Lessons) - Clustering (3 hours) - Regression (5 hours) - 2 Challenges - Learn Business Reporting - Week 7 - RMarkdown & plotly - 2 Project Reports: 1. Product Pricing Algo 2. Customer Segmentation Visualization Data Cleaning & Manipulation Business Reporting Business Analysis with R (DS4B 101-R) Data Science Foundations 7 Weeks Data Science Algorithms & Iteration
  36. Key Benefits Understanding the Problem & Preparing Data - Weeks

    1-4 - Project Setup & Framework - Business Understanding / Sizing Problem - Tidy Evaluation - rlang - EDA - Exploring Data -GGally, skimr - Data Preparation - recipes - Correlation Analysis - 3 Challenges Machine Learning - Weeks 5, 6, 7 - H2O AutoML - Modeling Churn - ML Performance - LIME Feature Explanation Return-On-Investment - Weeks 7, 8, 9 - Expected Value Framework - Threshold Optimization - Sensitivity Analysis - Recommendation Algorithm Data Science For Business (DS4B 201-R) Machine Learning & Business Consulting 10 Weeks Advanced Visualization Advanced Data Wrangling Advanced Functional Programming & Modeling Advanced Data Science End-to-End Churn Project
  37. Key Benefits Learn Shiny & Flexdashboard - Build Applications -

    Learn Reactive Programming - Integrate Machine Learning App #1: Predictive Pricing App - Model Product Portfolio - XGBoost Pricing Prediction - Generate new products instantly App #2: Sales Dashboard with Demand Forecasting - Model Demand History - Segment Forecasts by Product & Customer - XGBoost Time Series Forecast - Generate new forecasts instantly Shiny Apps for Business (DS4B 102-R) Web Application Development 4 Weeks Web Apps Machine Learning
  38. Key Benefits Frontend + Backend + Production Deployment Frontend for

    Shiny - Bootstrap Backend for Shiny - MongoDB Atlas Cloud - Dynamic UI - User Authentication & Security Production Deployment - AWS - EC2 Server - SSL & HTTPS Encryption Shiny Apps for Business (DS4B 202A-R) Web Application Development 6 Weeks
  39. -TRACK BUNDLE 15% OFF PROMO Code: learninglabs $127/mo Limited Time

  40. Career acceleration awaits university.business-science.io