diff options
author | Patrick Simianer <p@simianer.de> | 2015-06-28 13:50:20 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-06-28 13:50:20 +0200 |
commit | 91d68ae2079399acfb381dc14af323d1c75b6dca (patch) | |
tree | a563db5dacca8a329a753ae55663cb2207482bda | |
parent | d61cb146fe833c49ae33fb6477e74989bd13ea23 (diff) |
extractor: drop
-rwxr-xr-x | server.rb | 13 | ||||
-rwxr-xr-x | util/kill | 2 | ||||
-rw-r--r-- | views/debug.haml | 1 |
3 files changed, 12 insertions, 4 deletions
@@ -166,7 +166,7 @@ get '/next' do # (receive post-edit, update models), send next translation # 5c. symmetrize alignment a = send_recv :atools, "#{a_fwd} ||| #{a_back}" # 5d actual extractor - send_recv :extractor, "- ||| #{source} ||| #{reference} ||| #{a}" + send_recv :extractor, "default_context ||| #{source} ||| #{reference} ||| #{a}" # 6. update database logmsg "db", "updating database" update_database @@ -190,8 +190,7 @@ get '/next' do # (receive post-edit, update models), send next translation source.strip! # 1. generate grammar for current sentence grammar = "#{WORK_DIR}/g/#{$db['progress']}.grammar" - msg = "- ||| #{source} ||| #{grammar}" - send_recv :extractor, msg # FIXME: content identifier useful? + send_recv :extractor, "default_context ||| #{source} ||| #{grammar}" # 2. translation msg = "act:translate ||| <seg grammar=\"#{grammar}\"> #{source} </seg>" transl = send_recv :dtrain, msg @@ -266,6 +265,14 @@ get '/reset_weights' do return "done" end +get '/reset_extractor' do + logmsg :server, "reset extractor" + return "locked" if $lock + send_recv :extractor, "default_context ||| drop" + + return "done" +end + get '/load/:name' do # load other db file than configured return "locked" if $lock $db = JSON.parse ReadFile.read "#{SESSION_DIR}/#{params[:name]}.json.original" @@ -1,4 +1,4 @@ #!/bin/bash -for i in {1..6}; do ps ax | grep -P "(server.rb|atools|net_fa|sa.extract|dtrain)" | grep -v vim | grep -v -P "^\s\+$" | cut -d " " -f $i | xargs kill -9 &>/dev/null; done +for i in {1..6}; do ps ax | grep -P "(server.rb|wrapper.rb|atools|net_fa|sa.extract|dtrain)" | grep -v vim | grep -v -P "^\s\+$" | cut -d " " -f $i | xargs kill -9 &>/dev/null; done diff --git a/views/debug.haml b/views/debug.haml index fc5629b..45cb598 100644 --- a/views/debug.haml +++ b/views/debug.haml @@ -10,6 +10,7 @@ %p %a{:href => "/reset", :target => "_blank"} reset progress, %a{:href => "/reset_weights", :target => "_blank"} reset weights, + %a{:href => "/reset_extractor", :target => "_blank"} reset extractor, %a{:href => "/shutdown", :target => "_blank"} shutdown, %span learning rate %select |