decomp.semantics.predpatt¶
Module for converting PredPatt objects to networkx digraphs
- class decomp.semantics.predpatt.PredPattCorpus(graphs_raw)¶
Container for predpatt graphs
- classmethod from_conll(corpus, name='ewt', options=None)¶
Load a CoNLL dependency corpus and apply predpatt
- Parameters
corpus (
Union
[str
,TextIO
]) – (path to) a .conllu filename (
str
) – the name of the corpus; used in constructing treeidsoptions (
Optional
[PredPattOpts
]) – options for predpatt extraction
- Return type
- class decomp.semantics.predpatt.PredPattGraphBuilder¶
A predpatt graph builder
- classmethod from_predpatt(predpatt, depgraph, graphid='')¶
Build a DiGraph from a PredPatt object and another DiGraph
- Parameters
predpatt (
PredPatt
) – the predpatt extraction for the dependency parsedepgraph (
DiGraph
) – the dependency graphgraphid (
str
) – the tree indentifier; will be a prefix of all node identifiers
- Return type
DiGraph