Coder Social home page Coder Social logo

climate_change_sentiment's Introduction

Climate Change Sentiment Analysis

This repository was created as a companion to this article.

Obtaining the Data

The data folder contains labelled tweets based on their sentiment towards climate change:

  • 2 - the tweet links to factual news about climate change
  • 1 - the tweet supports the belief of man-made climate change
  • 0 - the tweet neither supports nor refutes the belief of man-made climate change
  • -1 - the tweet does believe in man-made climate change

The Tweepy folder contains a script which can be used to obtain these tweets. Human labour will be needed to label them. To use the script, specify keywords in my_queries.txt (each keyword is separated by newline). Only tweets containing those keywords will be pulled.

Then run in the directory the repo is cloned to: cd data && python twitter_query.py

Building the Model

Download the pre-trained embedding vectors from the Stanford GloVe page and extract it to the repo directory.

wget http://nlp.stanford.edu/data/glove.twitter.27B.zip && unzip glove.twitter.27B.zip

Run the model.py script in a terminal which will train the model, output its weights and also test it against the testing set.

The weights of a trained model is stored in the weights folder.

climate_change_sentiment's People

Contributors

edwardcqian 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.