I wanted to use JUMAN ++ and KNP for dependency analysis, but since I only have a windows PC at hand, I built an environment using Docker for Windows. It was hard work by hand, so I wanted to be able to use pyKNP as well.
A brief explanation.
--It inherits python's 3-stretch. --Japaneseized --pyKNP is not included in the initial state. ――It's big. I have 3GB ...
Basically, connect the standard output of the container and use JUMAN ++ and KNP in the container.
/ Bin / bash
is specified for CMD.
docker run -it --name jumanpp_knp yusanish/jumanpp_knp:latest
root@CONTAINER_ID:~#
root@CONTAINER_ID:~# echo "Today's rice is curry." | jumanpp | knp
Today's<Words><NE:DATE:today>
The rice is<Words>
It's curry.<Words><Words:Size><Case analysis result:Moth/rice;Moth2/->
EOS
root@CONTAINER_ID:~#
[Click here for how to install pyKNP. ](Http://qiita.com/riverwell/items/7a85ebf95647eaf18a6c#pyknp%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3% 83% BC% E3% 83% AB)
Very simple sample
>>> import pyknp
>>> knp = pyknp.KNP()
>>> knp = pyknp.KNP(jumanpp=True)
>>> result = knp.parse("Today's dinner was curry.")
>>> result.draw_bnst_tree()
The functions and variables that can be used are summarized here in detail. Notes about pyKNP
--JUMAN ++ container yamitzky / jumanpp -Use JUMAN ++ from Python -Prepared the Japanese environment for the Debian container set up with Docker
Recommended Posts