Coder Social home page Coder Social logo

jaimehuang168 / sentiment-analysis-facebook-comments Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trunghieu-tran/sentiment-analysis-facebook-comments

0.0 0.0 0.0 7.3 MB

Detection and Prediction of Users Attitude Based on Real-Time and Batch Sentiment Analysis of Facebook Comments

Jupyter Notebook 99.50% Python 0.50%

sentiment-analysis-facebook-comments's Introduction

Sentiment Analysis of Facebook Comments

Program was written in Python version 3.x, uses Library NLTK.

The project contribute serveral functionalities as listed below:

  • Main.py - You can input any sentence, then program will use Library NLTK to analysis your sentence, and then it returns result that is how many percent of positive, negative or neutral.

  • facebookComments.py - This is a part which will show you a Dashboard, which describes temporal sentiment analysis of comments on a post on Facebook. Data is got once, and then it will be analyzed in a processing. You have to learn about Facebook Graph API and how it works. So, then paste your token and id of post in file "facebookComments.py", which you want to analysis sentiment of comments. Program will show you temporal sentiment analysis of comments.

  • facebook_real_time.py - Our Real-time stream processing automates getting data from Facebook server continually and then, we process data in small time period – near real time. For every processing, we use NLTK Library to analysis sentiment data. The results of data processing will be checked by predefined user’s conditions. If it satisfies conditions, the program will create an event to update Dashboard’s status. Beside, the program includes a procedure, which implements listening to any event. If a certain events exists, Dashboard will be updated.

  • A Method Automation Forecasting based on Cluster Profiles - For sentiment analysis of Facebook comment.ipynb - Perfomance method to prediction the trend of development of people's attitude on a post.

Architecture

Sentiment analysis sample:

alt text

Real time processing architecuture is described as below:

alt text

Realtime processing sample:

alt text

Prdection sentiment of comment sample:

alt text

Data Collection

Implementation of batch data processing makes sense in the case of high volumes data. Firstly, we chose a topic, which is popular recently. For each post, using Facebook Graph API, all comments have been collected during the first 30000 s. Data is stored in flat table format (e.g. CSV file) which is easy to save in distributed file system. The header of CSV file contains the following columns: [Datetime] [Topic] [Post] [Comment] [Positive] [Negative]. Link data

The topic was chosen is “United States presidential election 2016”, which is popular recently. Almost data will be received from two famous new channels : BBC news and CNN on Facebook.

Requirements

The project requires installed packages:

  • NLTK - Natural Language Toolkit is a leading platform for building Python programs to work with human language data
  • facebook-sdk - Python SDK for Facebook's Graph API
  • matplotlib - Matplotlib is a Python 2D plotting library
  • scikit-learn - Machine Learning library in Python
  • pandas - an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming

What is Sentiment Analysis?

Sentiment Analysis is the process of determining whether a piece of writing is positive, negative or neutral. It’s also known as opinion mining, deriving the opinion or attitude of a speaker. A common use case for this technology is to discover how people feel about a particular topic.

What is this NLTK?

  • NLTK - Natural Language Toolkit is a leading platform for building Python programs to work with human language data
  • Version: NLTK 3.1 released : October 2015
  • Link NLTK

What is Facebook Graph API?

Publication

This project is publised on the International Conference as below:

Tran H., Shcherbakov M. (2016) Detection and Prediction of Users Attitude Based on Real-Time and Batch Sentiment Analysis of Facebook Comments. In: Nguyen H., Snasel V. (eds) Computational Social Networks. CSoNet 2016. Lecture Notes in Computer Science, vol 9795. Springer, Cham (Link Paper 1) (Link Paper 2)

Contributors

sentiment-analysis-facebook-comments's People

Contributors

trunghieu-tran avatar

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.