Attribute error in similarity method
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
The following code give me a {AttributeError}'NoneType' object has no attribute 'ic':
wordnet.synsets("next", "JJ")[0].similarity(wordnet.synsets("following", "JJ")[0])
This is because the ancestor method can return a None value.
What's the fix? Should the similarity between 2 synsets without common ancestor be 0.0?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the expression using wordnet.synsets(...)[0].similarity(...) and inspect the ancestor and similarity methods that produce the AttributeError. Determine the expected behavior when two synsets have no common ancestor, then add regression coverage for that case and verify the existing similarity behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100