使用 `nltk.parse.corenlp.CoreNLPParser` 时自定义标记器

问题描述

我使用 nltk.parse.corenlp.CoreNLPParser 如下:

from nltk.parse.corenlp import CoreNLPParser
parser = CoreNLPParser(url='http://localhost:9000')
parse = next(parser.parse("This is a blue pen.".split()))

它给了一棵树

[Tree('S',[Tree('NP',[Tree('DT',['This'])]),Tree('VP',[Tree('VBZ',['is']),Tree('NP',['a']),Tree('JJ',['blue']),Tree('NN',['pen'])])]),Tree('.',['.'])])]

但是,我想自定义标记器,以便无论出现在何处,始终将一组单词标记NN。有办法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)