For questions specific to spaCy version 3, an Industrial-Strength Natural Language Processing tool in Python. Use the more generic tag `spacy` for general questions about the spaCy.
Questions tagged [spacy-3]
334 questions
3
votes
2 answers
ImportError loading spacy in jupyter notebook
I got a problem I can't seem to figure out. The first time I imported Spacy into a Jupyter notebook I had no problems. It just imported it as I expected.
The second time I tried to import it (using a different notebook) I got:
ImportError: cannot…

SomeDutchGuy
- 2,249
- 4
- 16
- 42
2
votes
0 answers
How to get the Corresponding Negation Terms used for a Set of Detected Negated Lexicons in NegSpacy?
I am working on a project with a clinical dataset. So far, I was able to detect all the diagnoses and whether they are negated or not. But, what I really like to get as well, is the negation term used to detect each negated lexicon. For…

mehrnoosh azizi
- 21
- 2
2
votes
0 answers
I want to use a crf ner inside my spacy pipeline (spacy 3)
I have trained a crf model and stored it locally using joblib. I want to use this model inside in place of default spacy ner. I tried it using spacy_crfsuite, but I get an attribute error. Any ideas?
import spacy
from spacy.language import…

Fiesty_Anywhere
- 31
- 3
2
votes
1 answer
Python spacy issue when training :ValueError: Found array with 0 feature(s) (shape=(n, 0)) while a minimum of 1 is required by SVC
I am running into a value error that my array is incorrect, which is extremely strange since I have confirmed that my array is not zero. I printed out the 'len' of each feature and training set. Found array with 0 feature(s) (shape=(7, 0)) while a…

user3655574
- 692
- 2
- 9
- 27
2
votes
0 answers
spaCy on PySpark and Dataproc: numpy.ndarray size changed, may indicate binary incompatibility
I was dealing with a previous error when trying to perform some Named Entity Recognition with spaCy, relying on Dataproc + PySpark. I have created a brand-new cluster, to deal with "insufficient local disk space", as mentioned in the comments of…

David Espinosa
- 760
- 7
- 21
2
votes
1 answer
Building on existing models on spacy
This is a question regarding training models on SPACY3.x.
I couldn't find a good answer/solution on StackOverflow hence the query.
If I am using the existing model in spacy like the en model and want to add my own entities in the model and train it,…

ary
- 159
- 1
- 8
2
votes
2 answers
How to remove/add entities in a custom entity ruler in spaCy 3.x
I have a custom entity ruler added to the spacy "en_core_web_sm" model. I want to add or remove entities in it when needed. This question has already been answered here, however I believe that is not correct as the person is talking about the ner…

nomans_
- 68
- 4
2
votes
1 answer
How do I view the spacy NER softmax values?
I'm trying to obtain the softmax predictions for each output class from the spacy NER model. When I place a break point at 'preds' in the code below and skip through the pipeline until the predict method is being called on the NER model pipeline…

wind_junkie
- 59
- 6
2
votes
1 answer
Spacy : apply pipeline to each row of a dataframe
I have a big dataframe (over 20 000 rows) and I want to apply Spacy (v3) to it. I need all the components of the spacy pipeline. I already tried with apply (row-wise) but it takes forever:
df = pd.read_csv(f, sep='\t',…

Artemis
- 145
- 7
2
votes
0 answers
Extract information from a text using SpaCy
I want to build a model that extracts personal data collected by a website.
The first step, I scrapped the privacy policy of a website, then I split it into sentences and put them on a dataframe as shown in the image below:
image
From those…

Adrian
- 31
- 3
2
votes
0 answers
How to create a confusion matrix for a NER Spacy model?
I want to develop a confusion matrix for my model, but I'm not sure how to go about it or which variable to use. Since my model has two functions one for training and the other for testing I'm not sure if I should make the confusion matrix for both…

Alter__
- 21
- 2
2
votes
1 answer
Splitting SpaCy Docs into sentences in custom pipeline component
I am building a SpaCy pipeline and would like to split sentences into individual Doc objects. According to the SpaCy documentation, custom pipeline components take a single Doc object as input and return a single Doc object. However, I would like to…

Thet Naing
- 33
- 4
2
votes
2 answers
Error while importing 'en_core_web_sm' for spacy in Azure Databricks
I am getting an error while loading 'en_core_web_sm' of spacy in Databricks notebook. I have seen a lot of other questions regarding the same, but they are of no help.
The code is as follows
import spacy
!python -m spacy download en_core_web_sm
…

Tinniam V. Ganesh
- 1,979
- 6
- 26
- 51
2
votes
1 answer
Spacy Confidence Score in SpanCategorizer
I have trained a Spacy nlp model with a 'spancat' model.
For testing the model, I have added the code below for prediction of spans and label
nlp = spacy.load('output_/model-best')
rest = 'The book was of red colour'
doc1 =…

nifeco
- 211
- 1
- 8
2
votes
1 answer
Custom segmentation and override segmentation rules in spacy
I want to split into sentences a large corpus (.txt) with a custom rule i.e. {SENT} using Spacy 3.1.
My main issue is that I want to "disable" the segmentation from the pretrained spacy models with spacy i.e. en_core_web_lg but keep all the other…

Artemis
- 145
- 7