Skip to content

Commit

Permalink
#35, #21 . added script-name parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Apr 19, 2022
1 parent 12fd48d commit 36d7464
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/demo/index-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h4>$____MODEL_DESCRIPTION____</h3>
<div id = "window">
<link rel="stylesheet" type="text/css" href="$____BRAT_URL____style-vis.css"/>

<form action="./wui.py" method="post" accept-charset="UTF-8">
<form action="./$____SCRIPT_NAME____" method="post" accept-charset="UTF-8">
<p><textarea rows="10" cols="120" name="text">$____TEXT____</textarea></p>

<input type="submit" value="Annotate">
Expand Down
4 changes: 3 additions & 1 deletion examples/demo/wui_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cgi
import json
import sys
from os.path import join
from os.path import join, basename

from arelight.demo.infer_bert_rus import demo_infer_texts_bert_pipeline

Expand All @@ -29,6 +29,8 @@ def prepare_template(data, text, bratUrl):
template_local = template_local.replace("$____MODEL_DESCRIPTION____",
"(ra-20-srubert-large-neut-nli-pretrained-3l-finetuned)")

template_local = template_local.replace("$____SCRIPT_NAME____", basename(__file__))

template_local = template_local.replace("$____COL_DATA_SEM____", json.dumps(data.get('coll_data', '')))
template_local = template_local.replace("$____DOC_DATA_SEM____", json.dumps(data.get('doc_data', '')))

Expand Down
4 changes: 3 additions & 1 deletion examples/demo/wui_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cgi
import json
import sys
from os.path import join
from os.path import join, basename

from arekit.contrib.experiment_rusentrel.labels.formatters.rusentiframes import ExperimentRuSentiFramesLabelsFormatter
from arekit.contrib.networks.enum_input_types import ModelInputType
Expand Down Expand Up @@ -34,6 +34,8 @@ def prepare_template(data, text, bratUrl, model_name):
template_local = template_local.replace("$____MODEL_NAME____", model_name.value)
template_local = template_local.replace("$____MODEL_DESCRIPTION____", "(RuSentRel finetuned)")

template_local = template_local.replace("$____SCRIPT_NAME____", basename(__file__))

template_local = template_local.replace("$____COL_DATA_SEM____", json.dumps(data.get('coll_data', '')))
template_local = template_local.replace("$____DOC_DATA_SEM____", json.dumps(data.get('doc_data', '')))

Expand Down

0 comments on commit 36d7464

Please sign in to comment.