Comments (5)
Hi, thank you for raising this issue. Please try installing again and let me know if you continue to get the issue.
pip install negspacy --upgrade
I think I fixed the windows decoding issue.
from negspacy.
Replicated the issue on azure and had no issue when installing the new version. Let me know if you're still having the problem. Thanks!
from negspacy.
Thank Jeno for fixing the issue with negspacy install. I was able to install negspacy and import the packages.
Ran:
nlp = spacy.load("en_core_web_sm")
negex = Negex(nlp)
nlp.add_pipe(negex, last=True)
Im trying to see how negation works with different scenarios:
doc = nlp(" Client is not on the Terrorists watchlist.")
Result:
Terrorists True
doc = nlp(" Client is not on the Terrorists Watch list.")
Result:
Terrorists True
doc = nlp(" Client is not on the Terrorist Watchlist.")
Result : NULL
doc = nlp(" Client is not on the Terrorists watch list.")
Result : NULL
doc = nlp(" Client is not on the terrorists watch list.")
Result : NULL
doc = nlp("Client is not affiliated to Soverign citizen.")
Result : Soverign True
doc = nlp("Client is not affiliated to soverign citizen.")
Result : NULL
Could you please check and explain why the negation detection is failing with some texts which is very close to how the successful ones are written? Is there a NER dictionary that is being being used behind the seen to identify Org entities?
Please let me know if there is a way to fix this
from negspacy.
Oh good! I'm glad that issue is resolved.
Yes - You're using the built in spaCy NER in the backend. If you have a specific dictionary of entities you'd like to process, I would suggest using the EntityRuler in spaCy. Just make sure it's added "ahead" of the negation component in the processing pipeline.
This way you could make your own new entities or add patterns to existing ones.
import spacy
from spacy.pipeline import EntityRuler
from negspacy.negation import Negex
nlp = spacy.load("en_core_web_sm")
ruler = EntityRuler(nlp)
patterns = [{"label": "MYENT", "pattern": [{"LOWER": "sovereign"}, {"LOWER": "citizen"}]}]
# add others in patterns list
ruler.add_patterns(patterns)
nlp.add_pipe(ruler)
negex = Negex(nlp)
nlp.add_pipe(negex, last=True)
doc = nlp("Client is not affiliated to sovereign citizen.")
for e in doc.ents:
print(e.text, e._.negex)
from negspacy.
Thank you! Looking forward to enhancements on this. Great work with this package!
from negspacy.
Related Issues (20)
- Error while processing the example HOT 2
- When I use multiprocessing pool.map, word._.negex throws an error as Can't retrieve unregistered extension attribute 'negex' HOT 3
- When running example it returns "Steve Jobs False" HOT 4
- Example from README is not working HOT 3
- Error with the termset HOT 2
- Compatibility with Scispacy HOT 3
- negspacy docs on spacy universe are out of date HOT 1
- Spacy extension error
- extract patterns out the negated entities HOT 1
- Documentation at negspacy's PyPI webpage needs to be updated HOT 1
- Negation of a wrong dependency HOT 4
- Spacy 3.2 support HOT 1
- Negation detection for :No terms HOT 2
- Tagging 'possible' terms
- Spacy 3.3 support
- How can I get this to work? HOT 4
- Applying Negex to Adjectives HOT 4
- pyproject.toml HOT 1
- KeyError: 'es_clinical' HOT 2
- Get the List of Corresponding Negation Terms for a Set of Negated Lexicons
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 negspacy.