explosion / explosion/sense2vec

plug sense2vec it into your spaCy pipeline

Open
#141 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
236
PR merge metrics
No merged PRs in 30d

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'

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.