{"id":13572597,"url":"https://github.com/danvk/localturk","last_synced_at":"2025-04-06T00:09:46.124Z","repository":{"id":7104766,"uuid":"8397330","full_name":"danvk/localturk","owner":"danvk","description":"Mechanical Turk on your own machine.","archived":false,"fork":false,"pushed_at":"2024-09-22T20:39:41.000Z","size":247,"stargazers_count":206,"open_issues_count":8,"forks_count":33,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-10-18T21:58:47.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danvk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-02-24T21:44:23.000Z","updated_at":"2024-09-22T20:39:41.000Z","dependencies_parsed_at":"2024-10-18T19:10:27.226Z","dependency_job_id":null,"html_url":"https://github.com/danvk/localturk","commit_stats":{"total_commits":38,"total_committers":2,"mean_commits":19.0,"dds":0.2894736842105263,"last_synced_commit":"a562f9bcd39893b97d4dc7826e7d0927257efa6b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danvk%2Flocalturk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danvk%2Flocalturk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danvk%2Flocalturk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danvk%2Flocalturk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danvk","download_url":"https://codeload.github.com/danvk/localturk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:27.902Z","updated_at":"2025-04-06T00:09:46.107Z","avatar_url":"https://github.com/danvk.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/danvk/localturk.svg?style=svg)](https://circleci.com/gh/danvk/localturk)\n\n# localturk\n\nLocal Turk implements Amazon's Mechanical Turk API on your own machine.\n\nIt's handy if you want to:\n\n1. Develop a Mechanical Turk template\n2. Do some repetitive tasks on your own, without involving Turkers.\n\nYou could use it, for instance, to generate test and training data for a Machine Learning algorithm.\n\n## Quick Start\n\nInstall:\n\n    npm install -g localturk\n\nRun:\n\n    cd localturk/sample\n    localturk transcribe.html tasks.csv outputs.csv\n\nThen visit http://localhost:4321/ to start Turking.\n\n## Templates and Tasks\n\nUsing Local Turk is just like using Amazon's Mechanical Turk. You create:\n\n1. An HTML template file with a \u0026lt;form\u0026gt;\n2. A CSV file of tasks\n\nFor example, say you wanted to record whether some images contained a red ball. You would make a CSV file containing the URLs for each image:\n\n    image_url\n    http://example.com/image_with_red_ball.png\n    http://example.com/image_without_red_ball.png\n\nThen you'd make an HTML template for the task:\n\n```html\n\u003cimg src=\"${image_url}\" /\u003e\n\u003cinput type=radio name=has_button value=\"yes\" /\u003e Has a red ball\u003cbr/\u003e\n\u003cinput type=radio name=has_button value=\"no\" /\u003e Does not have a red ball\u003cbr/\u003e\n```\n\nFinally, you'd start up the Local Turk server:\n\n    $ localturk path/to/template.html path/to/tasks.csv path/to/output.csv\n\nNow you can visit http://localhost:4321/ to complete each task. When you're done, the output.csv file will contain\n\n    image_url,has_button\n    http://example.com/image_with_red_ball.png,yes\n    http://example.com/image_without_red_ball.png,no\n\n## Image Classification\n\nThe use case described above (classifying images) is an extremely common one.\n\nTo expedite this, localturk provides a separate script for doing image\nclassification. The example above could be written as:\n\n    classify-images --labels 'Has a red ball,Does not have a red ball' *.png\n\nThis will bring up a web server with a UI for assigning one of those two labels\nto each image on your local file system. The results will go in `output.csv`.\n\nAlternatively, you can also pass in a text file containing the paths to images.\nIn this case, the images can be URLs, rather than paths to local files.\n\nFor more details, run `classify-images --help`.\n\n## Tips \u0026 Tricks\n\nIt can be hard to remember the exact format for template files. localturk can help! Run it with\nthe `--write-template` argument to generate a template file for your input that you can edit:\n\n    localturk --write-template tasks.csv \u003e template.html\n\nWhen you're going through many tasks, keyboard shortcuts can speed things up tremendously.\nlocalturk supports these via the `data-key` attribute on form elements. For example, make yourer\nsubmit button look like this:\n\n    \u003cinput type=\"submit\" name=\"result\" value=\"Good\" data-key=\"d\"\u003e\n\nNow, when you press `d`, it'll automatically click the \"Good\" button for you. _Note that this\nfeature is not available on mechanical turk itself!_\n\nIf you'd like to reference sensitive data that you'd prefer not to commit to your repo\n(an API key, say), you can pass it via a command-line parameter:\n\n    localturk --var API_KEY=123456abcd\n\nThen you can reference this as `${API_KEY}` in your template file.\n\n## Development\n\nTo make changes to localturk, clone it and set it up using `yarn`:\n\n    yarn\n\nYou can run `localturk.ts` or `classify-images.ts` directly using `ts-node`:\n\n    ts-node localturk.ts path/to/template.html path/to/tasks.csv path/to/output.csv\n\nTo type check and run the tests:\n\n    yarn tsc\n    yarn test\n\nTo publish a new version on npm, run:\n\n    yarn tsc\n    yarn publish\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanvk%2Flocalturk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanvk%2Flocalturk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanvk%2Flocalturk/lists"}