Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

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 Apr 15, 2020
1 parent 84019d0 commit 2a4f7cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
6 changes: 1 addition & 5 deletions app/assets/javascripts/bp_annotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,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.negation = jQuery("#negation").is(':checked');
params.experiencer = jQuery("#experiencer").is(':checked');
params.temporality = jQuery("#temporality").is(':checked');
params.certainty = jQuery("#certainty").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
10 changes: 2 additions & 8 deletions app/controllers/annotator_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,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
:certainty => params[:certainty] ||= "false",
:fast_context => params[:fast_context] ||= "false", # service default is false
:score => params[:score],
:score_threshold => params[:score_threshold] ||=-1,
:confidence_threshold => params[:confidence_threshold] ||=-1,
Expand All @@ -74,10 +71,7 @@ def create
query += "&score=" + options[:score] unless options[:score] == ""
query += "&score_threshold=" + options[:score_threshold] unless options[:score] == "" or options[:score_threshold]==-1
query += "&confidence_threshold=" + options[:confidence_threshold] unless options[:score] == "" or options[:confidence_threshold]==-1
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 += "&certainty=" + options[:certainty] unless options[:certainty].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
25 changes: 7 additions & 18 deletions app/views/annotator/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,15 @@
= check_box_tag :lemmatize, :all, false, :id => "lemmatize"
= label_tag :lemmatize, "Lemmatize (beta)"

%div{:class => "panel panel-primary", :style => "width: 17em; display: inline-block; vertical-align: top; height: 256px;"}
%div{:class => "panel panel-primary", :style => "width: 20em; display: inline-block; vertical-align: top;"}
%div{:class => "panel-heading"}
%h3{:class => "panel-title"} NegEx / ConText
%h3{:class => "panel-title"} FastContext
%div{:class => "panel-body"}
%p{title: "Detect if a concept has been negated (affirmed, negated)", style: "margin-top: 40px;"}
= check_box_tag :negation, :all, false, :id => "negation"
= label_tag :negation, "Detect negation"
= help_icon("/annotator", {:title => "Detect if a concept has been negated (affirmed, negated, possible)"}).html_safe
%p{title: "Detect who experienced the found concept (patient, other)"}
= check_box_tag :experiencer, :all, false, :id => "experiencer"
= label_tag :experiencer, "Detect experiencer"
= help_icon("/annotator", {:title => "Detect who experienced the found concept (patient, other)"}).html_safe
%p{title: "Detect when the annotated concept occurred (recent, historical, hypothetical)"}
= check_box_tag :temporality, :all, false, :id => "temporality"
= label_tag :temporality, "Detect temporality"
= help_icon("/annotator", {:title => "Detect when the annotated concept occurred (recent, historical, hypothetical)"}).html_safe
%p{title: "Detect if the annotated concept is uncertain (certain, uncertain)"}
= check_box_tag :certainty, :all, false, :id => "certainty"
= label_tag :certainty, "Detect uncertainty"
= help_icon("/annotator", {:title => "Detect if an annotated concept is uncertain (certain, uncertain)"}).html_safe
- faxt_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)"
%p{title: faxt_context_tooltip, style: ""}
= check_box_tag :fast_context, :all, false, :id => "fast_context"
= label_tag :fast_context, "Enable/disable FastContext"
= help_icon("/annotator", {:title => faxt_context_tooltip}).html_safe

%div
%b Ancestors Level:
Expand Down

0 comments on commit 2a4f7cd

Please sign in to comment.