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

$ 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.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

pyknp_eventgraph-5.0.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyknp-eventgraph-5.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 35fdc51263305eb5ceba4e5c86a5ba386c239651e00ab3e02e2f81db9b9abf7a
MD5 1958bdf98c7440d4720f3a23b7acbb97
BLAKE2b-256 f454607c82b67d7ab362bd2b86e7769fcad54b4875962dd0055b49349f917f2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyknp_eventgraph-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abd30f8f90a2bb6976c8a7c7edd11c87761f669578cd340aa4286eb6fbeba851
MD5 0c8a8d5579e3121d23077b509592154c
BLAKE2b-256 c9c9e0d2ad3bf8dfc958fd379d6826f31d0a7f0dfb7a3f3dcca734666073d683

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