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 = $('