summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-07-15 15:05:46 +0200
committerPatrick Simianer <p@simianer.de>2015-07-15 15:05:46 +0200
commit4009fb86bbd0b3f8e05055dbc1fd06eb68d85b33 (patch)
treeda1d999af64d4e10fe7ec017ee827202f47ec371
parentafcfd5bf59ec4f8693b43e55a02e3db8666adf82 (diff)
show duration
-rwxr-xr-xserver.rb8
-rw-r--r--views/debug.haml1
2 files changed, 8 insertions, 1 deletions
diff --git a/server.rb b/server.rb
index a81cc3c..ca17148 100755
--- a/server.rb
+++ b/server.rb
@@ -289,8 +289,14 @@ get '/debug' do # debug view
if File.exist? fn
data = JSON.parse ReadFile.read(fn).force_encoding("UTF-8")
end
+ data2 = {}
+ data2 = JSON.parse ReadFile.read(DB_FILE).force_encoding("UTF-8")
+ if data2["durations"].size == 0
+ data2["durations"] << -1
+ end
+
- haml :debug, :locals => { :data => data, :session_key => SESSION_KEY }
+ haml :debug, :locals => { :data => data, :data2 => data2, :session_key => SESSION_KEY }
end
get '/confirm' do # client confirms received translation
diff --git a/views/debug.haml b/views/debug.haml
index bfa7c73..e71f736 100644
--- a/views/debug.haml
+++ b/views/debug.haml
@@ -53,6 +53,7 @@
%p <strong>updated features:</strong> #{data["updated_features"]}
%p <strong>learning rate:</strong> #{data["learning_rate"]}
%p <strong>learning rate (sparse):</strong> #{data["learning_rate_sparse"]}
+ %p <strong>duration:</strong> #{data2["durations"][[data2["progress"].to_i-1].max]}ms
%h2 k-best
%p bleu | model score | original rank | \|e\| | translation \n features
%p.red update needed ("any of the above hypotheses has a lower model score")