Giter VIP home page Giter VIP logo

twfy-converter's Introduction

twfy-converter

Description

A Python data wrangler that converts raw XML data into a JSON format, ready for data preprocessing. The raw XML data files containing division data are merged into an intermediate file. These files are then iterated through, in a process that assigns vote labels to speech tags by matching MP 'person-id' attributes. The labelled speech tags are then extracted and written to a separate JSON file format.

The raw XML data files presented a number of challenges:

  • The metadata needed to be understood in order to correctly extract the desired data
  • Not all speech content corresponded to a division vote
    • Without a division vote, it wasn't possible to label the relevant speech content. The decision was therefore made to filter out this speech content during preprocessing.
  • Circa 2015, the attributes used to identify MPs ("id") and speakers ("speakerid") was standardised into the uniform "person_id"
    • It was therefore necessary to rename any instances of MP "id" or speaker "speakerid" prior to 2015 so that all speech content attributes are consistent.

Usage

Run the application. The constants at the top of the page point to the relevant dataset filepaths - these can be changed if necessary.

Roadmap

Ideally, in the interest of saving time, this application would skip steps if no further changes need to be made to specific files, i.e. skipping the intermediate merged file stage if these files already exist.

Due to the numerous stages of preprocessing and the time it takes to run the program, terminal loading bars (using the progress package) might provide a clearer visual cue of the preprocessing progress.

twfy-converter's People

Watchers

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