GithubHelp home page GithubHelp logo

anjali-chadha / hits-algorithm Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 3.0 5.51 MB

Implementation of Hyperlink-Induced Topic Search algorithms

License: MIT License

Jupyter Notebook 100.00%
hubs authorities page-ranking hits-algorithm tweets graph-algorithms twitter-api homework-assignments

hits-algorithm's Introduction

HITS-algorithm

Implementation of Hyperlink-Induced Topic Search algorithms.

Read more about this alogorithm here

A re-Tweet Graph

This project adapts the classic HITS approach to allow us to find not the most authoritative web pages, but rather to find significant Twitter users. So, instead of viewing the world as web pages with hyperlinks (where pages = nodes, hyperlinks = edges), we're going to construct a graph of Twitter users and their retweets of other Twitter users (so user = node, retweet of another user = edge). Over this Twitter-user graph, we can apply the HITS approach to order the users by their hub-ness and their authority-ness.

Here is a toy example. Suppose you are given the following four retweets:

  • userID: diane, text: "RT ", sourceID: bob
  • userID: charlie, text: "RT Welcome", sourceID: alice
  • userID: bob, text: "RT Hi ", sourceID: diane
  • userID: alice, text: "RT Howdy!", sourceID: parisa

There are four short tweets retweeted by four users. The retweet between users form a directed graph with five nodes and four edges. E.g., the "diane" node has a directed edge to the "bob" node.

This project builds a graph by parsing the tweets in the file provided called HITS.json.

Notes:.

  • The edges are weighted and directed. If Bob retweets Alice's tweets 10 times, there is an edge from Bob to Alice with weight 10, but there is not an edge from Alice to Bob.
  • If a user retweets herself, ignore it.
  • Correctly parsing screen_name in a tweet is error-prone. Use the id of the user (this is the user who is re-tweeting) and the id of the user in the retweeted_status field (this is the user who is being re-tweeted; that is, this user created the original tweet).

HITS Implementation

This program will return the top 10 users with highest hub and authority scores. The output is like:

Hub Scores

  • user1 - score1
  • user2 - score2
  • ...
  • user10 - score10

Authority Scores

  • user1 - score1
  • user2 - score2
  • ...
  • user10 - score10

hits-algorithm's People

Contributors

anjali-chadha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hits-algorithm's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.