This web application tokenizes Vietnamese text using VnCoreNLP library.
- Copy VnCoreNLP models (including
models/
) to<tomcat location>/bin
. - Copy
VnCoreNLP-1.1.1.jar
to<tomcat location>/lib
. - Run the web application.
const input = "Ông Nguyễn Khắc Chúc đang làm việc tại Đại học Quốc gia Hà Nội. Bà Lan, vợ ông Chúc, cũng làm việc tại đây.";
const requestOptions = {
method: 'POST',
headers: new Headers({"Content-Type": "text/plain;charset=utf-8"}),
body: input
};
fetch("http://localhost:8080/<context>/word_tokenizer", requestOptions)
.then(response => response.text())
.then(result => console.log(result));
/* result
[
"Ông",
"Nguyễn_Khắc_Chúc",
"đang",
"làm_việc",
"tại",
"Đại_học",
"Quốc_gia",
"Hà_Nội",
".",
"Bà",
"Lan",
",",
"vợ",
"ông",
"Chúc",
",",
"cũng",
"làm_việc",
"tại",
"đây",
".",
]
*/