簡體   English   中英

斯坦福 CoreNLP 的去令牌化

[英]Detokenization for Stanford CoreNLP

我使用了 stanford coreNLP 的分詞器將句子分詞為分詞。 現在我需要對已經分詞的單詞進行去分詞(即我需要為標准 coreNLP 進行反向分詞。)我們可以使用標准核心 NLP 或 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... 

Simple API 中的Sentence類有多個構造函數, 其中一個帶有List<String>參數。

因此,您可以執行以下操作:

List<String> words = new Sentence("I can't use this pen.").words();
Sentence output = new Sentence(words);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM