The aim of this project to provide a unified access to Hungarian NLP tools. As such it provides wrapper classes and a REST API. Currently the project integrates:
Before running the application, make sure you have at least 3GB free memory.
You can compile the library locally: $ make dependencies install
(You would need Oracle Java 8 and Maven.)
Or find zipped jars here
Alternatively, you can directly use the prebuilt docker image: $ docker pull oroszgy/hunlp
In case you directly compiled the sources: $ make serve
Having the binairies downloaded: $ hunlp.sh
Or running the docker container: $ docker run -it -p 9090:9090 oroszgy/hunlp
Through the REST API
$ curl -X POST -H "Content-Type: application/json" -d '{"text": "Szia világ!"}' "http://localhost:9090/v1/annotate"
Java
import hu.nlp.api.HuNlp;
class MainApp {
public static void main(String args[]) {
HuNLlp nlp = new HuNlp();
Document doc = nlp("Ez itt egy példa. Vajon működik?");
}
}
Kotlin
import hu.nlp.api.HuNlp
fun main(args: Array<String>) {
val nlp = HuNlp()
val doc: Document = nlp("Ez itt egy példa. Vajon működik?")
}
Python
Make sure you installed the wrapper: pip install https://github.com/oroszgy/hunlp/releases/download/0.2/hunlp-0.2.0.tar.gz
from hunlp import HuNlp
nlp = HuNlp()
doc = nlp("Ez itt egy példa. Vajon működik?")
print(doc.ents)
for sent in doc:
for tok in sent:
print(tok.text, tok.lemma, tok.tag)
Experimental Kotlinization
First experimental release containing magyarlanc (21-01-2016) and Szeged NER (20-06-2014).
HuNLP is licensed under LGPL3, however libraries integrated might use different (commercial) licenses:
- magyarlanc license
- Szeged NER builds upon Mallet
(c) Gyorgy Orosz, 2017