pyknp_eventgraph.relation

class pyknp_eventgraph.relation.Relation(modifier, head, label, surf, head_tid, reliable)[source]

Bases: pyknp_eventgraph.component.Component

A relation connects two events. Relations fall into two major divisions: syntactic and discourse relations. Syntactic relations can be used by application developers to, for example, construct a larger information unit by merging a modifier event to the modifiee, while discourse relations offer more pragmatic information, paving the way for deep language understanding.

modifier: Event

A modifier event.

head: Event

A head event.

label: str

A relation label. Syntactic relation labels include “連体修飾 (adnominal relation,” “補文 (sentential complement,” “並列 (parallel)”, and “係り受け (dependency).” On the other hand, discourse relation labels include “原因・理由 (cause/reason,” “目的 (purpose,” “条件 (condition,” “根拠 (ground,” “対比 (contrast,” and “逆接 (concession).”

surf: str

A surface string.

head_tid: int

A tag ID.

reliable: bool

If true, a syntactic dependency is not ambiguous.

to_dict()[source]

Convert this object into a dictionary.

Return type

dict

to_string()[source]

Convert this object into a string.

Return type

str