CoreNLP

所属分类:自然语言处理
开发工具:Lua
文件大小:5KB
下载次数:0
上传日期:2017-08-31 20:59:56
上 传 者sh-1993
说明:  CoreNLP.lua,斯坦福大学CoreNLP的lua客户
(CoreNLP.lua,Lua client for Stanford CoreNLP)

文件列表:
.wercker.yml (1719, 2016-09-05)
LICENSE (1079, 2016-09-05)
corenlp-scm-1.rockspec (439, 2016-09-05)
example.lua (402, 2016-09-05)
mkdocs.yml (288, 2016-09-05)
src (0, 2016-09-05)
src\corenlp.lua (1899, 2016-09-05)

# CoreNLP.lua [![wercker status](https://app.wercker.com/status/b45452b05cfd3aa069569acd38015bda/s/master "wercker status")](https://app.wercker.com/project/bykey/b45452b05cfd3aa069569acd38015bda) Lua client for [Stanford CoreNLP](http://nlp.stanford.edu/software/). ## Installation ```bash git clone https://github.com/vzhong/CoreNLP.lua.git cd CoreNLP.lua && luarocks make ``` ## Usage First, start the [CoreNLP server](http://stanfordnlp.github.io/CoreNLP/): ```bash java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer ``` Next, you can use the Lua client in your program: ```lua local corenlp = require 'corenlp' -- you can optionally give the url to the CoreNLP server. local c = corenlp.Client() -- the first argument is the document, the second argument is the properties field described here: http://stanfordnlp.github.io/CoreNLP/corenlp-server.html local got = c:annotate('the quick brown fox jumped over the lazy dog', {["tokenize.whitespace"] = true, annotators = "tokenize,ssplit,ner"}) -- you'll need prettyprint to see the table content printed. print(got) ``` ## Documentation Documentation is generated via [docroc](http://www.victorzhong.com/docroc) and can be found [here](http://www.victorzhong.com/CoreNLP.lua/) ## FAQ ### My document fails to annotate If this happens on the Lua end and not on the Java end, please file an issue because this is likely a bug. If this happens on the Java end (eg. you see an exception in the Java server), this is most likely because your document's encoding is not supported by CoreNLP. One way to handle this problem is to escape non-UTF8 characters in the document. You can do this via [Lua UTF-8](//github.com/starwing/luautf8), namely via ```lua text = utf8.escape(text) ``` ## Contribution Pull requests are welcome!

近期下载者

相关文件


收藏者