我已经使用了stanford coreNLP的标记器将句子标记为标记。现在,我需要取消标记已经标记的单词(即,我需要对standford coreNLP使用反向标记程序。)standfordcoreNLP或我们可以使用的Java / python API中是否有任何JAVA类?
I/P:
I ca n't use this pen .
I have ( 5 ) points to explain .
I have discuss the 1,2,3 etc. ..
O/P:
I can't use this pen.
I have (5) points to explain.
I have discuss the 1,2,3 etc...
答案 0 :(得分:1)
Simple API中的Sentence
类具有多个构造函数,one of which采用一个List<String>
参数。
因此您可以执行以下操作:
List<String> words = new Sentence("I can't use this pen.").words();
Sentence output = new Sentence(words);