plug sense2vec it into your spaCy pipeline
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start by reproducing the reported setup with spacy.load(), nlp.add_pipe("sense2vec"), and the initialize.components.sense2vec configuration. Compare the duplicate _s2v extension error with the later NoneType get_freq error when accessing doc spans. Done means the documented custom sense2vec pipeline loads and the reported frequency, vector, and similarity calls work.
Written by the indexing model from the issue text.
Description
I want to add my own sense2vec to my own spacy model, as you wrote in documentation,
I add that to my current pipeline
[initialize.components]
[initialize.components.sense2vec]
data_path = "/path/to/s2v"
then
nlp = spacy.load("../data/ModelV05b/model-best")
nlp.add_pipe("sense2vec")
s2v.from_disk("../data/S2VFasttextV04")
it does not work , since it says that
[E090] Extension '_s2v' already exists on Doc. To overwrite the existing extension, set `force=True` on `Doc.set_extension`.
since sense2vec is`in nlp.component_names
['tok2vec',
'tagger',
'parser',
'ner',
'attribute_ruler',
'lemmatizer',
'sense2vec']
then I changed to my model
nlp = spacy.load("../data/ModelV05b/model-best")
still it does not work and it says
doc = nlp2("The testimony of the ages confirms that the motions of the planets are orbicular.")
assert doc[1:2].text == "testimony"
freq = doc[1:2]._.s2v_freq
vector = doc[1:2]._.s2v_vec
most_similar = doc[1:2]._.s2v_most_similar(3)
and it says that
AttributeError: 'NoneType' object has no attribute 'get_freq'
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 236
- PR merge metrics
- No merged PRs in 30d
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.
More from explosion/sense2vec
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
import error Openusage
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
usage
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
provide citation Open
Difficulty 1/5 Under an hour Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in explosion/sense2vec
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100