Package: discoursegraphs
DiscourseGraphsThis library enables you to process linguistic corpora with multiple levels
of annotations by:converting the different annotation formats into separate graphs andmerging these graphs into a single multidigraph (based on the common
tokenization of the annotation layers)exporting your (merged) graphs into several output formatsvisualizing linguistic graphsdirectly in anIPython notebookImport formatsSo far, the following formats can be imported and merged:TigerXML(a format for representing tree-like syntax graphs with
secondary edges)NeGra Export Format(a format used i.a. for the TüBa-D/Z Treebank)Penn Treebankformat (an s-expressions/lisp/brackets format for representing syntax trees)a number of formats for Rhetorical Structure Theory:RS3 (a format used byRSTToolto annotate documents with Rhetorical Structure Theory)the .dis “LISP” format used by the RST-DT corpusURML(a format for underspecified rhetorical structure trees)MMAX2(a format / GUI tool for annotating spans and connections between
them (e.g. coreferences)CoNLL 2009andCoNLL 2010formats (used for annotating i.a. dependency parses
and coreference links)ConanoXML (a format for annotating connectives, used byConano)Decour (an XML format used by a corpus ofDEceptive statements in Italian COURts)EXMARaLDA, a format for annotating spans in spoken
or written languagean ad-hoc plain text format for annotating expletives (you’re probably not
interested in)Export formatsdiscoursegraphs can export graphs into the following formats /
for the following tools:dot format, which is used by the open source graph visualization softwaregraphvizgeoff format, used by theneo4jgraph databaseGEXFandGraphML(common interchange formats for graphs used by various tools such asGephiandCytoscape)PAULA XML 1.1, an exchange format
for linguistic data (exporter is still buggy)EXMARaLDA, a tool for annotating spans in spoken
or written languageCoNLL 2009(so far, only tokens, sentence boundaries and coreferences are exported)InstallationThis should work on both Linux and Mac OSX usingPython 2.7and
eitherpipor easy_install.Install from PyPIpip install discoursegraphs # prepend 'sudo' if neededor, if you’re oldschool:easy_install discoursegraphs # prepend 'sudo' if neededInstall from sourcesudo apt-get install python-dev libxml2-dev libxslt-dev pkg-config graphviz-dev libgraphviz-dev -y
sudo easy_install -U setuptools
git clone https://github.com/arne-cl/discoursegraphs.git
cd discoursegraphs
sudo python setup.py installUsageThe command line interface of DiscourseGraphs allows you to
merge syntax, rhetorical structure, connectives and expletives
annotation files into one graph and to  store this graph in one of several
output formats (e.g. thegeoffformat used by theneo4jgraph database
or thedotformat used by the graphviz plotting tool).discoursegraphs -t syntax/maz-13915.xml -r rst/maz-13915.rs3 -c connectors/maz-13915.xml -a anaphora/tosik/das/maz-13915.txt -o dot
dot -Tpdf doc.dot > discoursegraph.pdf # generates a PDF from the dot fileIf you’re interested in working with just one of those layers, you’ll
have to call the code directly:import discoursegraphs as dg
tiger_docgraph = dg.read_tiger('syntax/doc.xml')
rst_docgraph = dg.read_rs3('rst/doc.rs3')
expletives_docgraph = dg.read_anaphoricity('expletives/doc.txt')All the document graphs generated in this example are derived from thenetworkx.MultiDiGraphclass, so you should be able to use all of its
methods.DocumentationSource code documentation is availablehere, but you can always get an
up-to-date local copy usingSphinx.You can generate an HTML or PDF version by running these commands in
thedocsdirectory:make latexpdfto produce a PDF (docs/_build/latex/discoursegraphs.pdf) andmake htmlto produce a set of HTML files (docs/_build/html/index.html).RequirementslxmlnetworkxIf you’d like to visualize your graphs, you will also need:graphvizpygraphvizLicense and CitationThis software is released under a 3-Clause BSD license. If you use
discoursegraphs in your academic work, please cite the following paper:Neumann, A. 2015. discoursegraphs: A graph-based merging tool and converter
for multilayer annotated corpora. InProceedings of the 20th Nordic Conference
of Computational Linguistics (NODALIDA 2015), pp. 309-312.@inproceedings{neumann2015discoursegraphs,
  title={discoursegraphs: A graph-based merging tool and converter for multilayer annotated corpora},
  author={Neumann, Arne},
  booktitle={Proceedings of the 20th Nordic Conference of Computational Linguistics (NODALIDA 2015)},
  pages={309-312},
  year={2015}
}AuthorArne NeumannPeople who downloaded this also likeSaltNPepper: a converter framework for various linguistic data formatseduce: a library for handling discourse-annotated corpora (SDRT, RST and PDTB)treetools: a library for converting treebanks and grammar extraction (supports
i.a. TigerXML and Negra/Tüba-Export formats)TCFnetworks: library for creating graphs from annotated text corpora (based on TCF).News0.4.14 (2021-03-14)Release date: 14-March-2021minor: renamed fixture for clarity0.4.13 (2021-03-12)Release date: 12-March-2021fix for parsing DPLP trees with only one EDU0.4.12 (2021-02-22)Release date: 22-February-2021added support for StageDP RST parser0.4.11 (2020-12-10)Release date: 10-December-2020fix rs3 parser for files produced by isanlp_rst0.4.10 (2020-06-03)Release date: 06-June-2020added standard RST relations to every rs3 file0.4.9 (2020-05-10)Release date: 10-May-2020added option to write_svgtree() to return SVG image as a string0.4.8 (2020-04-25)Release date: 25-April-2020fixed dependencies in 0.4.70.4.7 (2020-04-23)Release date: 23-April-2020fixed dependencies in 0.4.60.4.6 (2020-04-21)Release date: 21-April-2020added write_svgtree (create SVG files from nltk trees)0.4.5 (2019-05-16)Release date: 12-May-2019fixed rstlatex nested tree generation0.4.4 (2019-05-11)Release date: 11-May-2019fixed rstlatex formatting / inheritance bug0.4.3 (2019-05-10)Release date: 10-May-2019fixed rstlatex file export0.4.2 (2019-05-10)Release date: 10-May-2019fixed dependency in setup.py0.4.1 (2019-04-27)Release date: 27-April-2019added exporter for RST trees in Latex0.4.0 (2019-04-25)Release date: 25-April-2019almost three years of additions/fixes (mostly RST-related importers/exporters,
e.g. URML, dis, rs3, HILDA, DPLP, Heilman and Sagae (2015))0.3.2 (2016-05-30)Release date: 30-May-2016second attempt to fix the distribution of the data directory with the packageadded exporter forFREQT, which extracts frequent embedded subtrees0.3.1 (2016-05-07)Release date: 7-May-2016attempt to fix the distribution of the data directory with the packagedocument graphs can be converted into PTB-style strings (readwrite/tree.py)node/edge collections are now ordered (OrderedDict)0.3.0 (2016-04-30)Release date: 30-April-2016almost two years and countless commits later, finally a new official releaseadded lots of importers and exporters and simplified the APIadded 80+ tests (py.test), continuous integration (Travis) and docker support0.1.2 (2014-05-13)Release date: 13-May-2014added basicGeoffandNeo4jexporter (not yet available via the command
line)added sphinx-based documentation0.1.1 (2014-04-25)Release date: 25-Apr-2014small improvementsadded usage examples to readmediscoursegraphs script now uses the commandline interface of the merging module0.1.0 (2014-04-24)Release date: 24-Apr-2014first public releaseimports: RS3, TigerXML and an ad-hoc format for expletive annotationmerge these formats/files into a single multidigraphgenerates simple dot/graphviz-based visualization