用于在Python脚本中创建Mechanical Turk工作流的库。
turkflow的Python项目详细描述
TurkFlow
==
用于快速创建Mechanical Turk工作流的库。在某些方面,Turkflow最终意外地重新实现了[Turkit](http://dl.acm.org/citation.cfm?id=1866029.1866040&coll=dl&dl=guide&cfid=308021477&cftoken=94691217。
``turkflow``允许您在[jinja2]模板文件和python对象中指定任意html点击。它还提供了等待这些点击结果、检查“turkflow”以前创建的点击是否完成的功能并将结果解析为python结构。
是“turkflow”程序的最小示例:
``python
from turkflow.turkflow import*
from jinja2 import*
“模板”)
类test hit(turkhittype):
定义init(self):
turkhittype. “这是一个测试命中”,
字符串.拆分('keywords'),
描述='测试描述',
持续时间=600,
秒
最大赋值=50,
annotation='test',默认情况下,这将使turkflow查找“test.html”jinja2模板
reward=0.05,
env=env)
tc=TurkConnection(“turkflow戋test戋id”,“~/scratch”)
hit戋key=tc.createHIT(TestHIT())
results,completion戋times=tc.waitForHIT(hit戋keytimeout=30)30秒后停止轮询
```
在“templates”子目录中,我们包括Turkflow存储库和我们自己的HTML文件中包含的“base.html”``test.html`:
``html
{%扩展“base.html”%}
%block question\u content%}
<;p id="name_q">What is your name?</p>
<;!--Turk问题由“name”标识,以便您可以收集同一问题的多个响应-->;
<;input type=“text”name=“name_q”placeholder=“clara”>;
{%endblock%}
```
==
用于快速创建Mechanical Turk工作流的库。在某些方面,Turkflow最终意外地重新实现了[Turkit](http://dl.acm.org/citation.cfm?id=1866029.1866040&coll=dl&dl=guide&cfid=308021477&cftoken=94691217。
``turkflow``允许您在[jinja2]模板文件和python对象中指定任意html点击。它还提供了等待这些点击结果、检查“turkflow”以前创建的点击是否完成的功能并将结果解析为python结构。
是“turkflow”程序的最小示例:
``python
from turkflow.turkflow import*
from jinja2 import*
“模板”)
类test hit(turkhittype):
定义init(self):
turkhittype.
字符串.拆分('keywords'),
描述='测试描述',
持续时间=600,
秒
最大赋值=50,
annotation='test',默认情况下,这将使turkflow查找“test.html”jinja2模板
reward=0.05,
env=env)
hit戋key=tc.createHIT(TestHIT())
results,completion戋times=tc.waitForHIT(hit戋keytimeout=30)30秒后停止轮询
```
在“templates”子目录中,我们包括Turkflow存储库和我们自己的HTML文件中包含的“base.html”``test.html`:
``html
{%扩展“base.html”%}
%block question\u content%}
<;p id="name_q">What is your name?</p>
<;!--Turk问题由“name”标识,以便您可以收集同一问题的多个响应-->;
<;input type=“text”name=“name_q”placeholder=“clara”>;
{%endblock%}
```