Use KNP as a Universal Dependency parser with spaCy

The other day, we released the spaCy plugin Camphr version 0.5.20. The main feature of this time is [universal dependency] from the analysis result of KNP implemented by Professor Koichi Yasuoka of Kyoto University. It is a function to output the label of (https://universaldependencies.org/). This article will briefly introduce how to use it.

Installation

  1. Install knp on the system or [KNP docker image](https://github.com/tamuhey/dockerfiles/ pull packages / 171202)
  2. $ pip install camphr[juman]

analysis

import camphr
import spacy
nlp = camphr.load("knp")
doc = nlp("Taro went to Mt. Fuji while eating apples and oranges.")
spacy.displacy.render(doc)

image.png

"Apple" and "mandarin orange" are connected by conj (conjunct), which is a wonderful analysis result. Please read Yasuoka-sensei's blog for an explanation of this conj.

It was easy, but the function introduction is over. In addition to UD, Camphr provides KNP-based functions such as named entity recognition. Please read the following documents for details. Camphr KNP document

Acknowledgments

This function was implemented by Professor Koichi Yasuoka of Kyoto University. Thank you for your cooperation.

References

Recommended Posts

Use KNP as a Universal Dependency parser with spaCy
Use Remotte as a user
Use pymol as a python library
Use blender as a python module
Use a custom kernel with WSL2
Install Python as a Framework with pyenv
[IOS] Use a shared sheet with Pythonista3.
Use the e-paper module as a to-do list
How to use python multiprocessing (continued 3) apply_async in class with Pool as a member