名词词性标注

2024-04-20 09:31:04 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,有没有一种在非常大的文件中标记词性的有效方法?在

 import pandas as pd
 import collections 
 import nltk 

 tokens=nltk.word_tokenize(pandas_dataframe)
 tag1=nltk.pos_tag(tokens)
 counts=collections.counter([y for x,y  in tag1])

我试图在一个文件中找到最常见的词类,但不知道有更好的方法


Tags: 文件方法标记importdataframepandasascollections