В настоящее время у меня есть текстовые данные с pandas dataframe. Я хотел бы сделать часть речи теги с библиотекой Spacy. Но я не знаю, как импортировать данные загрузки из pandas в Spacy.
Кто-нибудь знает, как загрузить данные из pandas dataframe в Spacy? Спасибо!
Вот мой набор данных:
df = pd.concat([jsons_data,label],axis=1)
text title authors label
0 On Saturday, September 17 at 8:30 pm EST, an e... Another Terrorist Attack in NYC…Why Are we STI... [View All Posts, Leonora Cravotta] Real
1 Story highlights "This, though, is certain: to... Hillary Clinton on police shootings: 'too many... [Mj Lee, Cnn National Politics Reporter] Real
2 Critical Counties is a CNN series exploring 11... Critical counties: Wake County, NC, could put ... [Joyce Tseng, Eli Watkins] Real
3 McCain Criticized Trump for Arpaio’s Pardon… S... NFL Superstar Unleashes 4 Word Bombshell on Re... [] Real
4 Story highlights Obams reaffirms US commitment... Obama in NYC: 'We all have a role to play' in ... [Kevin Liptak, Cnn White House Producer] Real
5 Obama weighs in on the debate\n\nPresident Bar... Obama weighs in on the debate [Brianna Ehley, Jack Shafer]
Это мой код для загрузки данных в Spacy:
import spacy
from dframcy import DframCy
nlp = spacy.load('en_core_web_sm')
dframcy = DframCy(nlp)
doc = dframcy.nlp(df)
annotation_dataframe = dframcy.to_dataframe(doc)
TypeError: Argument 'string' has incorrect type (expected str, got DataFrame)