diff options
author | Patrick Simianer <p@simianer.de> | 2017-07-25 02:17:07 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2017-07-25 02:17:07 +0200 |
commit | 93bdac797ed3cf04a427e276823f9896dcf19a2d (patch) | |
tree | f3d7b5c300125a276f4d1af8f34c8f6f28657caf /views/summary.haml | |
parent | b5897a62732dd7c13b2b10d7b132855d40afae0d (diff) |
lfpe 2017 (neural edition)
Diffstat (limited to 'views/summary.haml')
-rw-r--r-- | views/summary.haml | 97 |
1 files changed, 51 insertions, 46 deletions
diff --git a/views/summary.haml b/views/summary.haml index 671f1b5..7339367 100644 --- a/views/summary.haml +++ b/views/summary.haml @@ -11,51 +11,56 @@ %h1 Summary %p.small (Session #{session_key}) %p Data is shown in the MT system's formatting. BLEU is calculated without smoothing. TER capped at 1.0. - %table - %tr - %td - #{"#"} - %td - %strong Source - %td - %strong - Post-Edit - %td - %strong - Reference - %td - %strong - BLEU - %td - %strong - TER - %td - %strong - MT - %td - %strong - HTER - %td - %strong - Key. - %td - %strong - M.a. - %td - %strong - Dur. - - 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 #{data["mt_raw"][j]} - %td.center #{hter_scores[j]} - %td.center #{data["count_kbd"][j]} - %td.center #{data["count_click"][j]} - %td.center #{((data["durations"][j]/1000.0)/60.0).round 1} min + -if data["source_segments"].size == data["mt_raw"].size + %table + %tr + %td + #{"#"} + %td + %strong Source + %td + %strong + Post-Edit + %td + %strong + Reference + %td + %strong + BLEU + %td + %strong + TER + %td + %strong + MT + %td + %strong + HTER + %td + %strong + Rating + %td + %strong + Key. + %td + %strong + M.a. + %td + %strong + Dur. + - data["post_edits"].each_with_index do |pe,j| + %tr + %td.center #{j+1}. + %td #{data["source_segments"][j].gsub(/((@@ )|(@@$))/, "")} + %td #{pe.gsub("@@ ", "")} + %td #{data["references"][j]} + %td.center #{bleu_scores[j]} + %td.center #{ter_scores[j]} + %td #{data["mt_raw"][j].gsub(/((@@ )|(@@$))/, "")} + %td.center #{hter_scores[j]} + %td.center #{data["ratings"][j]} + %td.center #{data["count_kbd"][j]} + %td.center #{data["count_click"][j]} + %td.center #{((data["durations"][j]/1000.0)/60.0).round 1} min [#{((data["durations_rating"][j]/1000.0)/60.0).round 1} min] |