How to apply pos_tag_sents() to pandas dataframe efficiently

后端 未结 3 1436
深忆病人
深忆病人 2020-12-06 11:14

In situations where you wish to POS tag a column of text stored in a pandas dataframe with 1 sentence per row the majority of implementations on SO use the apply method

3条回答
  •  抹茶落季
    2020-12-06 11:44

    Assign this to your new column instead:

    dfData['POSTags'] = pos_tag_sents(dfData['SourceText'].apply(word_tokenize).tolist())
    

提交回复
热议问题