Questions tagged [spacy]

Industrial strength Natural Language Processing (NLP) with Python and Cython

spaCy is a library for advanced Natural Language Processing in Python and Cython. Its features include tokenization, part-of-speech tagging, dependency parsing, sentence boundary detection, named entity recognition and training of statistical neural network models.


Resources

3742 questions
1
vote
0 answers

Why am I getting no losses when I am training my model using spacy? Is the model not training?

I am creating a blank model that will be used to pass resumes in it, however the model is not training with the training data I am feeding it, since it produces no losses. import spacy import pickle import random train_data =…
1
vote
1 answer

Training with spacy on full dataset

When I train my spacy model as follows spacy train config.cfg --paths.train ./train.spacy --paths.dev ./dev.spacy the model gets trained on train.spacy data file, and scored on dev.spacy. Then output_updated/model-best is the model with the highest…
dzieciou
  • 4,049
  • 8
  • 41
  • 85
1
vote
2 answers

Using spacy to redact names from a column in a data frame

I have a data frame named "df1". This data frame has 12 columns. The last column in this data frame is called notes. I need to replace common names like "john, sally and richard" from this column and replace the values with xxxx or something…
Amicheals
  • 137
  • 1
  • 7
1
vote
1 answer

How to tokenize/parse data in an excel sheet using spacy

I'm trying to convert an excel sheet into a doc object using spacy, I spent the last couple of days trying to go around it but it seems a bit challenging. I have opened the sheet in both openpyxl and pandas, I can read the excel sheet and output…
Tech
  • 13
  • 3
1
vote
1 answer

ujson behaving weirdly during the installation of spacy_readability

I've had difficulty installing spacy_readability which seems to be caused by an old version of ujson. So I have installed the latest version of ujson: !pip install --upgrade ujson --user Requirement already satisfied: ujson in c:\users\desktop…
Abijah
  • 512
  • 4
  • 17
1
vote
1 answer

Installing spacy_readability in jupyter notebook

I am trying to use spacy and some related packages in jupyter !pip install spacy --user works fine, but !pip install spacy_readability --user results in the error: ERROR: Command errored out with exit status 1: command:…
Abijah
  • 512
  • 4
  • 17
1
vote
1 answer

How to install english model of spacy in jupyter notebook using anaconda

When using python -m spacy download en_core_web_sm in anaconda It is showing this error C:\Users\user\anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is…
1
vote
1 answer

How can I find the subject matter of a question?

If I were to have a question like Why Is Raiden Punching Armstrong So Fascinating?, how could I get the subject matter of the question (Raiden Punching Armstrong) programmatically using Python? Using spacy to tokenize the sentence yields the…
ajskateboarder
  • 379
  • 4
  • 11
1
vote
1 answer

Sharing Spacy model between processes

My code is using Python's multiprocessing for parallel computation. As part of the computation Spacy is used. Is it safe to create a single spacy object with nlp = spacy.load("de_core_news_lg") and access it by multiple processes for named entity…
Frederik
  • 1,221
  • 2
  • 13
  • 22
1
vote
1 answer

How can I identify the perpetrator and victim in a sentence using NLP?

I am very new to NLP and am looking for topics to explore that may be able to help me in identifying subjects. Specifically, victim and attacker in the following context: The UK was attacked by China over several weeks Over several weeks, China…
Luke Price
  • 70
  • 5
1
vote
1 answer

How to extract sentences from one text with only 1 named entity using spaCy?

I have a list of sentences and I want to be able to append only the sentences with 1 "PERSON" named entity using spaCy. The code I used was as follows: test_list = [] for item in sentences: #for each sentence in 'sentences' list for ent in…
1
vote
2 answers

How to fix spaCy en_training incompatible with current spaCy version

UserWarning: [W094] Model 'en_training' (0.0.0) specifies an under-constrained spaCy version requirement: >=2.1.4. This can lead to compatibility problems with older versions, or as new spaCy versions are released, because the model may say it's…
Spiral
  • 917
  • 1
  • 9
  • 15
1
vote
1 answer

Spacy dependency parse: negative rules

I'm using the dependency parser to see if a sentence matches a rule with exceptions. For example, I'm trying to find all sentences whose noun subject does not have a complement word (adjective, compound, etc.). A positive case is. The school is…
Song Yang
  • 407
  • 5
  • 14
1
vote
1 answer

How to extract relation between entities for stock prediction

I am trying to extract relation between two entities (entity1- relation- entity2) from news articles for stock prediction. I have used NER for entity extraction. It would be great if anyone could help me with relationship extraction.
1
vote
0 answers

How to initialize tok2vec Transformer with a custom spacy ner model

I have some trouble with the initialization of a tok2vec Transformer with a custom spacy ner model. How do I use tok2vec properly before the ner step starts in the pipeline? Init: nlp = spacy.load("./output_training_11.11") ner =…
llaith
  • 11
  • 1