I recently ran into a strange behavior while using spacy, which is when I process string,
in case the string is a single string object, I have to use nlp(string),
while I have to use nlp.pipe(a list) for a list made of strings elements.
The example is as below.
string='this is a string to be process by nlp'
doc =['this','is','a','string','list','to','be','processed','by','spacy']
stringprocess= list(nlp(string))
listprocess = list(nlp.pipe(doc))
listprocess
stringprocess
Why is this? I assume this must be something to do with nlp.pipe() behavior which is generator.
What is the reason?
Thank you.