-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEdit_caption.html
311 lines (284 loc) · 18.2 KB
/
Edit_caption.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<!-- HIT template: Writing-v3.0 --><!-- The following snippet enables the 'responsive' behavior on smaller screens -->
<meta content="width=device-width,initial-scale=1" name="viewport"/>
<section class="container" id="Writing"><!-- Instructions -->
<div class="row">
<div class="col-xs-12 col-md-12">
<div class="panel panel-primary">
<!-- WARNING: the ids "collapseTrigger" and "instructionBody" are being used to enable expand/collapse feature --><a
class="panel-heading" id="collapseTrigger"><strong>Please read the following instructions
carefully</strong> <span class="collapse-text">:</span> </a>
<div class="panel-body" id="instructionBody" style="background-color: rgb(230, 230, 230);">
<p><strong><u>Edit</u><strong> </strong>and/or</strong>
<u><strong>rephrase</strong></u><strong> </strong>the given sentence. Your answer should also be
<u><strong>one sentence</strong></u>. Your answer should contain <u><strong>at least 8 and at
most 20 words</strong></u>, even if the original sentence is under 8 or over 20 words.
</p>
<p><strong><u>Follow the instructions carefully and precisely.</u></strong></p>
<p><strong>Correct the sentence that you are given by doing the following:</strong></p>
<ul>
<li>Check for spelling and grammar errors.</li>
<li>Remove or substitute "shoulda", "woulda", "sorta" and other similar idioms.</li>
<li>Make sure your answer is in fluent English.</li>
<li>Replace numbers with words if there are any (e.g. "<strong>5 </strong>cats..." -> "<strong>five</strong>
cats...").
</li>
<li><strong>Remove</strong> the following from the sentence if they appear, and <strong>do
not add them</strong> if they do not appear in the sentence:
<ul>
<li><strong>References to the contents of speech.</strong> E.g. "A man <strong>speaks in a foreign language</strong> and..."
could be replaced as "A man <strong>speaks</strong> and..." and "A man <strong>talks about taking over the world</strong> while..."
could be replaced as "A man <strong>talks about something</strong> while..." and "A person <strong>gives a news report</strong> as..."
could be replaced as "A person <strong>speaks</strong> as..."</li>
<li><strong>"This is", "this is", </strong><strong>"There is", "there is",</strong>
<strong>"There are", </strong>and<strong> "there are"</strong></li>
<li><strong>"I hear", "I listen", </strong><strong
style="background-color: rgb(230, 230, 230);">"Can be heard"</strong><span
style="background-color: rgb(230, 230, 230);">, </span><strong
style="background-color: rgb(230, 230, 230);">"can be heard"</strong><span
style="background-color: rgb(230, 230, 230);">, <strong>"Could be heard"</strong>, <strong>"could be heard"</strong>, </span><strong
style="background-color: rgb(230, 230, 230);">"You can hear"</strong><span
style="background-color: rgb(230, 230, 230);">, </span><strong
style="background-color: rgb(230, 230, 230);">"you can hear"</strong><span
style="background-color: rgb(230, 230, 230);">, </span><strong
style="background-color: rgb(230, 230, 230);">"Is heard", </strong><strong
style="background-color: rgb(230, 230, 230);">"is heard"</strong><span
style="background-color: rgb(230, 230, 230);"> and <strong>all variations with the words "hear", "heard", </strong>and <strong>"listen"</strong></span>
</li>
<li><strong>"I say"</strong></li>
<li><strong>"I think" </strong></li>
<li><strong>"sounds like"</strong>, <strong
style="background-color: rgb(230, 230, 230);">"sounds like"</strong><strong> ,</strong>
<strong>"Sound of"</strong>, <strong style="background-color: rgb(230, 230, 230);">"sound
of"</strong><strong style="background-color: rgb(230, 230, 230);">, </strong>and
<strong>"noise of"</strong></li>
<li>Speculative words or words expressing uncertainty such
as <strong>"possibly"</strong>, <strong>"probably", "likely"</strong> or
<strong>"could be" </strong>(e.g. "An engine whirs, <strong>probably
diesel</strong>, and..." to "A diesel engine whirs and...")
</li>
</ul>
</li>
<li><strong>If there are no edits to be made (no grammar errors and none of the phrases
listed above), <u>rephrase the
sentence</u>.</strong></li>
</ul>
<p><strong><strong>NOTE BOLD:</strong></strong></p>
<ul>
<li><u>Changing <strong>only </strong>the plurality or tense of words will not count as
rephrasing</u>. For example, only changing "...while a <strong>bird is chirping</strong>..."
to "...while <strong>birds chirp</strong>..." or "A <strong>dog is barking</strong>
while..." to "A <strong>dog barks </strong>while..."<strong> <u>will <strong>not be
approved</strong></u>.</strong></li>
<li><u>Adding a special characters, symbols, or punctuation points </u><strong><u>cannot be the
only correction you make</u>. Adding ONLY special characters, symbols, or punctuations
points will result in the rejection of your submission</strong>. For example, if
your <strong>only</strong> change to the sentence is the additon of a "." or an
"!", <strong>your submission will not be approved</strong>.
</li>
<li><u>If your submission is grammatically incoherent</u> (e.g. it has words in random order),
<strong>your submission will not be approved.</strong></li>
<li><b>Try to add as little information to the sentence as possible. </b></li>
</ul>
<table style="width: 100%;">
<tbody>
<tr>
<td>
<h4>Example 1</h4>
<div class="form-group"><label for="OgExample1">Original sentence:</label><textarea
class="form-control" cols="250" id="OgExample1" readonly="readonly" rows="2">2 golf swigns hit and grunting and birds chirping.</textarea>
</div>
<div class="form-group"><label for="EdExample1">Make the edits to or rephrase the
sentence here (input is disabled for examples):</label><textarea
class="form-control" cols="250" id="EdExample1" readonly="readonly" rows="2">Two golf swings are hit and a man grunts while birds chirp.</textarea>
</div>
</td>
<td>
<h4>Example 2</h4>
<div class="form-group"><label for="OgExample2">Original sentence:</label><textarea
class="form-control" cols="250" id="OgExample2" readonly="readonly" rows="2">A woman coughing louder and more severely as time goes on.</textarea>
</div>
<div class="form-group"><label for="EdExample2">Make the edits to or rephrase the
sentence here (input is disabled for examples):</label><textarea
class="form-control" cols="250" id="EdExample2" readonly="readonly" rows="2">A woman is coughing silently at first and then it starts to get louder and more severe.</textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- End Instructions --><!-- Writing Layout --><input id="ed_worker" name="ed_worker" style="display: none;"
type="text" value=""/>
<h4><u><strong>VVV The task starts here! VVV</strong></u></h4>
<!--Hidden inputs to capture inputs with results--><input name="audioUrl" style="display: none;"
value="${audioUrl}"/><input name="audioType"
style="display: none;"
value="${audioType}"/><input
name="og_assign" style="display: none;" value="${AssignmentId}"/><input id="ed_assign" name="ed_assign"
style="display: none;"/>
<div class="form-group"><label for="OriginalCaption">Original sentence:</label><textarea class="form-control"
cols="250"
id="OriginalCaption"
name="OriginalCaption"
readonly="readonly"
rows="2">${DescriptionText}</textarea>
</div>
<div class="form-group"><label for="EditedCaption">Make the edits to or rephrase the sentence here:</label><textarea
class="form-control" cols="250" id="EditedCaption" name="EditedCaption" required="" rows="2"
spellcheck="true">${DescriptionText}</textarea></div>
<hr style="border-color: rgb(34, 34, 34);"/>
<label for="Feedback">Feedback (not obligatory):</label><textarea class="form-control" cols="250" id="Feedback"
name="Feedback"
placeholder="Please tell us if there is some way we could improve this HIT."
rows="2">Please tell us if there is some way we could improve this HIT.</textarea>
<!-- End input from Worker --></section>
<!-- End Writing Layout --><!-- Please note that Bootstrap CSS/JS and JQuery are 3rd party libraries that may update their url/code at any time. Amazon Mechanical Turk (MTurk) is including these libraries as a default option for you, but is not responsible for any changes to the external libraries --><!-- External CSS references -->
<link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"
integrity="sha384-IS73LIqjtYesmURkDE9MXKbXqYA8rvKEp/ghicjem7Vc3mGRdQRptJSz60tvrB6+"
rel="stylesheet"/><!-- Open internal style sheet -->
<style type="text/css">#collapseTrigger{
color:#fff;
display: block;
text-decoration: none;
}
#submitButton{
white-space: normal;
}
.image{
margin-bottom: 15px;
}
/* CSS for breaking long words/urls */
.dont-break-out {
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
.error{
background-color: #900;
}
</style>
<!-- End internal style sheet --><!-- External JS references -->
<script crossorigin="anonymous"
integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script crossorigin="anonymous"
integrity="sha384-s1ITto93iSMDxlp/79qhWHi+LsIi9Gx6yL+cOKDuymvihkfol83TYbLbOw+W/wv4"
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script><!-- Open internal javascript -->
<script>
var audioUrl = "${audioUrl}";
var audioType = "${audioType}";
document.getElementById("ed_assign").value = turkGetParam('assignmentId', '');
function getWordCount(sentence){
var matching = sentence.toLowerCase().match(/[a-z]\b/g);
if (matching === null) {
var count = 0;
} else {
var count = matching.join(" ").trim().split(" ").length;
}
return count;
}
$(document).ready(function() {
$("form").submit(function(event) {
var og_cap = document.getElementById("OriginalCaption");
var ed_cap = document.getElementById("EditedCaption");
var word_count = getWordCount(ed_cap.value);
check = function(phrase) {
return ed_cap.value.toLowerCase().match(new RegExp("\\b" + phrase + "\\b"));
};
var no_no_words = ["sound like", "sounds a bit like", "sounds abit like", "sound abit like", "there is", "there's", "theres", "here is", "there are", "there're", "here are", "this is", "his is", "there was", "here was", "there were", "here were", "this was", "his was", "i hear", "i listen", "i say", "i hear", "i think", "sounds like", "sound of", "sounds of", "noise of", "noises of", "hear", "hearing", "heard", "hears", "possibly", "probably", "likely", "maybe", "could be", "perhaps"]
var phrase_appears = 0;
check = function(phrase) {
return ed_cap.value.toLowerCase().match(new RegExp("\\b" + phrase + "\\b"));
};
for (var i = 0; i < no_no_words.length; i++) {
if (check(no_no_words[i])) {
phrase_appears = 1;
}
}
for (var i = 0; i < no_no_words.length; i++) {
if (check(no_no_words[i])) {
phrase_appears = 1;
}
}
function isSameSentence(s1, s2){
var match1 = s1.toLowerCase().match(/[a-z]/g);
var match2 = s2.toLowerCase().match(/[a-z]/g);
if (match1 === null && match2 === null) {
return true;
} else if (match1 === null) {
return false;
} else if (match2 === null) {
return false;
} else {
return match1.join("") == match2.join("");
}
}
if (isSameSentence(og_cap.value, ed_cap.value)) { // To see if worker only added a space, comma or dot somewhere.
alert("If there are no edits to be made, please rephrase the sentence.");
ed_cap.focus();
ed_cap.select();
event.preventDefault();
} else if (phrase_appears) {
alert("Please remove the phrases given in the instructions.");
ed_cap.focus();
ed_cap.select();
event.preventDefault();
} else if (ed_cap.value.match(/\.\s*[a-z]/gi)) {
alert("Please make sure the description only has one sentence.");
ed_cap.focus();
event.preventDefault();
} else if (word_count < 8) {
alert("Please make sure the description has at least 8 words.");
ed_cap.focus();
event.preventDefault();
} else if (word_count > 20) {
alert("Please make sure the description has no more than 20 words.");
ed_cap.focus();
event.preventDefault();
}
});
});
</script>
<script src="//uniqueturker.myleott.com/lib.js" type="text/javascript"></script>
<script type="text/javascript">
(function(){
var ut_id = "${collapse_token}";
if (UTWorkerLimitReached(ut_id)) {
// Instructions expand/collapse
var content = $('#instructionBody');
var trigger = $('#collapseTrigger');
trigger.attr("href", "javascript:void(0);");
content.hide();
$('.collapse-text').text('(Click to expand)');
trigger.click(function(){
content.toggle();
var isVisible = content.is(':visible');
if(isVisible){
$('.collapse-text').text('(Click to collapse)');
}else{
$('.collapse-text').text('(Click to expand)');
}
});
// end expand/collapse
}
})();
</script>
<script src="//uniqueturker.myleott.com/lib.js" type="text/javascript"></script>
<script type="text/javascript">
(function(){
var ut_id = "${unique_id}";
if (ut_id){
if (UTWorkerLimitReached(ut_id)) {
document.getElementById('mturk_form').style.display = 'none';
document.getElementsByTagName('body')[0].innerHTML = "You have already completed the maximum amount of these HITs. Please click 'Return HIT' to avoid any impact on your approval rating.";
}
}
})();
</script><!-- Close internal javascript -->