Skip to content

Commit

Permalink
Report Redaction: Minor visual adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Wolf committed Sep 3, 2024
1 parent 6e9341a commit 9e6f653
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
4 changes: 3 additions & 1 deletion webapp/llm_processing/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
patientsex: The sex of the patient. Use "m" for male, "w" for female, and "d" for diverse.
This is the medical report:
{report}"""
{report}
The JSON:"""


default_grammar = r"""root ::= allrecords
Expand Down
2 changes: 1 addition & 1 deletion webapp/main/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def set_mode_route():
else:
flash(f"Cannot change mode: The application was launched with --mode {current_app.config['MODE']} option.", "danger")

if session['mode'] == 'anonymizer' and "labelannotation" in request.referrer:
if session['mode'] == 'anonymizer' and "labelannotation" in request.referrer or "annotationhelper" in request.referrer:
flash("Switched to Anonymizer", "info")
return redirect(url_for("report_redaction.main"))

Expand Down
4 changes: 2 additions & 2 deletions webapp/templates/llm_processing.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ <h1 class="display-4 text-center mb-3">LLM Information Extraction</h1>
<div class="col-md-4">
<div class="form-floating">
{% if form.n_predict.errors %}
{{ form.n_predict(class="form-control is-invalid", placeholder="Number of Predictions") }}
<label for="n_predict">Number of Predictions</label>
{{ form.n_predict(class="form-control is-invalid", placeholder="Max. Number of Tokens to Predict") }}
<label for="n_predict">Max. Number of Tokens to Predict</label>
<div class="invalid-feedback">
{% for error in form.n_predict.errors %}
<span>{{ error }}</span>
Expand Down
15 changes: 10 additions & 5 deletions webapp/templates/report_redaction_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ <h5 class="d-flex align-items-center">

<!-- Submit Buttons -->
<div class="row mb-4">
<div class="col-md-4 mb-3">
<div class="col-md-6 mb-3">
<button type="submit" name="submit-metrics" class="btn btn-primary w-100">
<i class="bi bi-bar-chart-line me-2"></i> Report Redaction Metrics
</button>
Expand All @@ -191,7 +191,7 @@ <h5 class="d-flex align-items-center">
<i class="bi bi-eye me-2"></i> Report Redaction Viewer (document-wise)
</button>
</div>-->
<div class="col-md-4 mb-3">
<div class="col-md-6 mb-3">
<button type="submit" name="submit-redaction-download" class="btn btn-primary w-100">
<i class="bi bi-download me-2"></i> Download Redacted Reports
</button>
Expand Down Expand Up @@ -263,11 +263,11 @@ <h3 class="h5 mb-0">Job {{ job_id }}</h3>
</div>
<div class="progress" style="height: 25px;">
{% if progress_tuple[2] %}
<div class="progress-bar bg-success" role="progressbar" style="width: {{ (progress_tuple[0] / progress_tuple[1]) * 100 }}%;" aria-valuenow="{{ progress_tuple[0] }}" aria-valuemin="0" aria-valuemax="{{ progress_tuple[1] }}">
<div id="progress-{{ job_id }}" class="progress-bar bg-success" role="progressbar" style="width: {{ (progress_tuple[0] / progress_tuple[1]) * 100 }}%;" aria-valuenow="{{ progress_tuple[0] }}" aria-valuemin="0" aria-valuemax="{{ progress_tuple[1] }}">
{{ progress_tuple[0] }} / {{ progress_tuple[1] }}
</div>
{% else %}
<div class="progress-bar bg-danger" role="progressbar" style="width: 100%;" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
<div id="progress-{{ job_id }}" class="progress-bar bg-danger" role="progressbar" style="width: 100%;" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
{{ progress_tuple[0] }} / {{ progress_tuple[1] }} FAILED
</div>
{% endif %}
Expand Down Expand Up @@ -348,8 +348,13 @@ <h3 class="h5 mb-0">Job {{ job_id }}</h3>
var downloadLink = document.getElementById('download-' + job_id);
downloadLink.href = '/reportredactionmetrics/' + job_id;
downloadLink.classList.remove('disabled');
downloadLink.innerText = 'View Metrics';
downloadLink.innerText = '<i class="bi bi-bar-chart-line"></i> View Metrics';
downloadLink.removeAttribute('disabled');

var progressbar = document.getElementById('progress-' + job_id);
progressbar.className = 'progress-bar bg-success';
progressbar.innerText = 'Completed';
progressbar.style.width = '100%';
});

socket.on('progress_failed', function (data) {
Expand Down
7 changes: 4 additions & 3 deletions webapp/templates/report_redaction_metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ <h3>Metrics</h3>
<div class="card-header">
<h3>Experiment Metadata</h3>
</div>
<div class="card-body">
<table class="table table-bordered table-hover">
<div class="card-body p-0">
<table class="table table-bordered table-hover mb-0">
<tbody>
<tr>
<th>Preprocessing Date</th>
Expand All @@ -270,10 +270,11 @@ <h3>Experiment Metadata</h3>
<th>Prompt</th>
<td style="overflow:hidden">{{ metadata['llm_processing']['prompt']}}</td>
</tr>
<!--
<tr>
<th>Symptoms</th>
<td>{{ metadata['llm_processing']['symptoms']}}</td>
</tr>
</tr>-->
<tr>
<th>Temperature</th>
<td>{{ metadata['llm_processing']['temperature']}}</td>
Expand Down

0 comments on commit 9e6f653

Please sign in to comment.