explosion / explosion/spacy-llm
ValueError: max() arg is an empty sequence
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
Just upgraded from 0.6.2 to 0.71 and my script doesn't run anymore. I get the error:
`ValueError: max() arg is an empty sequence`
This is the function causing the issue:
```
def classify_content_by_speaker(content):
doc = nlp(content)
category = max(doc.cats, key=doc.cats.get)
speaker = speaker_mapping.get(category, "Unknown Speaker")
reason = f"Assigned to {speaker} based on LLM classification for category {category}."
return {'speaker': speaker, 'reason': reason}
```
Downgrading back to 0.6.2 fixes the issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the provided classify_content_by_speaker function with spaCy-LLM 0.71, then compare its behavior with version 0.6.2, focusing on why doc.cats is empty. Trace the classification result and identify the expected behavior for this upgrade; done means the regression is explained and a verified fix or compatibility guidance is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100