Closed math4humanities closed 3 months ago
From the comment on the method I'd expect this clause to return
[None, None, []]
(note the last item as an empty List). Am I right or does returningmodel_scores=None
make more sense based on where it is called?
No, I think you're right, it doesn't make any more sense returning None. Following the classification task though, there might be a need to also add a check in _add_confidence_to_stories or maybe we can handle the no stories case directly in the classification task, classify_and_post_worker?
Adding in some defensive code to protect against empty story lists sounds smart. Perhaps add some checks in those places you mentioned for extra safety.
fix(classify): add a check for when stories is empty. In response to ValueError Found array with 0 sample(s) (shape=(0, 645)) while a minimum of 1 is required