r/spacynlp • u/paulgureghian • Apr 20 '19
Can I ask a question on SpaCy here ?
I am getting a couple different error messages trying to use SpaCy.
r/spacynlp • u/paulgureghian • Apr 20 '19
I am getting a couple different error messages trying to use SpaCy.
r/spacynlp • u/agrover112 • Jun 24 '19
I'm using my own dataset , not saving it on the disk Saving it itself is giving errors. Moreover none of the examples used give a negative value? What could be the error sources? It is a sentence classifier classifying sentences into VALID and INVALID procedures . Like switch on is a valid procedure Get lost is not a valid procedure.
r/spacynlp • u/GiovaniSalazar • Aug 22 '19
I'm new with Spacy ....but I have some idea about NLP .. I would like know how I can start if I need make a little proyect for identify themas about a text...any idea?
r/spacynlp • u/mridulgarg11 • Nov 21 '16
Hi, could anyone post a link to the full documentation of spacy. Specifically I need to know all attributes of tokens and how I can call them. For eg- Entities has an attribute label_ I want to know what all values can entity take and what other attributes like entity does a token have.
Thanks!
r/spacynlp • u/venkarafa • Dec 15 '19
r/spacynlp • u/venkarafa • Dec 12 '18
r/spacynlp • u/VimosTan • May 01 '19
r/spacynlp • u/[deleted] • Jun 07 '16
Hi,
We are currently evaluating your new German Named Entity Recognizer (great work!!!) and would like to experiment a little with it. We would like to add some features, such as word2vec vectors or the presence of words in gazetteers, and retrain the model. Perhaps you have already tried such approaches? I have taken a look at the code, but haven't found an obvious way to do this, so if you could provide a little example code snippet, that would be great!
Also we would like to incorporate more entity classes. I saw that the annotated corpus also contains a class for miscellaneous entities. Is there a reason you didn't incorporate this in the training? Does including it lower the accuracy of the other classes? For us it would be helpful to be able include this class.
Help would be much appreciated. Great software, by the way! Thanks Mark
r/spacynlp • u/bhavesh91 • Mar 20 '20
r/spacynlp • u/slimprize • Apr 16 '20
Hi all,
I am using spacy in a chat bot. to locate similar questions and outputting their answers. The way the bot works is that it takes a question from the user, tokenizes the question and then searches a target database of questions contained in a pandas data frame. The searching is done via calculating text similarity using spacey.The problem is that the whole bot is slow. I have about 42000 records in total in the data frame. The bot tales over 30 minutes to search half that database. The part that is slow is the similarity calculation. I initialize a single nlp object at the beginning of the bot and then pass that instance to the method which I use to calculate similarity. The method that I use for the similarity calculation is paralyzed via the Pool class in multiprocessing.
The full code of the bot is in the subsequent comments. I am not using a GPU. I am executing the code from within a python virtual environment running on Ubuntu 19.10.
Pranav
r/spacynlp • u/venkarafa • Jan 16 '19
r/spacynlp • u/joknopp • Mar 15 '17
Recently my team tried out spaCy for preprocessing textual data. The claim that it is the fastest Python NLP system around and has "industrial strength" seemed to match our needs, as we process several thousand documents per minute. We solely needed the tokenizer for now, having in mind that we might use more advanced NLP features later. In the following I will describe some problems that we ran into, that put some serious doubt into the stability of the software for a production system.
We built a debian package for spaCy. There is a cascade of dependencies spaCy brings along. There is no distinction between training and classification, thus every library that is used for training also needs to come along on the production machine, even if we didn't need any of them. One library doesn't compile out of the box because of programming errors in the current version (v1.6.0).
spaCy includes a download service for models, which actually tries to save the downloaded model in the spaCy module directory. While that might be considered only bad practice in a user installation, loading code from the web is unacceptable for production environments (though it will fail anyways if there are no serious misconfigurations).
When installing the PyPi spaCy v1.6.0 on any of our machines (Fedora, Ubuntu or debian), the resulting spaCy module is broken. When loading spaCy, it throws an error when the Tagger tries to load the thinc module (which is maintained by the spaCy authors), because "thinc.linear.avgtron.AveragedPerceptron has the wrong size, try recompiling". Obviously the PyPI installation is not tested well, if this can happen. This is unacceptable, since apart from conda and PyPI there is no other packaging of spaCy.
Between v1.4.0 and v1.6.0 in the included German corpus, which we use, stop words have been added/changed, which broke some of our unit tests. Usually, breaking changes should be reflected in a major version change. Apart from that, spaCy currently has a high release rate, and breaking changes every couple of weeks clearly is not usable for industrial applications.
A final detail that annoyed us when working with token matchers:There is no way to match an "any" token. So looking for patterns like "number anything number" needs workarounds.
In spaCy's current state we cannot responsibly deploy it on our production machines. What experiences have others made with regard to stability and reliablity? I would like to hear about it and whether there are plans of improving spaCy for production environments that we should know about.
r/spacynlp • u/Chingababa • Apr 11 '20
Can someone point me towards how I can solve this problem? It's coming from the training data I guess. But i have no idea what's wrong.
r/spacynlp • u/3razOr1312 • Nov 04 '19
Hey guys!
Can someone explain me how the similarity function within the pretrained sm-model is working?
I want to compare two text documents with individual words in it. I have read that the sm-model only include context-sensitive tensors. What is this exactly compared to vectors?
r/spacynlp • u/HeadInTheClouds99 • Jun 25 '19
Hi all
I posted a question to SO would anyone have any tips or suggestions.
Many thanks
r/spacynlp • u/[deleted] • Nov 06 '19
Ty so much for any help! I'm newish to NLP, so I'm just ask all my dumb questions. My impression of the spaCy documentation was that it is written for people very familiar with the underlying NLP concepts, so I was having trouble getting the info I needed from there. My goal is to add some company-specific acronyms to en_core_web_lg so that I can do email classification.
Do named entities have word vectors (assuming you have a model with embeddings/word vectors)?
If so, if I follow the training and updating the NER documentation instructions (assuming I can figure out how lmao), will it generate a word vector for the named entities I add?
Do named entities also appear in the Vocab class as a Lexeme?
How does one efficiently go about creating training data for your new vocabulary in the required format? ie.
TRAIN_DATA = [ ("Who is Shaka Khan?", {"entities": [(7, 17, "PERSON")]}), ("I like London and Berlin.", {"entities": [(7, 13, "LOC"), (18, 24, "LOC")]}), ]
Let's say I have two acronyms (that I need to teach spacy) for individual groups within my company, called abc and dfg. I generate a couple hundred training examples in the format pasted above that teaches spacy to indentify abc and dfg as ORGs. When I run my real training (for the email classification), given that abc and dfg are important for the classification of the emails, will they be treated as seperate entities and used in the way that I intend?
Thanks again! Partial answers or links to other resources are super appreciated as well
r/spacynlp • u/ratatouille_artist • Sep 04 '19
I was wondering if there was a recommended way to construct tests that are testing particular model behaviour?
In my use case I use unittest instead of pytest to run my integration tests which check different properties of a particular model such as how well do they do extracting information from particular examples. Such tests are quite memory hungry and what I find is that using pytest leads to OOM issues.
Are there any good spacy test patterns to make sure memory is managed well when running an integration test suite?
r/spacynlp • u/podar_razvan • Apr 03 '19
Hello! I need to check if the subject of the sentence exist in a list, but I have some problems with this error and I don't understand how can I fix it. I tried to change my spaCy version, but nothing...
My code:
def init(self, user_input):
personal_words = ["I", "ME", "US"]
er = ["YOU"]
pos = pop(user_input)
for token in pos:
if token.dep == nsubj:
subject = token
print(subject)
if any(item in subject for item in personal_words):
personal()
elif any(item in subject for item in er):
era()
else:
n_personal()
Operating System:
Windows
Python Version Used:
3.7.2
spaCy Version Used:
2.0.18
r/spacynlp • u/starsnpixel • Apr 04 '19
I am using SpaCy NER in the context of Open Semantic Search. Is there a way to make SpaCy exclude certain words from a label? Example: In my case, it tends to list "LEO" as an organization which is wrong. Can I somehow tell SpaCy to not show it as an organization? Ideally, even tell it to list it e.g. as a location instead?
I read through the SpaCy documentation but couldn't find a solution. I hope you guys can help me! :)
r/spacynlp • u/raymissa • Apr 05 '19
So I was going to install SpaCy via Cmder, where I run the command "pip3 install -U spacy", and here's the error that I got :
(since the syntax contains around 36000's, can't post it since it's limited only to 10000 in here, so here goes...)
'Command "c:\users\lenovo\venv\scripts\python.exe c:\users\lenovo\venv\lib\site-packages\pip install --ignore-installed --no-user --prefix C:\Users\LENOVO\AppData\Local\Temp\pip-build-env-dz47wrso\overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel>0.32.0.<0.33.0 Cython cymem>=2.0.2,<2.1.0 preshed>=2.0.1,<2.1.0 murmurhash>=0.28.0,<1.1.0 thinc==7.0.0.dev6" failed with error code 1 in None'
EDIT : OK, here's the full log : https://pastebin.com/jWd8CRZc
Anybody know what's wrong?
r/spacynlp • u/ratatouille_artist • Jun 23 '19
Loading spacy models slows down running my tests. I am looking for a way to mock the spacy models or just manually create Doc objects to run some of my unittests. Is there a way to mock spacy for unit testing?
Example test I would like to mock:
import spacy
nlp = spacy.load("en_core_web_lg")
def test_entities():
text = u"Google is a company."
doc = nlp(text)
assert doc.ents[0].text == u"Google"Based on the docs I was thinking about mocking it like this:
from spacy.vocab import Vocab
from spacy.tokens import Doc
def test_entities():
alphanum_words = u"Google is a company".split(" ")
labels = [u"ORG"]
words = alphanum_words + [u"."]
spaces = len(words) * [True]
spaces[-1] = False
spaces[-2] = False
vocab = Vocab(strings=(alphanum_words + labels))
doc = Doc(vocab, words=words, spaces=spaces)
def get_hash(text):
return vocab.strings[text]
doc.ents = tuple([(get_hash(labels[0]), 0, 1)])
assert doc.ents[0].text == u"Google"I was wondering if there was a better way to mock though for unit tests?
r/spacynlp • u/b_holland • Jun 25 '19
Hello all,
We are looking for a good NER tool and spacy came up. I noticed that you can append data to the models and have them update, so it must use some form of a neural net. What is the source of the original training data? I am particularly interested in the data sources for the non-english names that generate the NER model.
Thanks!