GithubHelp home page GithubHelp logo

imclab / transcribable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from propublica/transcribable

0.0 2.0 0.0 243 KB

Drop in crowdsourcing for your Rails app. Extracted from Free the Files.

License: MIT License

transcribable's Introduction

 _                                 _ _           _     _      
| |_ _ __ __ _ _ __  ___  ___ _ __(_) |__   __ _| |__ | | ___ 
| __| '__/ _` | '_ \/ __|/ __| '__| | '_ \ / _` | '_ \| |/ _ \
| |_| | | (_| | | | \__ \ (__| |  | | |_) | (_| | |_) | |  __/
 \__|_|  \__,_|_| |_|___/\___|_|  |_|_.__/ \__,_|_.__/|_|\___|
                                                              
         Drop in crowdsourcing for your Rails app.
                            -*-

During the 2012 election, ProPublica created an news application called Free the Files that crowdsourced political TV spending by asking users to transcribe certain data points from FCC filings. This Rails plugin extracts the "transcribable" bits from Free the Files so anyone can crowdsource data out of documents, as long as they're stored in DocumentCloud. This gem will handle building out the models, controllers and views you need, and it will also assign out documents and verify the data you get back.

To install, add

gem 'transcribable'

to your Gemfile. Then run:

bundle install

Transcribable will add a transcribable method your models. In your "master" table, (of items you'd like verified) specify which attributes you would like users to be able to transcribe, and define the one-to-many relationship like so:

class Filing < ActiveRecord::Base
  transcribable :buyer, :amount
  has_many :transcriptions
end

Make sure your master table also has url (string) and verified (boolean) columns.

If you'd like users to be able to transcribe a field, but don't want that field to be verified (for example, interesting notes), add, for example

skip_verification :notes, :related_url

to your master model.

Run the generator, which will create everything you need for transcriptions: a migration based on your master table's transcribable attributes, a transcription model, controller, views and routes.

rails g transcribable

Then run:

rake db:migrate

If you ever need to add more transcribable columns, just add them to your master table, add them to the transcribable call in your master model, and then rerun rails g transcribable. That will generate a new migration for adding the new columns to the transcriptions table.

To populate your master table with documents for users to verify, you can harvest them from a DocumentCloud project. Fill out the documentcloud.yml file that was generated for you in your config directory, and run:

rake transcribable:harvest

To start transcribing documents, boot up your app and navigate to http://localhost:3000/transcriptions/new. You should be given a random filing from your DocumentCloud harvest.

You can overwrite the assign! method -- the algorithm that chooses a filing for users to transcribe -- in your master table's model.

Note: By default, Transcribable keeps users from transcribing the same document more than once by assigning a UUID-based cookie. Obviously this isn't ideal for rigorous journalistic applications. You'll want to implement a real login system for complicated projects.

transcribable's People

Contributors

ashaw avatar kleinmatic avatar thejefflarson avatar

Watchers

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