Code Monkey home page Code Monkey logo

hansard's Introduction

hansard project

Build Status

I'm just starting out with an analysis of the UK Parlimentary Archive. The broad goals at the minute are to create language models from the speaches given by UK officials in the House of Commons and the House of Lords. I have many interestng questions to answer about this dataset, please take a look at the issues here to see some that are being investigated.

Getting the data

There are 2 ways to get the data

This project contains scripts to access both: A small bash file in the data folder can be used to automate downloading of XML files, and a scrapy project for scraping data from the API. use the command scrapy crawl comments -o comments.json to extract data from the API.

Analysis

Data analysis is prototyped using ipython notebooks. You can view them using the notebook viewer:

  1. Data Wrangling Obtaining data from the API, cleaning it and converting it to a useful datastructure.
  2. Generating model representations of the data The raw text is cleaned of punctuation and tokenised. Bag of Words and IF/IDF models are created.
  3. PCA and clustering of Speakers - do labeled groups cluster using PCA? i.e do speakers from the house of commons / lords cluster together? Do speakers from the different poitical parties cluster together?
  4. LDA Visualization of one parlimentary sitting.

Related Projects

development

this project is using python virtual environments to manage the dependancies locally instead of installing packages globaly on your system. to setup a new virtual environmant use

# initialise your virtual environment
$ pyvenv venv
# activate the virtual environment
source ./venv/bin/activate
# install openblas
sudo apt-get install gfortran libopenblas-dev liblapack-dev
# install the project dependancies
pip install -r requirements.txt

If scikit-learn install fails there may be trouble running with python 3. Follow these instrunctions for Ubuntu:

sudo apt-get install build-essential python3-dev python3-setuptools python3-numpy python3-scipy python3-pip libatlas-dev libatlas3gf-base
sudo pip3 install scikit-learn
sudo update-alternatives --set libblas.so.3 \
    /usr/lib/atlas-base/atlas/libblas.so.3
sudo update-alternatives --set liblapack.so.3 \
    /usr/lib/atlas-base/atlas/liblapack.so.3

Contributers

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.