I am getting the following Key error when calling:
cat2.train_supervised(data_path=ANNOTATIONS_FILE,
nepochs=1,
reset_cui_count=False,
print_stats=True,
use_filters=True)
Error:
File ~/project/venv/lib/python3.8/site-packages/medcat/cat.py:869, in CAT.train_supervised(self, data_path, reset_cui_count, nepochs, print_stats, use_filters, terminate_last, use_overlaps, use_cui_doc_limit, test_size, devalue_others, use_groups, never_terminate, train_from_false_positives, extra_cui_filter, checkpoint, is_resumed)
866 train_set, test_set, _, _ = make_mc_train_test(data, self.cdb, test_size=test_size)
868 if print_stats > 0:
→ 869 fp, fn, tp, p, r, f1, cui_counts, examples = self._print_stats(test_set,
870 use_project_filters=use_filters,
871 use_cui_doc_limit=use_cui_doc_limit,
872 use_overlaps=use_overlaps,
873 use_groups=use_groups,
…
22 if ‘irrelevant’ in a and a[‘irrelevant’]:
—> 23 i_cuis.add(a[‘cui’])
24 return i_cuis
KeyError: ‘cui’
The annotations file was saved without text, with MedCATrainer 2.5.3.
I am using a model saved with MedCat 1.5.0 after unsupervised training on local Neurlogy documents, based on a KCL fine tuned model created in v1.2.8.