Commit 3f90d492 authored by Sacha's avatar Sacha
Browse files

see diff

parent 575a40ee
0. fetch article URLs and tweets by keyword from mturk_loader.py
1. fetch each article result if not already saved (matching URL)
2. store article for each keyword with URL and keyword
1. fetch article URLs and tweets by keyword from ``highlighting_loader.py''
2. fetch each article result if not already saved (matching URL)
3. store article for each keyword with URL and keyword
......@@ -5,11 +5,8 @@ import os
import itertools
from error import UsageError
import sys
import twilio
from twilio.rest import TwilioRestClient
from flask import jsonify
from error import UsageError
from config import ADMIN_PHONE, TWILIO_SID, TWILIO_AUTH_TOKEN
# source of terms --> http://arxiv.org/pdf/1409.8152v1.pdf
......@@ -17,12 +14,6 @@ TT_DIR = 'training_terms'
HELP_STR = 'options:\n\t``test`` <-- uses small subset of training terms \n\t\t\tfor testing highlighting\n\t```` <-- (no options) loads all training keywords\n\t``help`` or ``--help`` <-- displays this message\n'
def sms_admin(m):
client = TwilioRestClient(TWILIO_SID, TWILIO_AUTH_TOKEN)
client.messages.create(body=m,
to=ADMIN_PHONE,
from_='+19085437718')
def get_file(name):
with open(name, 'r') as f:
data = f.readlines()
......@@ -76,9 +67,6 @@ if __name__ == '__main__':
update_progress(n_done, n_tasks)
break
print('\t... done')
summary = 'summary: %s doc(s) ready for training from %s terms (%s skipped)' % (n_docs, n_tasks, n_dup_keywords)
sms_admin('highlighting_loader finished. %s' % summary)
print('\t ...' % summary)
......@@ -20,6 +20,12 @@ body {
text-decoration: none;
border: none;
}
span.q:before {
content: '\2018';
}
span.q:after {
content: '\2019';
}
input, .sans {
font-family: $sans_serif;
}
......
This diff is collapsed.
This diff is collapsed.
html,ul,body,header,input,span,form{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-text-size-adjust:100%}body{font-family:"Libre Baskerville","Palatino","Garamond",serif;font-variant-numeric:slashed-zero;text-rendering:optimizeLegibility;font-size:.9em;word-wrap:break-word}.logo,h1,h2,h3,h4,h5{font-family:"Linux Biolinum","Zapf Humanist 601","Optima","Nunito Sans",sans-serif}.collective_logo{padding:2px;font-weight:bold}.collective_logo:hover{color:#fff;background:#ed0000;text-decoration:none;border:none}input,.sans{font-family:"Nunito Sans","Calibri",sans-serif}.logo,h1,h2,h3,h4,h5{font-weight:700 !important}h1,h2,h3,h4,h5{text-transform:uppercase}h1{font-size:130%}h2{font-size:110%}h3{font-size:90%}h4{font-size:75%}h5{font-size:60%}input{outline:0;box-shadow:none;-webkit-tap-highlight-color:transparent}img{max-width:100%;height:auto;margin:auto}a{-webkit-tap-highlight-color:transparent;text-decoration:none;color:inherit;border-bottom:1px dotted;line-height:130%;word-wrap:break-word}a:hover,a:active{color:#ed0000;border-bottom:1px solid;text-decoration:none}input.field{padding:6px 12px;color:#555;border-bottom:1px dashed #d9d9d9;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;border-radius:1px;margin:0 auto;margin-bottom:5px;height:20px;width:70%;text-align:center}input[type=submit],a.btn{cursor:pointer;min-width:100px;height:40px;color:#333;padding:4px;outline:0;border-radius:0;-webkit-appearance:none;-webkit-transition:all .15s ease-in-out 0s;-moz-transition:all .15s ease-in-out 0s;-ms-transition:all .15s ease-in-out 0s;transition:all .15s ease-in-out 0s;background-color:#e9e9e9;border:1px solid #c3c3c3}input[type=submit]:hover,input[type=submit]:focus,input[type=submit]:active,a.btn:hover,a.btn:focus,a.btn:active{border-color:#a3a3a3}input[type=submit]:focus,input[type=submit]:active,a.btn:focus,a.btn:active{outline:0}input[type=submit]:active,a.btn:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}input[type=submit].small,a.btn.small{height:auto}a.btn{padding:1px 5px;font-size:.75em;background:#fff;border-radius:2px;vertical-align:middle}input::-moz-focus-inner{border:0}footer{margin:5em 0 .5em 0;width:95%;color:#b0b0b0;font-size:12px;text-align:center}footer p{padding-top:10px;line-height:150%}div#message,div#error{position:fixed;line-height:1.3;font-size:90%;overflow:hidden;padding:3px;top:0;background-color:#a3a3a3;color:#fff;text-align:center;width:100%}div#message a,div#error a{color:#fff}div#error{background-color:#edb43a}.ns{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}::selection{background:#fff49b}::-moz-selection{background:#fff49b}@media(min-width: 700px){.mobile{display:none}}@media(max-width: 700px){.desktop{display:none}}@media(max-width: 400px){div#error,div#message{font-size:smaller;opacity:.9}}ul#tweets,ul#articles{list-style:none}ul#tweets li,ul#articles li{page-break-inside:avoid;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;break-inside:avoid-column}ul#tweets li div.tweet,ul#articles li div.article{background-color:#fff;border:2px solid #efefef;font-size:14px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}ul#articles{-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-webkit-column-width:350px;-moz-column-width:350px;column-width:350px}ul#articles li{width:100%;margin-bottom:2em}ul#articles li div.article p{padding:5px}ul#articles li div.article a.title{padding:3px 5px 5px 5px;margin-top:5px;margin-bottom:2px;font-size:28px;display:block;border-bottom:none}ul#articles li div.article a.title:hover{color:#000}ul#articles li div.article p.url{margin:0;padding:0;border-top:1px solid #ddd;font-style:italic;text-align:right;background:#eee}ul#articles li div.article p.url a{padding:5px 0;width:100%;display:block;border-bottom:none}ul#articles li div.article p.url a:after{padding-right:5px;content:"read →"}ul#articles li div.article img{width:100%}ul#tweets{margin-top:2em;-webkit-column-width:150px;-moz-column-width:150px;column-width:150px;-webkit-column-gap:5px;-moz-column-gap:5px;column-gap:5px}ul#tweets li{width:100%;margin-bottom:5px}ul#tweets li div.tweet{padding:2px;overflow:hidden}ul#tweets li div.tweet a{color:inherit;text-decoration:none}ul#tweets li div.mad{border:2px solid #f90101}ul#tweets li div.happy{border:2px solid #00933b}footer{display:none}header{z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;cursor:default;width:100%;height:55px;line-height:55px;background:#fff;border-bottom:1px solid #efefef;position:fixed}header a{-webkit-touch-callout:none}header > div{padding:0 15px 0 5px;display:inline}header > div a:not(.sans){font-size:12px}header > div > a.mini{display:none}header > div h1{text-align:left;display:inline;font-size:1.2em}header > div span#subtitle{color:#888;padding-left:5px;font-size:smaller;font-style:italic}header > div .sans{font-size:14px}header > div span#right-header{font-size:12px;float:right;padding-right:10px}header > div span#article_title{font-style:italic}header > div form{display:inline}header > div > form input{padding:6px 12px;line-height:1.5;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border-bottom:1px solid #d9d9d9;margin:0 auto;height:20px;width:30%}header input[type=text].top_loading{background:url("../img/loading.gif") no-repeat;background-position:98% 50%;background-size:20px 20px}header#sub{height:25px;line-height:25px;overflow:auto;white-space:nowrap;overflow-y:hidden;position:fixed;top:56px;min-width:100%;text-align:center;font-size:12px;font-style:italic;border-bottom:1px dashed #efefef;color:#888}main{padding:4em 1em}main input.loading{background:url("../img/loading.gif") no-repeat;background-size:20px 20px;padding:10px 10px 10px 36px;background-position:10% 50%}main > form{margin-bottom:10px;text-align:center}main > form input[type=text]{margin-bottom:10px;width:275px;border-bottom:1px solid #d9d9d9}main div.featured_keywords{display:table;padding-bottom:1em;margin:0 auto}main div.featured_keywords dl.left{float:left;width:50%}main div.featured_keywords dl.right{float:right;width:50%}main div.featured_keywords dt{float:left;width:7.5em;padding:1ex .5em 0 .5em;text-align:right;font-weight:bold}main div.featured_keywords dd{margin:0 0 0 8.5em;padding:1ex .5em;text-align:left;border-left:1px solid #888}main div.featured_keywords dd span{white-space:nowrap}main ul.details{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;list-style:none;margin:0 0 10px 0;padding:0}main ul.details li{display:inline}main ul.details li > span{line-height:30px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border:1px solid #d9d9d9;padding:2px}main article{text-align:justify;line-height:150%}main article a:hover,main article a:active,main article a{border-bottom:none;color:#fff;background-color:#d53f3f}main article a{text-decoration:none;font-weight:700}main article a:hover,main article a:active{background-color:#bf3636}main article + p{-webkit-transition:all .3s ease-in-out 0s;-moz-transition:all .3s ease-in-out 0s;-ms-transition:all .3s ease-in-out 0s;transition:all .3s ease-in-out 0s;opacity:.6}main article + p img{width:20px;vertical-align:bottom}main article + p:hover{opacity:1}main mark{line-height:25px;color:#ed0000;background:#ffecec;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;padding:2px}main .disabled{cursor:not-allowed;background-color:#f9f9f9}main .disabled:active{color:#fff;background-color:#edb43a}span.danger{color:#fff;background-color:#d43f3a;padding:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}figcaption{margin:10px 0 10px 0}@media(max-width: 700px){header#sub{font-size:10px;top:41px}header{height:40px;line-height:40px}header h1{font-size:.7em}}@media(max-width: 620px){main div.featured_keywords dt{writing-mode:vertical-rl}}@media(max-width: 520px){main div.featured_keywords dl.left,main div.featured_keywords dl.right{float:none}span.danger{display:block}input[type=text].top_loading{height:40px}}@media(max-width: 415px){header > div > a.mini{display:inline}header > div > a.lg{display:none}}/*# sourceMappingURL=home.css.map */
html,ul,body,header,input,span,form{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-text-size-adjust:100%}body{font-family:"Libre Baskerville","Palatino","Garamond",serif;font-variant-numeric:slashed-zero;text-rendering:optimizeLegibility;font-size:.9em;word-wrap:break-word}.logo,h1,h2,h3,h4,h5{font-family:"Linux Biolinum","Zapf Humanist 601","Optima","Nunito Sans",sans-serif}.collective_logo{padding:2px;font-weight:bold}.collective_logo:hover{color:#fff;background:#ed0000;text-decoration:none;border:none}span.q:before{content:"‘"}span.q:after{content:"’"}input,.sans{font-family:"Nunito Sans","Calibri",sans-serif}.logo,h1,h2,h3,h4,h5{font-weight:700 !important}h1,h2,h3,h4,h5{text-transform:uppercase}h1{font-size:130%}h2{font-size:110%}h3{font-size:90%}h4{font-size:75%}h5{font-size:60%}input{outline:0;box-shadow:none;-webkit-tap-highlight-color:transparent}img{max-width:100%;height:auto;margin:auto}a{-webkit-tap-highlight-color:transparent;text-decoration:none;color:inherit;border-bottom:1px dotted;line-height:130%;word-wrap:break-word}a:hover,a:active{color:#ed0000;border-bottom:1px solid;text-decoration:none}input.field{padding:6px 12px;color:#555;border-bottom:1px dashed #d9d9d9;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;border-radius:1px;margin:0 auto;margin-bottom:5px;height:20px;width:70%;text-align:center}input[type=submit],a.btn{cursor:pointer;min-width:100px;height:40px;color:#333;padding:4px;outline:0;border-radius:0;-webkit-appearance:none;-webkit-transition:all .15s ease-in-out 0s;-moz-transition:all .15s ease-in-out 0s;-ms-transition:all .15s ease-in-out 0s;transition:all .15s ease-in-out 0s;background-color:#e9e9e9;border:1px solid #c3c3c3}input[type=submit]:hover,input[type=submit]:focus,input[type=submit]:active,a.btn:hover,a.btn:focus,a.btn:active{border-color:#a3a3a3}input[type=submit]:focus,input[type=submit]:active,a.btn:focus,a.btn:active{outline:0}input[type=submit]:active,a.btn:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}input[type=submit].small,a.btn.small{height:auto}a.btn{padding:1px 5px;font-size:.75em;background:#fff;border-radius:2px;vertical-align:middle}input::-moz-focus-inner{border:0}footer{margin:5em 0 .5em 0;width:95%;color:#b0b0b0;font-size:12px;text-align:center}footer p{padding-top:10px;line-height:150%}div#message,div#error{position:fixed;line-height:1.3;font-size:90%;overflow:hidden;padding:3px;top:0;background-color:#a3a3a3;color:#fff;text-align:center;width:100%}div#message a,div#error a{color:#fff}div#error{background-color:#edb43a}.ns{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}::selection{background:#fff49b}::-moz-selection{background:#fff49b}@media(min-width: 700px){.mobile{display:none}}@media(max-width: 700px){.desktop{display:none}}@media(max-width: 400px){div#error,div#message{font-size:smaller;opacity:.9}}ul#tweets,ul#articles{list-style:none}ul#tweets li,ul#articles li{page-break-inside:avoid;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;break-inside:avoid-column}ul#tweets li div.tweet,ul#articles li div.article{background-color:#fff;border:2px solid #efefef;font-size:14px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}ul#articles{-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-webkit-column-width:350px;-moz-column-width:350px;column-width:350px}ul#articles li{width:100%;margin-bottom:2em}ul#articles li div.article p{padding:5px}ul#articles li div.article a.title{padding:3px 5px 5px 5px;margin-top:5px;margin-bottom:2px;font-size:28px;display:block;border-bottom:none}ul#articles li div.article a.title:hover{color:#000}ul#articles li div.article p.url{margin:0;padding:0;border-top:1px solid #ddd;font-style:italic;text-align:right;background:#eee}ul#articles li div.article p.url a{padding:5px 0;width:100%;display:block;border-bottom:none}ul#articles li div.article p.url a:after{padding-right:5px;content:"read →"}ul#articles li div.article img{width:100%}ul#tweets{margin-top:2em;-webkit-column-width:150px;-moz-column-width:150px;column-width:150px;-webkit-column-gap:5px;-moz-column-gap:5px;column-gap:5px}ul#tweets li{width:100%;margin-bottom:5px}ul#tweets li div.tweet{padding:2px;overflow:hidden}ul#tweets li div.tweet a{color:inherit;text-decoration:none}ul#tweets li div.mad{border:2px solid #f90101}ul#tweets li div.happy{border:2px solid #00933b}footer{display:none}header{z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;cursor:default;width:100%;height:55px;line-height:55px;background:#fff;border-bottom:1px solid #efefef;position:fixed}header a{-webkit-touch-callout:none}header > div{padding:0 15px 0 5px;display:inline}header > div a:not(.sans){font-size:12px}header > div > a.mini{display:none}header > div h1{text-align:left;display:inline;font-size:1.2em}header > div span#subtitle{color:#888;padding-left:5px;font-size:smaller;font-style:italic}header > div .sans{font-size:14px}header > div span#right-header{font-size:12px;float:right;padding-right:10px}header > div span#article_title{font-style:italic}header > div form{display:inline}header > div > form input{padding:6px 12px;line-height:1.5;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border-bottom:1px solid #d9d9d9;margin:0 auto;height:20px;width:30%}header input[type=text].top_loading{background:url("../img/loading.gif") no-repeat;background-position:98% 50%;background-size:20px 20px}header#sub{height:25px;line-height:25px;overflow:auto;white-space:nowrap;overflow-y:hidden;position:fixed;top:56px;min-width:100%;text-align:center;font-size:12px;font-style:italic;border-bottom:1px dashed #efefef;color:#888}main{padding:4em 1em}main input.loading{background:url("../img/loading.gif") no-repeat;background-size:20px 20px;padding:10px 10px 10px 36px;background-position:10% 50%}main > form{margin-bottom:10px;text-align:center}main > form input[type=text]{margin-bottom:10px;width:275px;border-bottom:1px solid #d9d9d9}main div.featured_keywords{display:table;padding-bottom:1em;margin:0 auto}main div.featured_keywords dl.left{float:left;width:50%}main div.featured_keywords dl.right{float:right;width:50%}main div.featured_keywords dt{float:left;width:7.5em;padding:1ex .5em 0 .5em;text-align:right;font-weight:bold}main div.featured_keywords dd{margin:0 0 0 8.5em;padding:1ex .5em;text-align:left;border-left:1px solid #888}main div.featured_keywords dd span{white-space:nowrap}main ul.details{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;-ms-column-break-inside:avoid;column-break-inside:avoid;list-style:none;margin:0 0 10px 0;padding:0}main ul.details li{display:inline}main ul.details li > span{line-height:30px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;border:1px solid #d9d9d9;padding:2px}main article{text-align:justify;line-height:150%}main article a:hover,main article a:active,main article a{border-bottom:none;color:#fff;background-color:#d53f3f}main article a{text-decoration:none;font-weight:700}main article a:hover,main article a:active{background-color:#bf3636}main article + p{-webkit-transition:all .3s ease-in-out 0s;-moz-transition:all .3s ease-in-out 0s;-ms-transition:all .3s ease-in-out 0s;transition:all .3s ease-in-out 0s;opacity:.6}main article + p img{width:20px;vertical-align:bottom}main article + p:hover{opacity:1}main mark{line-height:25px;color:#ed0000;background:#ffecec;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;padding:2px}main .disabled{cursor:not-allowed;background-color:#f9f9f9}main .disabled:active{color:#fff;background-color:#edb43a}span.danger{color:#fff;background-color:#d43f3a;padding:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px}figcaption{margin:10px 0 10px 0}@media(max-width: 700px){header#sub{font-size:10px;top:41px}header{height:40px;line-height:40px}header h1{font-size:.7em}}@media(max-width: 620px){main div.featured_keywords dt{writing-mode:vertical-rl}}@media(max-width: 520px){main div.featured_keywords dl.left,main div.featured_keywords dl.right{float:none}span.danger{display:block}input[type=text].top_loading{height:40px}}@media(max-width: 415px){header > div > a.mini{display:inline}header > div > a.lg{display:none}}/*# sourceMappingURL=home.css.map */
html,ul,body,header,input,span,form{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-text-size-adjust:100%}body{font-family:"Libre Baskerville","Palatino","Garamond",serif;font-variant-numeric:slashed-zero;text-rendering:optimizeLegibility;font-size:.9em;word-wrap:break-word}.logo,h1,h2,h3,h4,h5{font-family:"Linux Biolinum","Zapf Humanist 601","Optima","Nunito Sans",sans-serif}.collective_logo{padding:2px;font-weight:bold}.collective_logo:hover{color:#fff;background:#ed0000;text-decoration:none;border:none}input,.sans{font-family:"Nunito Sans","Calibri",sans-serif}.logo,h1,h2,h3,h4,h5{font-weight:700 !important}h1,h2,h3,h4,h5{text-transform:uppercase}h1{font-size:130%}h2{font-size:110%}h3{font-size:90%}h4{font-size:75%}h5{font-size:60%}input{outline:0;box-shadow:none;-webkit-tap-highlight-color:transparent}img{max-width:100%;height:auto;margin:auto}a{-webkit-tap-highlight-color:transparent;text-decoration:none;color:inherit;border-bottom:1px dotted;line-height:130%;word-wrap:break-word}a:hover,a:active{color:#ed0000;border-bottom:1px solid;text-decoration:none}input.field{padding:6px 12px;color:#555;border-bottom:1px dashed #d9d9d9;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;border-radius:1px;margin:0 auto;margin-bottom:5px;height:20px;width:70%;text-align:center}input[type=submit],a.btn{cursor:pointer;min-width:100px;height:40px;color:#333;padding:4px;outline:0;border-radius:0;-webkit-appearance:none;-webkit-transition:all .15s ease-in-out 0s;-moz-transition:all .15s ease-in-out 0s;-ms-transition:all .15s ease-in-out 0s;transition:all .15s ease-in-out 0s;background-color:#e9e9e9;border:1px solid #c3c3c3}input[type=submit]:hover,input[type=submit]:focus,input[type=submit]:active,a.btn:hover,a.btn:focus,a.btn:active{border-color:#a3a3a3}input[type=submit]:focus,input[type=submit]:active,a.btn:focus,a.btn:active{outline:0}input[type=submit]:active,a.btn:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}input[type=submit].small,a.btn.small{height:auto}a.btn{padding:1px 5px;font-size:.75em;background:#fff;border-radius:2px;vertical-align:middle}input::-moz-focus-inner{border:0}footer{margin:5em 0 .5em 0;width:95%;color:#b0b0b0;font-size:12px;text-align:center}footer p{padding-top:10px;line-height:150%}div#message,div#error{position:fixed;line-height:1.3;font-size:90%;overflow:hidden;padding:3px;top:0;background-color:#a3a3a3;color:#fff;text-align:center;width:100%}div#message a,div#error a{color:#fff}div#error{background-color:#edb43a}.ns{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}::selection{background:#fff49b}::-moz-selection{background:#fff49b}@media(min-width: 700px){.mobile{display:none}}@media(max-width: 700px){.desktop{display:none}}@media(max-width: 400px){div#error,div#message{font-size:smaller;opacity:.9}}div.login_alert{position:fixed;bottom:.5em;right:.5em;min-width:90px;max-width:315px;padding:1em 1.25em;background:#fff;border:1px solid #e7e7e5;font-size:.75rem;line-height:1.5;z-index:2}div.login_alert span.close,div.login_alert div.close{-webkit-tap-highlight-color:transparent;cursor:pointer;position:absolute;top:0;right:0;padding:.5em .75em;line-height:1;font-size:1.25rem;text-align:center}div.login_alert div.body{margin-top:.5em}div.login_alert div.title{font-weight:bold}div.login_alert.dangerous{color:#fff;background:#ed0000}html{border-top:3px solid #ed0000}body{line-height:1.4}div#login{border-radius:4px;border:1px solid #ccc;padding:1px 5px 20px 5px;text-align:center;box-shadow:0 1px 5px 3px #eee;width:450px;margin:3em auto 0 auto}div#login form{margin-top:10px}div#login center{margin-top:1em}div#login div.g-recaptcha{display:table;margin:0 auto}div#login h1{font-weight:400 !important;text-transform:none;margin:20px 0 5px 0}div#login h1 b{text-transform:uppercase}div#login input.field{color:#000;transition:border .15s ease-in-out}div#login input.field:focus,div#login input.field:active{border-color:#666}@media(max-width: 520px){div#login{width:350px}div#login input[type=submit]{height:35px}footer,div#login{font-size:smaller}footer tt{font-size:12px}}@media(max-width: 390px){div#login{width:320px;margin-top:2em}}@media(max-width: 320px){div#login{width:290px;margin:1em auto}html,body{margin:0}}/*# sourceMappingURL=login.css.map */
html,ul,body,header,input,span,form{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-text-size-adjust:100%}body{font-family:"Libre Baskerville","Palatino","Garamond",serif;font-variant-numeric:slashed-zero;text-rendering:optimizeLegibility;font-size:.9em;word-wrap:break-word}.logo,h1,h2,h3,h4,h5{font-family:"Linux Biolinum","Zapf Humanist 601","Optima","Nunito Sans",sans-serif}.collective_logo{padding:2px;font-weight:bold}.collective_logo:hover{color:#fff;background:#ed0000;text-decoration:none;border:none}span.q:before{content:"‘"}span.q:after{content:"’"}input,.sans{font-family:"Nunito Sans","Calibri",sans-serif}.logo,h1,h2,h3,h4,h5{font-weight:700 !important}h1,h2,h3,h4,h5{text-transform:uppercase}h1{font-size:130%}h2{font-size:110%}h3{font-size:90%}h4{font-size:75%}h5{font-size:60%}input{outline:0;box-shadow:none;-webkit-tap-highlight-color:transparent}img{max-width:100%;height:auto;margin:auto}a{-webkit-tap-highlight-color:transparent;text-decoration:none;color:inherit;border-bottom:1px dotted;line-height:130%;word-wrap:break-word}a:hover,a:active{color:#ed0000;border-bottom:1px solid;text-decoration:none}input.field{padding:6px 12px;color:#555;border-bottom:1px dashed #d9d9d9;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;border-radius:1px;margin:0 auto;margin-bottom:5px;height:20px;width:70%;text-align:center}input[type=submit],a.btn{cursor:pointer;min-width:100px;height:40px;color:#333;padding:4px;outline:0;border-radius:0;-webkit-appearance:none;-webkit-transition:all .15s ease-in-out 0s;-moz-transition:all .15s ease-in-out 0s;-ms-transition:all .15s ease-in-out 0s;transition:all .15s ease-in-out 0s;background-color:#e9e9e9;border:1px solid #c3c3c3}input[type=submit]:hover,input[type=submit]:focus,input[type=submit]:active,a.btn:hover,a.btn:focus,a.btn:active{border-color:#a3a3a3}input[type=submit]:focus,input[type=submit]:active,a.btn:focus,a.btn:active{outline:0}input[type=submit]:active,a.btn:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}input[type=submit].small,a.btn.small{height:auto}a.btn{padding:1px 5px;font-size:.75em;background:#fff;border-radius:2px;vertical-align:middle}input::-moz-focus-inner{border:0}footer{margin:5em 0 .5em 0;width:95%;color:#b0b0b0;font-size:12px;text-align:center}footer p{padding-top:10px;line-height:150%}div#message,div#error{position:fixed;line-height:1.3;font-size:90%;overflow:hidden;padding:3px;top:0;background-color:#a3a3a3;color:#fff;text-align:center;width:100%}div#message a,div#error a{color:#fff}div#error{background-color:#edb43a}.ns{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}::selection{background:#fff49b}::-moz-selection{background:#fff49b}@media(min-width: 700px){.mobile{display:none}}@media(max-width: 700px){.desktop{display:none}}@media(max-width: 400px){div#error,div#message{font-size:smaller;opacity:.9}}div.login_alert{position:fixed;bottom:.5em;right:.5em;min-width:90px;max-width:315px;padding:1em 1.25em;background:#fff;border:1px solid #e7e7e5;font-size:.75rem;line-height:1.5;z-index:2}div.login_alert span.close,div.login_alert div.close{-webkit-tap-highlight-color:transparent;cursor:pointer;position:absolute;top:0;right:0;padding:.5em .75em;line-height:1;font-size:1.25rem;text-align:center}div.login_alert div.body{margin-top:.5em}div.login_alert div.title{font-weight:bold}div.login_alert.dangerous{color:#fff;background:#ed0000}html{border-top:3px solid #ed0000}body{line-height:1.4}div#login{border-radius:4px;border:1px solid #ccc;padding:1px 5px 20px 5px;text-align:center;box-shadow:0 1px 5px 3px #eee;width:450px;margin:3em auto 0 auto}div#login form{margin-top:10px}div#login center{margin-top:1em}div#login div.g-recaptcha{display:table;margin:0 auto}div#login h1{font-weight:400 !important;text-transform:none;margin:20px 0 5px 0}div#login h1 b{text-transform:uppercase}div#login input.field{color:#000;transition:border .15s ease-in-out}div#login input.field:focus,div#login input.field:active{border-color:#666}div#login div.warning_box{background:#ffd2da;padding:3px}@media(max-width: 520px){div#login{width:350px}div#login input[type=submit]{height:35px}footer,div#login{font-size:smaller}footer tt{font-size:12px}}@media(max-width: 390px){div#login{width:320px;margin-top:2em}}@media(max-width: 320px){div#login{width:290px;margin:1em auto}html,body{margin:0}}/*# sourceMappingURL=login.css.map */
......@@ -39,6 +39,10 @@ div#login {
border-color: #666;
}
}
div.warning_box {
background: #ffd2da;
padding: 3px;
}
}
@media (max-width: 520px) {
div#login {
......
@import'bootstrap.min.css';body{font-family:"Verdana",sans-serif;border-top:10px solid #d9d9d9;padding-top:10px}blockquote{font-size:16px}blockquote.good{background-color:#dff0d8;border-left:5px solid #3c763d}blockquote.bad{background-color:#f2dede;border-left:5px solid #a94442}.col-md-3{color:#ddd;background-color:rgba(245,245,245,.3)}div#full_article{font-size:16px}div#full_article span{cursor:pointer}div#full_article span.controversial{color:#bada55;background-color:#800}#copyright{margin-bottom:14em}.btn{font-weight:700}#full_article{text-align:justify}#bot_bar{position:fixed;z-index:1;bottom:0}#bot_bar .col-md-12{padding:8px;background-color:#eee;margin-top:8px;text-align:right;height:61px}#bot_bar .col-md-12 .pull-left{padding:8px}#bot_bar .col-md-12 .pull-left input[type=text]{width:200px;font-size:11px;height:30px;vertical-align:middle}#error{display:none}@media(max-height: 400px){#bot_bar{position:relative}}@media(min-width: 1200px){#bot_bar{width:1170px}}@media(min-width: 992px){#bot_bar{width:970}}@media(min-width: 768px){#bot_bar{width:750}}/*# sourceMappingURL=highlight.css.map */
@import'bootstrap.min.css';body{font-family:"Verdana",sans-serif;border-top:10px solid #d9d9d9;padding-top:10px}blockquote{font-size:16px}blockquote.good{background-color:#dff0d8;border-left:5px solid #3c763d}blockquote.bad{background-color:#f2dede;border-left:5px solid #a94442}.col-md-3{color:#ddd;background-color:rgba(245,245,245,.3)}div#full_article{font-size:16px}div#full_article span{cursor:pointer}div#full_article span.controversial{color:#bada55;background-color:#800}#copyright{margin-bottom:14em}.btn{font-weight:700}#full_article{text-align:justify}#bot_bar{position:fixed;z-index:1;bottom:0}#bot_bar .col-md-12{padding:8px;background-color:#eee;margin-top:8px;text-align:right;height:61px}#bot_bar .col-md-12 .pull-left{padding:8px}#bot_bar .col-md-12 .pull-left input[type=text]{width:200px;font-size:11px;height:30px;vertical-align:middle}#error{display:none}span.q:before{content:"‘"}span.q:after{content:"’"}@media(max-height: 400px){#bot_bar{position:relative}}@media(min-width: 1200px){#bot_bar{width:1170px}}@media(min-width: 992px){#bot_bar{width:970}}@media(min-width: 768px){#bot_bar{width:750}}/*# sourceMappingURL=highlight.css.map */
......@@ -61,6 +61,12 @@ div#full_article {
#error {
display: none;
}
span.q:before {
content: '\2018';
}
span.q:after {
content: '\2019';
}
@media (max-height: 400px) {
#bot_bar { position: relative; }
}
......
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"am",
"pm"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/y HH:mm",
"shortDate": "dd/MM/y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-gb",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
......@@ -30,7 +30,7 @@
<li>
{% with %}
{% set pd = query['Performed']|pretty_date %}
<q><b class='sans'>{{ query['Term'] }}</b></q> {{ pd[0] }} <small>(on {{ pd[1] }})</small>
<span class='q'><b class='sans'>{{ query['Term'] }}</b></span> {{ pd[0] }} <small>(on {{ pd[1] }})</small>
{% endwith %}
</li>
{% endfor %}
......
......@@ -2,7 +2,7 @@
{% if angular is defined %}
<html ng-app='{{ angular }}' lang='en'>
{% else %}
<html lang='en'>
<html lang='en-GB'>
{% endif %}
<title>
{% if title is defined %}
......@@ -32,6 +32,7 @@
{% if angular is defined %}
<script src='{{ url_for("static", filename="lib/js/angular.min.js") }}'></script>
<script src='{{ url_for("static", filename="lib/js/angular-locale_en-gb.js") }}'></script>
<script src='{{ url_for("static", filename="lib/js/angular-route.min.js") }}'></script>
<script src='{{ url_for("static", filename="lib/js/angular-sanitize.min.js") }}'></script>
<script src='{{ url_for("static", filename="lib/js/angular-animate.js") }}'></script>
......
......@@ -4,10 +4,10 @@
<!-- ``n_reads``: {{ article.n_reads }} -->
<div class='row'>
<div class='col-md-9'>
<p class='lead'>Please click any sentences which you believe are controversial (as per our definition on the previous page). When done, click <b><q>Submit</q></b>.</p>
<p class='lead'>Please click any sentences which you believe are controversial (as per our definition on the previous page). When done, click <b><span class='q'>Submit</span></b>.</p>
</div>
<div class='col-md-3'>
<i>{{ article.title }}</i> <b>&middot;</b> {{ article.byline }} <b>&middot;</b> {{ article.published }} <b>&middot;</b> <q>{{ article.keyword }}</q> corpus.
<i>{{ article.title }}</i> <b>&middot;</b> {{ article.byline }} <b>&middot;</b> {{ article.published }} <b>&middot;</b> <span class='q'>{{ article.keyword }}</span> corpus.
</div>
<div class='col-md-12'>
<hr>
......
<!doctype html>
<html lang='en'>
<html lang='en-GB'>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
......
......@@ -2,8 +2,8 @@
{% block content %}
<div class='row'>
<div class='col-md-12'>
<p><b>Dataset</b>. We will not employ microtask workers to annotate our training articles for <a href='https://www.jacobinmag.com/2017/12/middle-east-digital-labor-microwork-gaza-refugees-amazon'>ethical</a> <a href='https://www.jacobinmag.com/2015/08/amazon-google-facebook-privacy-bezos'>reasons</a> and personal frugality. A small subset of the articles has been annotated by volunteers.</p>
<p>The data are compiled dynamically and will update with new annotations as we receive them. <b>Downloads are now available</b>.</p>
<p><b>Dataset</b>. We will not employ microtask workers to annotate our training articles for <a href='https://www.jacobinmag.com/2017/12/middle-east-digital-labor-microwork-gaza-refugees-amazon'>labour-rights</a> <a href='https://www.jacobinmag.com/2015/08/amazon-google-facebook-privacy-bezos'>reasons</a> and personal niggardliness. A small subset of the articles has been annotated by volunteers.</p>
<p>The data are compiled dynamically and will update with new annotations as we receive them.</p>
<p style='line-height: 275%'>
<b>download &hellip;</b>
<a class='btn btn-success' type='submit' href='dataset/annotated'>annotated only (json)</a>
......@@ -11,7 +11,7 @@
</p>
<p>
<b>Meaning of the file:</b>
you will find those sentences judged by readers to be controversial in the <code>highlights</code> array of each article. Each entry in the array is one person's reading of the article. Within each reading, there is another array that lists the indices of the sentences of the article that were judged controversial. Please use <a href='https://framagit.org/gdyer/CONTROVERSY/blob/master/controversy/highlighting.py#L74'>our tokenizer</a> to separate the <code>full</code> article into sentences so that these indices are meaningful (we do some unusual things).
you will find those sentences judged by readers to be controversial in the <code>highlights</code> array of each article. Each entry in the array is one person's reading of the article. Within each reading, there is another array that lists the indices of the sentences of the article that were judged controversial. Please use <a href='https://framagit.org/gdyer/CONTROVERSY/blob/master/controversy/highlighting.py#L74'>our tokeniser</a> to separate the <code>full</code> article into sentences so that these indices are meaningful (we do some unusual things).
</p>
<p>Articles are &copy; The New York Times Company. Assume all rights reserved or, for content produce by our research team, CC BY-NC-SA 4.0 (see <a href='https://creativecommons.org/licenses/by-nc-sa/4.0/'>here</a> for details).</p>
</div>
......
......@@ -6,11 +6,11 @@
</div>
<div class='col-md-12'>
<p class='lead'>Each task involves reading an article from <i>The New York Times</i>. You must be fluent in English to participate.</p>
<p class='lead'>While reading on the next page, click any sentences which you believe to be controversial, i.e., expressing an opinion or strongly qualified fact (e.g., <q>terrible performance</q>) that you believe could be debated. Use your knowledge of current events and history while determining whether a sentence is controversial. We hope, like Kant&rsquo;s aesthetic judgments, your judgments of controversy will be subjective yet universal. When done, click <b><q>Submit</q></b>. You have unlimited time to read, however there is a minimum time shown at the bottom that is determined by the length of the article. You may not submit before this time or with no or too many highlights. We recognise not every article will have sentences most deem controversial; we&rsquo;ve attempted to eliminate such articles. Examples are below.</p>
<p class='lead'>While reading on the next page, click any sentences which you believe to be controversial, i.e., expressing an opinion or strongly qualified fact (e.g., <span class='q'>terrible performance</span>) that you believe could be debated. Use your knowledge of current events and history while determining whether a sentence is controversial. We hope, like Kant&rsquo;s aesthetic judgements, your judgements of controversy will be subjective yet universal. When done, click <b><span class='q'>Submit</span></b>. You have unlimited time to read, however there is a minimum time shown at the bottom that is determined by the length of the article. You may not submit before this time or with no or too many highlights. We recognise not every article will have sentences most deem controversial; we&rsquo;ve attempted to eliminate such articles. Examples are below.</p>
<blockquote class='good'>
<p>Across Russia, companies are <i>being forced</i> to prioritize patriotism over profits.</p>
</blockquote>
<p>This sentence is controversial because it expresses a value-judgment that&rsquo;s couched as an objective truth, implying strongly that <q>patriotism</q> should be subordinate to <q>profits</q>. It implies that governments should have minimal intervention in corporate affairs, which is far from a law of nature. The choice of words puts readers on the side of the ostensibly victimised corporation. This is ideologically revealing, considering the company in question (Aeroflot) is majority owned by the Russian government: is it not a capitalist principle that shareholders dictate policy?&mdash;much to the detriment of working conditions, access to healthcare/food/housing/&hellip;.</p>
<p>This sentence is controversial because it expresses an obviously value-laden judgement that&rsquo;s couched as an objective truth, implying strongly that <span class='q'>patriotism</span> should be subordinate to <span class='q'>profits</span>. It implies that governments should have minimal intervention in corporate affairs, which is far from a law of nature. The choice of words puts readers on the side of the ostensibly victimised corporation. This is ideologically revealing, considering the company in question (Aeroflot) is majority owned by the Russian government: is it not a capitalist principle that shareholders dictate policy?&mdash;much to the detriment of working conditions, access to healthcare/food/housing/&hellip;.</p>
<p>Other examples of controversial sentences:</p>
<blockquote class='good'>
<p>The airline has had <b>countless</b> safety problems in the past. <i>[Surely, they <i>can</i> be counted!]</i></p>
......@@ -23,7 +23,7 @@
</blockquote>
</div>
<div class='col-md-8'>
<p>Complete the CAPTCHA. Once done, click <b><q>Next</q></b>.</p>
<p>Complete the CAPTCHA. Once done, click <b><span class='q'>Next</span></b>.</p>
<form method=POST>
<div class='form-group'>
{{ form.hidden_tag() }}
......@@ -34,7 +34,7 @@
<br>
</div>
<div class='col-md-4'>
<p>Problems preventing submission are unlikely. Should they nevertheless occur, email us your browser info: <b><tt>gdyer2</tt>@<tt>illinois</tt>.<tt>edu</tt></b>. Please contact this address, too, if these webpages could be made more accessibility-friendly.</p>
<p>Problems preventing submission are unlikely. Should they nevertheless occur, email us your browser info: <b><code>postmaster@2pitau.org</code></b>. Please contact this address, too, if these webpages could be made more accessible.</p>
<br>
</div>
</div>
......
......@@ -52,7 +52,7 @@ function dismiss_error() {
</center>
<hr>
</span>
<p><noscript><span class='logo'>CONTROVERSY</span> <i>requires JavaScript. We&rsquo;re not doing anything fishy: the project is free software, and you may view the source files here: <a href='https://framagit.org/gdyer/CONTROVERSY' target='_blank'>https://framagit.org/gdyer/CONTROVERSY</a></i></noscript></p>
<noscript><div class='warning_box'><span class='logo'>CONTROVERSY</span> requires JavaScript. We&rsquo;re not doing anything fishy: the project is free software, and you may view the source files here: <a href='https://framagit.org/gdyer/CONTROVERSY' target='_blank'>framagit.org</a></div></noscript>
<form method='POST'>
{{ form.hidden_tag() }}
{{ form.email(value=username, type='email', class_='field', placeholder='email (username)', required='required') }}
......@@ -61,7 +61,7 @@ function dismiss_error() {
<input type='submit' value='log in' />
</center>
<center>
<b>Or &hellip;&nbsp;</b><i><a id='anon_login' href='{{ url_for("bourbaki") }}'>I don't want an account; take me to the action already &rarr;</a></i>
<b>Or &hellip;&nbsp;</b><i><a id='anon_login' href='{{ url_for("bourbaki") }}'>I don&rsquo;t want an account; take me to the action already &rarr;</a></i>
</center>
</form>
</div>
......
......@@ -31,13 +31,11 @@ function dismiss_error() {
<span id='details'>
Your information is for our reference only and will never be shared with a 3<sup>rd</sup> party. You can also <a href='bourbaki'>use the demo anonymously</a> if you like.
</span>
{% if logged_in == true %}
<p>
<b>You're already <a href='/'>logged in</a>, but feel free to create another account</b>
</p>
{% endif %}
<hr>
<p>We encourage you to use a simple password, like a phrase; we used an <code>md5</code> hash, which has known vulnerabilities.</p>
{% if logged_in == true %}
<div class='warning_box'>You&rsquo;re already <a href='/'>logged in</a>, but feel free to create another account.</div>
{% endif %}
<form method='POST'>
{{ form.hidden_tag() }}
{{ form.name(class_='field', autocomplete='words', placeholder='name', required='required') }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment