summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-01-29 18:17:46 +0100
committerPatrick Simianer <p@simianer.de>2016-01-29 18:17:46 +0100
commit7d35b712d33cca0be3af122ecffbbfa7cbc123b2 (patch)
tree5d90cb23f0a5514e706bf31ae5b232d011516b3e
parent3a45a4076187de8cac3be1f562fb583ee6724a50 (diff)
cleanup
-rw-r--r--inc/footer.inc.php13
-rw-r--r--inc/header.inc.php8
-rw-r--r--inc/help.inc.php42
-rw-r--r--js/common.js71
-rwxr-xr-xutil/adadelta_rate_conv.rb28
5 files changed, 91 insertions, 71 deletions
diff --git a/inc/footer.inc.php b/inc/footer.inc.php
new file mode 100644
index 0000000..7c30622
--- /dev/null
+++ b/inc/footer.inc.php
@@ -0,0 +1,13 @@
+<!-- Footer -->
+<p class="small right"><a href="#">^</a></p>
+
+<p id="footer">
+ <img id="uni" style="width:129px" src="static/logo_neu_204x107.jpg" />
+ <img id="cl" style="width:128px" src="static/institut_cl.png" /><br />
+ &copy;2015 Heidelberg University/Institute for Computational Linguistics
+</p>
+<!-- /Footer -->
+
+</div>
+<!-- /Wrapper -->
+
diff --git a/inc/header.inc.php b/inc/header.inc.php
new file mode 100644
index 0000000..e812943
--- /dev/null
+++ b/inc/header.inc.php
@@ -0,0 +1,8 @@
+<!-- Wrapper -->
+<div id="wrapper">
+
+<!-- Header -->
+<div id="header">
+</div>
+<!-- /Header -->
+
diff --git a/inc/help.inc.php b/inc/help.inc.php
new file mode 100644
index 0000000..7b04228
--- /dev/null
+++ b/inc/help.inc.php
@@ -0,0 +1,42 @@
+<p>Press the 'Next' button to <strong>submit</strong> your post-edit and to request the next segment for post-edition.
+Alternatively, in the textual interface, you may just press return when you finished the post-edit ('Target' text area is in focus).</p>
+
+<p>The session can be paused at any time and continued later; However, if you have to pause your session, wait until the activity notification disappears and then press 'Pause', as we are collecting timing information. You may also just reload this site and re-request the segment to reset the timer.</p>
+
+<p>Please use only a <strong>single browser window</strong> at the same time. Going back to earlier examples is not possible, please take great care when interacting with the system.</p>
+
+<p><span style="border-bottom:1px solid #ccc">Instructions for the graphical interface:</span></p>
+<p>To submit a post-edition in the graphical interface all phrases have to be marked as finished.</p>
+<ul>
+ <li><strong>Moving around:</strong> Press <strong>'S'</strong>, then select phrases using the arrow keys.</li>
+ <li><strong>Editing text:</strong> Double click on a phrase or press <strong>'E'</strong> to edit the contents of the current phrase. Press 'Return' to save.</li>
+ <li><strong>Reordering of target phrases:</strong> Press <strong>'M'</strong>, then use the arrow keys to move the selected phrase. Press 'Return' to fix the position.</li>
+ <li><strong>Mark phrase as finished:</strong> Press <strong>'Return'</strong> to mark phrases as finished (press 'Return' again to undo). Moving, editing or deleting of finished phrases is not possible.</li>
+ <li><strong>Adding target phrases:</strong> To add a phrase right next to the currently selected one press <strong>'A'</strong>.</li>
+ <li><strong>Removing target phrases:</strong> Press <strong>'D'</strong> to delete the currently selected phrase.</li>
+ <li><strong>Adding/removing alignments:</strong> Select a source phrase by clicking on it, then click on a suitable target phrase to connect or disconnect. Click the selected source phrase again to cancel.</li>
+ <li><strong>Undo:</strong> Press <strong>'U'</strong> to undo alignments, text edits and deletion of phrases.</li>
+ <li><strong>Reset:</strong> Click 'Reset' button to start from scratch.</li>
+</ul>
+
+<p>The interface was tested with Firefox 31, 38 and 43.</p>
+
+<p><span style="border-bottom:1px solid #ccc">Known issues:</span></p>
+<ul>
+<!-- <li>Collision detection is not perfect, fast dragging may lead to strange behavior.</li>-->
+<!-- <li>Graphical editor can still be used while faded.</li>-->
+ <li>The width of the canvas of graphical editor may be to small when adding a lot of phrases.</li>
+ <li>The in-line editor may change height and span several lines.</li>
+ <li>When editing phrases that have no contents, the input box is lower than normal.</li>
+ <li>Post-edits in the session overview may be partially tokenized due to phrase segmentation.</li>
+ <li>Horizontal scrollbar doesn't follow highlighted phrase.</li>
+ <li>Mouseover is not detected for undoing.</li>
+</ul>
+
+<p class="tiny">
+ Support: <a href="mailto://simianer@cl.uni-heidelberg.de">Mail</a>
+</p>
+<p class="tiny">Session: #<?php echo $_GET["key"]; ?> |
+ <a href="http://coltrane.cl.uni-heidelberg.de:<?php echo $db->port; ?>/debug" target="_blank">Debug</a>
+</p>
+
diff --git a/js/common.js b/js/common.js
deleted file mode 100644
index 6ccc8ab..0000000
--- a/js/common.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * (common) global vars
- *
- */
-var data, // data (from JSON)
- ui_type; // 't' (text) or 'g' (graphical)
-
-/*
- * hacky way to remove class from node
- *
- */
-function removeClass(node, className)
-{
- node.className =
- node.className.replace(" "+className,'');
- node.className =
- node.className.replace(" "+className,''); // ???
-
- return false;
-}
-
-/*
- * toggle display of element (by id)
- *
- */
-function toggleDisplay(id)
-{
- node = $(id);
- if (node.style.display=='none') {
- node.fadeIn();
- } else {
- node.fadeOut();
- }
-
- return false;
-}
-
-/*
- * trim string
- *
- */
-function trim(s)
-{
- return s.replace(/(\||\n|\t)/g, " ").replace(/^\s+|\s+$/g, '').replace(/\s+/g, " ");
-}
-
-function updateProgress (oEvent) {
- //alert(oEvent);
-}
-
-/*
- * cross-site request
- *
- */
-function CreateCORSRequest(method, url)
-{
- var xhr = new XMLHttpRequest();
- if ("withCredentials" in xhr) {
- xhr.addEventListener("progress", updateProgress);
- xhr.open(method, url, true);
- xhr.timeout = 999999999999;
- xhr.ontimeout = function () { alert("XHR TIMEOUT"); }
- xhr.onerror = function () { alert("XHR ERRROR 1"); }
- xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
- } else {
- xhr = null;
- }
-
- return xhr;
-}
-
diff --git a/util/adadelta_rate_conv.rb b/util/adadelta_rate_conv.rb
new file mode 100755
index 0000000..c845847
--- /dev/null
+++ b/util/adadelta_rate_conv.rb
@@ -0,0 +1,28 @@
+#!/usr/bin/env ruby
+
+require 'zipf'
+
+updates = SparseVector.new
+ReadFile.readlines_strip(ARGV[0]).each { |line|
+ k,v = line.split
+ updates[k] = v.to_f
+}
+grads = SparseVector.new
+ReadFile.readlines_strip(ARGV[1]).each { |line|
+ k,v = line.split
+ grads[k] = v.to_f
+}
+
+smooth = 0.000001
+
+ks = updates.keys + grads.keys
+
+rates = SparseVector.new
+ks.each { |k|
+ rates[k] = Math.sqrt(updates[k]+smooth)/Math.sqrt(grads[k]+smooth)
+}
+
+rates.each { |k,v|
+ puts "#{k} #{v}"
+}
+