Home

Awesome

šŸ„ Pollo: a tool for crowd-sourced polling

Pollo is repo is for AMT annotation tasks for computer vision purposes (e.g., qualitative user studies). The main idea for this repo is to specify a JSON file describing each HIT (Human Intelligence Task) which will then dynamically populate a website (via JavaScript) with the task. A notebook lets you create and manage your HITs.

Getting started

Install the repo as a package

pip install pollo

If you want the latest version, you can clone and install in editable mode.

git clone https://github.com/ethanweber/pollo.git
cd pollo
pip install -e .

Your first project

The quickest way to understand this code it to look at our example. Here are the steps!

  1. Start the server.

    cd example_project
    pollo-server
    
  2. Open the examples/image_project/requester.ipynb file and step through it.

Folder structure

Here is what a project folder structure looks like.

example-project/
ā”œā”€ā”€ data/
ā”‚   ā”œā”€ā”€ hits/
ā”‚   ā”‚   ā””ā”€ā”€ <hit_name>.json          # HIT (Human Intelligence Task) data
ā”‚   ā”œā”€ā”€ responses/
ā”‚   ā”‚   ā””ā”€ā”€ <hit_name>.json          # Responses to HITs
ā”‚   ā”œā”€ā”€ local_responses/
ā”‚   ā”‚   ā””ā”€ā”€ <hit_name>.json          # Local responses to HITs
ā”‚   ā””ā”€ā”€ media/                       # Media assets like images or videos
ā”‚       ā”œā”€ā”€ images/
ā”‚       ā””ā”€ā”€ videos/
ā”œā”€ā”€ requester.ipynb                  # Main notebook for HITs management
ā”œā”€ā”€ mturk_creds.json                 # AWS Mechanical Turk credentials
ā””ā”€ā”€ mturk_database.pkl               # Database for tracking HITs

Place MTurk credentials in a file named "mturk_creds.json". It should have the following content.

{
    "aws_access_key_id": "<aws_access_key_id>",
    "aws_secret_access_key": "<aws_secret_access_key>"
}

Server details

You need to host your server with an HTTPS domain to be compatible with AMT. Go to our reverse proxy docs for details on how to set this up. After this, you should be able to navigate to the following URLs.

# an interface to ask the hit questions
https://myurl.mydomain/hits-interface/<hit_name>

# an interface showing the responses to a hit
https://myurl.mydomain/responses-interface/<hit_name>

# an interface showing the local responses to a hit
https://myurl.mydomain/local_responses-interface/<hit_name>

# a file tree
https://myurl.mydomain/media/

Projects that used our code

Here are some projects that have used this code (or versions of it). The code presented in this repo is a general implementation for qualitative user studies. However, it was and can be modified for more specific use cases.