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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyknp-eventgraph-5.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 248adb3f68c4b7fd02a7064444c137059a75124e6fcedba8f35e4bdeae5de739
MD5 693de26dec7f9a647ed195e67480cf8d
BLAKE2b-256 a44f8a8c9e94baaeb4e7ac684b3f4b7465e720385e557c2a678a7acbaa8b3aeb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyknp_eventgraph-5.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd914941bd2b5cf7ee124acf24199233e01cd604ce993662e7f6172ab6ffc42c
MD5 ad5d4cc21abab1cf4f5f0b93383367e9
BLAKE2b-256 38f5e07838955af3fcb62541373379acfd580157fd84467427a38fb9651dd637

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