Skip to content

Commit

Permalink
Upgrading ConText component to FastContext within annotator UI (cf. a…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Lamarque committed Aug 25, 2020
1 parent b815f34 commit 549a048
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/bp_annotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function get_annotations() {
params.expand_mappings = jQuery("#expand_mappings").is(':checked');
params.ncbo_slice = (("ncbo_slice" in BP_CONFIG) ? BP_CONFIG.ncbo_slice : '');

params.fast_context = jQuery("#fast_context").is(':checked');
params.negation = params.experiencer = params.temporality = params.certainty = params.fast_context = jQuery("#fast_context").is(':checked');

params.score_threshold = jQuery("#score_threshold").val();
params.confidence_threshold = jQuery("#confidence_threshold").val();
Expand Down
8 changes: 2 additions & 6 deletions app/controllers/annotator_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def create
:exclude_numbers => params[:exclude_numbers] ||= "false", # service default is false
:whole_word_only => params[:whole_word_only] ||= "true", # service default is true
:exclude_synonyms => params[:exclude_synonyms] ||= "false", # service default is false
:negation => params[:negation] ||= "false", # service default is false
#:experiencer => params[:experiencer] ||= "false", # service default is false
:temporality => params[:temporality] ||= "false", # service default is false
:fast_context => params[:fast_context] ||= "false", # service default is false
:score => params[:score],
:lemmatize => params[:lemmatize] ||= "false",
:ncbo_slice => params[:ncbo_slice] || ''
Expand All @@ -67,9 +65,7 @@ def create
query += "&expand_class_hierarchy=true" if options[:class_hierarchy_max_level] > 0
query += "&class_hierarchy_max_level=" + options[:class_hierarchy_max_level].to_s if options[:class_hierarchy_max_level] > 0
query += "&score=" + options[:score] unless options[:score] == ""
query += "&negation=" + options[:negation] unless options[:negation].empty?
#query += "&experiencer=" + options[:experiencer] unless options[:experiencer].empty?
query += "&temporality=" + options[:temporality] unless options[:temporality].empty?
query += "&fast_context=" + options[:fast_context] unless options[:fast_context].empty?
query += "&ontologies=" + CGI.escape(options[:ontologies].join(',')) unless options[:ontologies].empty?
query += "&semantic_types=" + options[:semantic_types].join(',') unless options[:semantic_types].empty?
query += "&semantic_groups=" + options[:semantic_groups].join(',') unless options[:semantic_groups].empty?
Expand Down
17 changes: 4 additions & 13 deletions app/views/annotator/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,9 @@
%div.form-group
%div.custom-control.custom-checkbox
= check_box_tag("negation", :all, false, class: "custom-control-input")
%label.custom-control-label{for: "negation"} Detect negation
%small#negationHelp.form-text.text-muted Detect if a concept has been negated (affirmed, negated, possible)
%div.custom-control.custom-checkbox
= check_box_tag("experiencer", :all, false, class: "custom-control-input")
%label.custom-control-label{for: "experiencer"} Detect experiencer
%small#experiencerHelp.form-text.text-muted Detect who experienced the each identified concept (patient, other)
%div.custom-control.custom-checkbox
= check_box_tag("temporality", :all, false, class: "custom-control-input")
%label.custom-control-label{for: "temporality"} Detect temporality
%small#temporalityHelp.form-text.text-muted Detect when the annotated concept occurred (recent, historical, hypothetical)
= check_box_tag("fast_context", :all, false, class: "custom-control-input")
%label.custom-control-label{for: "fast_context"} FastContext
%small#fast_contextnHelp.form-text.text-muted= t('annotator.index.fast_context.tooltip')
%div.my-4
= button_tag("Get annotations", type: "button", id: "annotator_button", class: "btn btn-primary btn-lg")
Expand Down Expand Up @@ -160,6 +150,7 @@
%th Negation
%th Experiencer
%th Temporality
%th Certainty
%tbody
%div.my-3
%b Format results as:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ en:
index:
intro: Get annotations for biomedical text with classes from the ontologies
annotatorplus_html: <em>Check out <a href="%{annotatorplus_href}">AnnotatorPlus</a> beta; a new version of the Annotator with added support for negation, and more!</em>
fast_context:
tooltip: "Enable FastContext to detect : if a concept has been negated (affirmed, negated), who experienced the found concept (patient, other), when the annotated concept occurred (recent, historical, hypothetical), and/or if the annotated concept is uncertain (certain, uncertain)."
sample_text: Melanoma is a malignant tumor of melanocytes which are found predominantly in skin but also in the bowel and the eye.

nbco_annotatosplus:
Expand Down

0 comments on commit 549a048

Please sign in to comment.