用 JavaScript 寫的 NLP Library

nlp-compromise/nlp_compromise 是一個 JavaScript 寫的 NLP library,網頁上給的用法也很特別...

過去式:

nlp.text('She sells seashells').to_past()
// She sold seashells

複數形:

nlp.noun("dinosaur").pluralize();
// "dinosaurs"

還有這種用法:

nlp.statement('She sells seashells').negate().text()
// She doesn't sell seashells

也有這種用法:

nlp.sentence('I fed the dog').replace('the [Noun]', 'the cat').text()
// I fed the cat

抓人出來:

nlp.text("Tony Hawk did a kickflip").people();
// [ Person { text: 'Tony Hawk' ..} ]

不定冠詞:

nlp.noun("vacuum").article();
// "a"

還可以猜性別?

nlp.person("Tony Hawk").pronoun();
// "he"

str2num:

nlp.value("five hundred and sixty").number;
// 560

好像是好玩的東西... XD

NLP 的應用:PAN 2013

兩個禮拜前在 Slashdot 上看到的「When Writing, How Anonymous Can You Be, Really?」,提到了 PAN Workshop and Competition

PAN 2013 將在明年九月辦,除了一般有的演講以及投稿以外,還包括了三個競賽:

  • Plagiarism Detection
  • Author Identification
  • Author Profiling

三個題目都相當實用... 先紀錄起來,等明年九月再回頭來看?