Skip to main content

A a development platform for high-level NLP applications in Japanese

Project description

pyknp-eventgraph

EventGraph is a development platform for high-level NLP applications in Japanese. The core concept of EventGraph is event, a language information unit that is closely related to predicate-argument structure but more application-oriented. Events are linked to each other based on their syntactic and semantic relations.

Requirements

  • Python 3.6
  • pyknp: 0.4.1
  • graphviz: 0.10.1

Installation

$ pip install pyknp-eventgraph

or

$ python setup.py install

Use EventGraph as a CLI application

Constructing EventGraph

$ echo '彼女は海外勤務が長いので、英語がうまいに違いない。' | jumanpp | knp -tab | evg -o example-eventgraph.json

Visualizing EventGraph

$ evgviz example-eventgraph.json example-eventgraph.svg

Use EventGraph as a Python library

Constructing EventGraph

from pyknp_eventgraph import EventGraph
from pyknp_eventgraph.utils import read_knp_result_file

# construct EventGraph from a KNP result file
evg = EventGraph.build(read_knp_result_file('example.knp'))

# output EventGraph as a JSON file
evg.save('example-eventgraph.json')

Loading EventGraph

from pyknp_eventgraph import EventGraph

# load EventGraph from a JSON file
with open('example-eventgraph.json', encoding='utf-8', errors='ignore') as f:
    evg = EventGraph.load(f)

Visualizing EventGraph

from pyknp_eventgraph import EventGraph
from pyknp_eventgraph import make_image

# load EventGraph from a JSON file
with open('example-eventgraph.json', 'r', encoding='utf-8', errors='ignore') as f:
    evg = EventGraph.load(f)

# convert EventGraph to its visualization
make_image(evg, 'example-eventgraph.svg')

Authors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyknp-eventgraph-5.0.2.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

pyknp_eventgraph-5.0.2-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file pyknp-eventgraph-5.0.2.tar.gz.

File metadata

  • Download URL: pyknp-eventgraph-5.0.2.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

File hashes

Hashes for pyknp-eventgraph-5.0.2.tar.gz
Algorithm Hash digest
SHA256 a90b8ed5e61024376b71bcc9eeebeeaa804daae1c5baa7e5dfd0a9ea2e37f155
MD5 3b897fa4de46840c1db3fca38dc2cc01
BLAKE2b-256 40472f6233c77ccd0bab693bec7d9193301347e4b70e1730937d2f766004f409

See more details on using hashes here.

File details

Details for the file pyknp_eventgraph-5.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyknp_eventgraph-5.0.2-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

File hashes

Hashes for pyknp_eventgraph-5.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f43c7eb9f50a4cf598816700e97eda9e8b4a965f4786d6cd496e99f47353775d
MD5 08f487e079f2e52290f27f5ad89c3144
BLAKE2b-256 a677df19a6e1ad7f9ae21f8fe25ab83b1166dc95cd07166413dedc1021300dec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page