Extract entity from dataframe using spacy
问题 I read contents from excel file using pandas:: import pandas as pd df = pd.read_excel("FAM_template_Update 1911274_JS.xlsx" ) df While trying to extract entities using spacy:: import spacy nlp = spacy.load("en_core_web_sm") doc = nlp(df) for enitity in doc.ents: print((entity.text)) Got Error:: TypeError: Argument 'string' has incorrect type (expected str, got DataFrame) On line(3)-----> doc = nlp(df) 回答1: This is expected as Spacy is not prepared to deal with a dataframe as-is. You need to