Skip to content
Discussion options

You must be logged in to vote

Hi @Frazer-Nyambe ,

You need to iterate over your pandas columns first, maybe by using df.iterrows or df.items. Also, if you already have the raw text, you don't have to convert it into a DataFrame. You can work with the texts as a string right away.

To convert it into a spaCy Doc. you can pass it to a pipeline. You also need to provide a model (e.g. en_core_web_lg) like so:

import spacy

nlp = spacy.load("en_core_web_lg")
for text in texts:
    doc = nlp.pipe(text)

I highly-recommend looking at the getting started and API documentation for more info.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by adrianeboyd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General spaCy usage
2 participants