Comments (2)
similar issue here
from sense2vec.
I've located the source of the issue. Here is the smallest case I can make that demonstrates it.
import spacy
s2v_path = "../s2v_old"
nlp1 = spacy.load("en_core_web_sm")
s2v = nlp1.add_pipe("sense2vec")
s2v.from_disk(s2v_path)
nlp2 = spacy.load("en_core_web_sm")
s2v = nlp2.add_pipe("sense2vec")
s2v.from_disk(s2v_path)
# Uncomment to make pass
# s2v.first_run = False
nlp1("hello world")
nlp2("hello world")
The error gets thrown when evaluating nlp2 in the init_component
call. This call tries to add all the extensions to the Doc object for the convenience s2v functions. The call succeeds if only a single pipeline is created, but the second pipeline tries to add the same extensions and fails. This can be worked around by hacking the first run internal variable on the second instance of the sense2vec component. But this is extremely hacky.
The "correct" solution here is probably to stop trying to be smart about adding the extension functions, and just always add them when the sense2vec library is available. In the case that the sense2vec is not part of the current pipeline, the ._s2v variable will be null and all the calls to the extension functions will fail.
from sense2vec.
Related Issues (20)
- sense2vec own model issue HOT 3
- Hundreds of thousands of files when training new vectors
- last file not saved properly in scripts/01-parse.py HOT 1
- ignore_case option for get_best_sense and get_other_senses does not check for lowercase
- error runing 03_glove_build_counts.py HOT 3
- Is there any way to use "doc.spans" in 01_parse.py?
- cant train sense2vec from scratch HOT 1
- Add keyphrases in custom model
- No Build for m1 Mac HOT 2
- Get most similar senses on multiple senses. HOT 2
- different results on the demo than through the spacy script
- Train sense2vec in Chinese HOT 1
- provide citation HOT 1
- Reproduce https://demos.explosion.ai/sense2vec quality results locally HOT 2
- [Question] Why not Word2Vec? HOT 1
- s2v standalone breaks if require_gpu() is called from spacy (cupy) HOT 2
- how to do vector arithmetic? HOT 4
- import error HOT 4
- Inconsistency between demo and github vectors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sense2vec.