Skip to content

Commit

Permalink
Merge branch 'release/27.x'
Browse files Browse the repository at this point in the history
* release/27.x:
  #3909 - Accept best button missing from recommendation sidebar
  • Loading branch information
reckart committed Apr 4, 2023
2 parents 28eb98d + 293feed commit d65a776
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1970,8 +1970,8 @@ private static Optional<Offset> getOffsetsAnchoredOnSentences(CAS aOriginalCas,
if (sentences.isEmpty()) {
// This can happen if a recommender uses different token boundaries (e.g. if a
// remote service performs its own tokenization). We might be smart here by
// looking for overlapping sentences instead of contained sentences.
LOG.trace("Discarding suggestion because no covering sentences were found: {}",
// looking for overlapping sentences instead of covered sentences.
LOG.trace("Discarding suggestion because no covered sentences were found: {}",
aPredictedAnnotation);
return Optional.empty();
}
Expand Down Expand Up @@ -2016,8 +2016,8 @@ static Optional<Offset> getOffsetsAnchoredOnTokens(CAS aOriginalCas,

// This can happen if a recommender uses different token boundaries (e.g. if a
// remote service performs its own tokenization). We might be smart here by
// looking for overlapping tokens instead of contained tokens.
LOG.trace("Discarding suggestion because no covering tokens were found: {}",
// looking for overlapping tokens instead of covered tokens.
LOG.trace("Discarding suggestion because no covered tokens were found: {}",
aPredictedAnnotation);
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@
</div>
</div>
</div>
<div class="card-footer actions text-end">
<button wicket:id="exportModel" class="btn btn-sm btn-secondary">
<i class="fas fa-download"/>
</button>
<button wicket:id="showDetails" class="btn btn-sm btn-secondary">
<i class="fas fa-table"/>
</button>
<button wicket:id="acceptBest" class="btn btn-sm btn-success text-nowrap">
<i class="fas fa-check"/> Accept best
</button>
</div>
</div>
<div class="card-footer actions text-end">
<button wicket:id="exportModel" class="btn btn-sm btn-secondary">
<i class="fas fa-download"/>
</button>
<button wicket:id="showDetails" class="btn btn-sm btn-secondary">
<i class="fas fa-table"/>
</button>
<button wicket:id="acceptBest" class="btn btn-sm btn-success text-nowrap">
<i class="fas fa-check"/> Accept best
</button>
</div>
<div class="clearfix"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,17 @@ protected void populateItem(ListItem<Recommender> item)
resultsContainer.add(new Label("testSampleCount",
evalResult.map(EvaluationResult::getTestSetSize).orElse(0)));

resultsContainer.add(new LambdaAjaxLink("acceptBest",
item.add(resultsContainer);

item.add(new LambdaAjaxLink("acceptBest",
_tgt -> actionAcceptBest(_tgt, recommender))
.setVisible(evaluatedRecommender.map(EvaluatedRecommender::isActive)
.orElse(false)));

resultsContainer.add(new LambdaAjaxLink("showDetails",
_tgt -> actionShowDetails(_tgt, recommender)));
item.add(new LambdaAjaxLink("showDetails",
_tgt -> actionShowDetails(_tgt, recommender))
.setVisible(evalResult.map(r -> !r.isEvaluationSkipped())
.orElse(evalResult.isPresent())));

AjaxDownloadLink exportModel = new AjaxDownloadLink("exportModel",
LoadableDetachableModel.of(() -> exportModelName(recommender)),
Expand All @@ -183,9 +187,7 @@ protected void populateItem(ListItem<Recommender> item)
() -> recommendationService.getRecommenderFactory(recommender).isPresent()
&& recommendationService.getRecommenderFactory(recommender).get()
.isModelExportSupported()));
resultsContainer.add(exportModel);

item.add(resultsContainer);
item.add(exportModel);

item.add(new Label("noEvaluationMessage",
evaluatedRecommender.map(EvaluatedRecommender::getReasonForState)
Expand Down

0 comments on commit d65a776

Please sign in to comment.