From 999d41969882555dc3c8d3360f5d5a39978356da Mon Sep 17 00:00:00 2001 From: Zdenek Kasner Date: Mon, 23 Dec 2024 18:10:40 +0100 Subject: [PATCH] Minor fixes --- factgenie/static/js/campaigns.js | 8 ++- factgenie/static/js/example-annotation.js | 52 +++++++++++++------ factgenie/static/js/span-annotator.js | 3 ++ .../crowdsourcing/annotate_body.html | 2 +- .../templates/pages/crowdsourcing_new.html | 1 - 5 files changed, 47 insertions(+), 19 deletions(-) diff --git a/factgenie/static/js/campaigns.js b/factgenie/static/js/campaigns.js index 56004eb..89a173b 100644 --- a/factgenie/static/js/campaigns.js +++ b/factgenie/static/js/campaigns.js @@ -53,6 +53,12 @@ function createLLMCampaign() { const config = gatherConfig(); var campaignData = gatherSelectedCombinations(); + // if no annotation categories are created, show an alert + if (mode != "llm_gen" && config.annotationSpanCategories.length == 0) { + alert("Please add at least one annotation span category."); + return; + } + // if no datasets are selected, show an alert if (campaignData.length == 0) { alert("Please select at least one existing combination of dataset, split, and output."); @@ -635,7 +641,7 @@ function updateLLMMetricConfig() { $("#annotation-span-categories").empty(); annotationSpanCategories.forEach((annotationSpanCategory) => { - createAnnotationSpanCategoryElem(annotationSpanCategory.name, annotationSpanCategory.description, annotationSpanCategory.color); + addAnnotationSpanCategory(annotationSpanCategory.name, annotationSpanCategory.description, annotationSpanCategory.color); }); } if (mode == "llm_gen") { diff --git a/factgenie/static/js/example-annotation.js b/factgenie/static/js/example-annotation.js index ce4a89e..92e1ab6 100644 --- a/factgenie/static/js/example-annotation.js +++ b/factgenie/static/js/example-annotation.js @@ -82,7 +82,7 @@ function createButtons() { }); const label = $('