diff options
author | Patrick Simianer <p@simianer.de> | 2016-06-03 13:36:55 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-06-03 13:36:55 +0200 |
commit | 6c62dc57ae90fc6b016da507cae22d96fc128af2 (patch) | |
tree | 28e955964b96e7a568517d3f25b2574d86b64e1c /views | |
parent | 8596c2775346757c7f7c37e603f015a671f86b88 (diff) | |
parent | 0885987afd448fe1aedba7c6a2fdeff64c426623 (diff) |
Merge branch 'master' of github.com:pks/lfpe
Diffstat (limited to 'views')
-rw-r--r-- | views/debug.haml | 124 | ||||
-rw-r--r-- | views/summary.haml | 53 |
2 files changed, 116 insertions, 61 deletions
diff --git a/views/debug.haml b/views/debug.haml index 3c1e006..17f7f86 100644 --- a/views/debug.haml +++ b/views/debug.haml @@ -14,8 +14,9 @@ %p.red %strong No data to show! %ul - %li - %a{ :href => "#controls" } Controls + -if admin + %li + %a{ :href => "#controls" } Controls %li %a{ :href => "#post_edit" } Post-edit %li @@ -31,63 +32,64 @@ %p.tiny Session: #{session_key} /=######################################################################### - %h2#controls Controls - %h3 Reset - %p - %strong [Server reply] - %span#control_reply - %ul - %li - %a.ajax{:tgt => "/reset_progress", :href => "#controls"} Reset progress - %li - %a.ajax{:tgt => "/reset_weights", :href => "#controls"} Reset weights - %li - %a.ajax{:tgt => "/reset_learning_rates", :href => "#controls"} Reset learning rates - / + -if admin + %h2#controls Controls + %h3 Reset + %p + %strong [Server reply] + %span#control_reply + %ul %li - %a.ajax{:tgt => "/reset_extractor", :href => "#controls"} Reset extractor - %li - %a.ajax{:tgt => "/reset_grammars", :href => "#controls"} Reset grammars - %li - %a.ajax{:tgt => "/reset_new_rules", :href => "#controls"} Reset new rules - / + %a.ajax{:tgt => "/reset_progress", :href => "#controls"} Reset progress %li - %a.ajax{:tgt => "/shutdown", :href => "#controls"} Initiate shutdown - %h3 Learning rates & weights - %p Get current weight/rate for specific features: - %input#features_get{ :value => "Feature", :style => "text-align:center; width:20em" } - %select#features_type_get - %option{ :value => "/get_weight" } Weight - %option{ :value => "/get_rate" } Rate - %input#features_value_get{ :value => " ", :style => "text-align:right; width:10em" } - %button#get_features - Get - %p Set weight/rate for specific features: - %input#features{ :value => "Feature", :style => "text-align:center; width:20em" } - %select#features_type - %option{ :value => "/set_weights" } Weight - %option{ :value => "/set_learning_rates" } Rate - %input#features_value{ :value => "1e-05", :style => "text-align:right; width:10em" } - %button#set_features - Set - %p - Set rate for feature groups: - %span.tiny (Features unseen in training/tuning have a common default rate.) - %select#feature_groups_get - %option{ :value => "R" } rule ids - %option{ :value => "RB" } rule bigrams - %option{ :value => "Shape" } rule shapes - %input#feature_groups_value_get{ :value => "1e-05", :style => "text-align:right; width:10em" } - %button#get_feature_groups - Get rate - %br - %select#feature_groups - %option{ :value => "R" } rule ids - %option{ :value => "RB" } rule bigrams - %option{ :value => "Shape" } rule shapes - %input#feature_groups_value{ :value => "1e-05", :style => "text-align:right; width:10em" } - %button#set_feature_groups - Set rate + %a.ajax{:tgt => "/reset_weights", :href => "#controls"} Reset weights + %li + %a.ajax{:tgt => "/reset_learning_rates", :href => "#controls"} Reset learning rates + / + %li + %a.ajax{:tgt => "/reset_extractor", :href => "#controls"} Reset extractor + %li + %a.ajax{:tgt => "/reset_grammars", :href => "#controls"} Reset grammars + %li + %a.ajax{:tgt => "/reset_new_rules", :href => "#controls"} Reset new rules + / + %li + %a.ajax{:tgt => "/shutdown", :href => "#controls"} Initiate shutdown + %h3 Learning rates & weights + %p Get current weight/rate for specific features: + %input#features_get{ :value => "Feature", :style => "text-align:center; width:20em" } + %select#features_type_get + %option{ :value => "/get_weight" } Weight + %option{ :value => "/get_rate" } Rate + %input#features_value_get{ :value => " ", :style => "text-align:right; width:10em" } + %button#get_features + Get + %p Set weight/rate for specific features: + %input#features{ :value => "Feature", :style => "text-align:center; width:20em" } + %select#features_type + %option{ :value => "/set_weights" } Weight + %option{ :value => "/set_learning_rates" } Rate + %input#features_value{ :value => "1e-05", :style => "text-align:right; width:10em" } + %button#set_features + Set + %p + Set rate for feature groups: + %span.tiny (Features unseen in training/tuning have a common default rate.) + %select#feature_groups_get + %option{ :value => "R" } rule ids + %option{ :value => "RB" } rule bigrams + %option{ :value => "Shape" } rule shapes + %input#feature_groups_value_get{ :value => "1e-05", :style => "text-align:right; width:10em" } + %button#get_feature_groups + Get rate + %br + %select#feature_groups + %option{ :value => "R" } rule ids + %option{ :value => "RB" } rule bigrams + %option{ :value => "Shape" } rule shapes + %input#feature_groups_value{ :value => "1e-05", :style => "text-align:right; width:10em" } + %button#set_feature_groups + Set rate /=######################################################################### @@ -109,14 +111,14 @@ %td.left.noborder ##{[0,progress].max} %tr %td.noborder - %strong MT Input: - %td.left.noborder #{data["source_segments"][[0,progress].max]} - %tr - %td.noborder %strong Raw source: %td.left.noborder #{data["raw_source_segments"][[0,progress].max]} %tr %td.noborder + %strong MT Input: + %td.left.noborder #{data["source_segments"][[0,progress].max]} + %tr + %td.noborder %strong Post-edit: %td.left.noborder #{data["post_edits_raw"][progress]} %tr diff --git a/views/summary.haml b/views/summary.haml new file mode 100644 index 0000000..29dc0ad --- /dev/null +++ b/views/summary.haml @@ -0,0 +1,53 @@ +- require 'zipf' +!!! +%html + %head + %title Summary (Session #{session_key}) + %link(rel="stylesheet" type="text/css" href="debug.css") + %script{:src => "http://postedit.cl.uni-heidelberg.de/js/jquery.min.js"} + %script{:src => "http://postedit.cl.uni-heidelberg.de/js/jquery.tablesorter.min.js"} + %script{:src => "http://postedit.cl.uni-heidelberg.de/js/debug.js"} + %body + %h1 Summary + %p (Session #{session_key}) + %p Data is shown in the MT system's formatting. BLEU is calculated without smoothing. + %table + %tr + %td + #{"#"} + %td + %strong Source + %td + %strong + Post-Edit + %td + %strong + Reference + %td + %strong + BLEU + %td + %strong + TER + %td + %strong + Keystrokes + %td + %strong + Mouse actions + %td + %strong + Duration + - data["post_edits"].each_with_index do |pe,j| + %tr + %td.center #{j+1}. + %td #{data["source_segments"][j]} + %td #{pe} + %td #{data["references"][j]} + %td.center #{(BLEU::per_sentence_bleu(pe, [data["references"][j]], 4, 0)*100).round 2}% + %td.center #{ter_scores[j]} + %td.center #{data["count_kbd"][j]} + %td.center #{data["count_click"][j]} + %td.center #{(data["durations"][j]/1000).round 1}s + + |