Skip to content

Commit d6b00e8

Browse files
committed
Improve some logging in MetaCAT when no suitable category is found (#50)
1 parent f1503c6 commit d6b00e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

medcat-v2/medcat/components/addons/meta_cat/meta_cat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,13 @@ def train_raw(self, data_loaded: dict, save_dir_path: Optional[str] = None,
523523
prerequisites=t_config.prerequisites, lowercase=g_config.lowercase)
524524

525525
# Check is the name present
526-
category_name = category_name = g_config.get_applicable_category_name(
526+
category_name = g_config.get_applicable_category_name(
527527
data_in)
528528
if category_name is None:
529+
in_cat_name = g_config.category_name
529530
raise Exception(
530531
"The category name does not exist in this json file. "
531-
f"You've provided '{category_name}', while the possible "
532+
f"You've provided '{in_cat_name}', while the possible "
532533
f"options are: {' | '.join(list(data_in.keys()))}. "
533534
"Additionally, ensure the populate the "
534535
"'alternative_category_names' attribute to accommodate "

0 commit comments

Comments
 (0)