我只想从此数据集中提取名词:
Text1 Text2
see if your area is affected afte... public health england have confir...
'i had my throat scraped'. i have been producing some of our...
drive-thru testing introduced at w... “a painless throat swab will be t...
live updates as first case confirm... the first case in ...
hampton hill medical centre love is actually just ...
berkshire: public health england a... an official public health england...
我需要在Text2中应用POS,以便只提取ADV
ans=[]
for x in
tagger = treetaggerwrapper.TreeTagger(TAGLANG="en", TAGDIR='path')
tags = tagger.tag_text(x)
ans.append(tags)
pprint(treetaggerwrapper.make_tags(tags))
但是我没有包括这个专栏,因为我不知道我应该放什么(e.g. df['Text 2'].tolist()
)
我需要的是从文本中提取副词,并将它们添加到新的数组/空列表中。 我希望你能帮助我
对于这样的工作,我更喜欢通过谷歌Colab搜索spAcy。对于这类任务,我一般更喜欢spAcy
如果你想在看到我的答案之前试一下,看看这里。 https://spacy.io/usage/linguistic-features
如果可以,您可以pip安装
我们这里只使用熊猫和spAcy,不需要其他软件包
重新创建DF
抓取字符串并初始化空间
接下来,我将所有内容都写入函数中
最终产品将根据您的问题要求提供副词列表
相关问题 更多 >
编程相关推荐