text_html_output_1.png
from sklearn.model_selection import train_test_split

import os

import pandas as pd

import spacy

pd.set_option('display.max_colwidth', None)

folder = '../input/nlp-getting-started'
test = pd.read_csv(os.path.join(folder, 'test.csv'), index_col='id')
train = pd.read_csv(os.path.join(folder, 'train.csv'), index_col='id')
X = train.drop(columns='target')
y = train['target']
X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.33, random_state=42)

nlp = spacy.load('en_core_web_sm')

doc = nlp(X['text'].iloc[0])

for token in doc:
    print(token.text, token.lemma_, token.dep_, token.pos_)