diego

diego / AnalyzeTwitterUser / 0.1.6

README.md

0. TL;DR

This is a recipe for Analyzing a Twitter User. It combines diego/GetUserTweetsnlp/SocialSentimentAnalysis, and nlp/LDA into a micro-service.

1. Introduction

Recipes are plug-n-play utilities that solve a specific problem in a novel way. These micro-services are comprised of one or more algorithms that allow users to quickly and easily get value from Algorithmia. They’re modular, and should be thought of as mini-products with obvious value.

This recipe is composed in the following way:

  1. The recipe is given a twitter user and retrieves relevant tweets from twitter using diego/GetUserTweets.
  2. These relevant tweets are analyzed, labelled and sorted by nlp/SocialSentimentAnalysis.
  3. The top 20% (positive) tweets and the bottom 20% (negative) tweets are used to extract positive and negative topics using nlp/LDA.
  4. The corresponding positive & negative topics as well as information about the user including followers and following.

Input:

  • (Required): The twitter user to analyze
  • (Required): Twitter API authentication keys

Output

  • user twitter name
  • number of followers
  • number of people following
  • A list of positive topics (nlp/LDA output)
  • A list of negative topics (nlp/LDA output)

2. Query

The query keyword/string: The keyword that you're searching for on Twitter. (key = "query")

Example of a query keyword/string:

{
    "query": "algorithmia"
}

3. Authentication

Twitter API authentication keys: The API keys that are necessary to access Twitter API service. You can get yours here(key = "auth")

{
    "auth": {
        "app_key": "xxxxxxx",
        "app_secret": "xxxxxxx",
        "oauth_token": "xxxxxxx",
        "oauth_token_secret": "xxxxxxx"
    }
}

3. Example

Example 1:

  • Parameter 1: A twitter username
  • Parameter 2: Twitter API authentication keys
{
    "query": "doppenhe",
    "auth": {
        "app_key": "xxxxxxx",
        "app_secret": "xxxxxxx",
        "oauth_token": "xxxxxxx",
        "oauth_token_secret": "xxxxxxx"
    }
}

4. Output

Example 1:


   "following":302,
   "is negative about":[ 
      { 
         "obfuscated":1,
         "algorithm":1,
         "terrorists":1,
         "humans":1,
         "aims":1,
         "computer":1,
         "identify":1,
         "time":2
      }      ...      { 
         "code":2,
         "machine-learning":1,
         "scala":2,
         "review":1,
         "wtf":1,
         "signs":1,
         "make":1,
         "died":1
      }
   ],
   "followers":1390,
   "screen_name":"doppenhe",
   "is positive about":[ 
      { 
         "binary":1,
         "algorithmia":4,
         "algorithm":2,
         "show":1,
         "support":1,
         "doppenhe":1,
         "advantage":1,
         "today":3
      }      ...
   ]
}