{"id":13557330,"url":"https://github.com/arne-cl/discoursegraphs","last_synced_at":"2025-08-23T03:36:08.442Z","repository":{"id":16357182,"uuid":"19107204","full_name":"arne-cl/discoursegraphs","owner":"arne-cl","description":"linguistic converter / merging tool for multi-level annotated corpora. graph-based (using Python and NetworkX).","archived":false,"fork":false,"pushed_at":"2023-04-15T19:08:57.000Z","size":2949,"stargazers_count":49,"open_issues_count":49,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-27T01:02:05.783Z","etag":null,"topics":["conversion","converter","natural-language-processing","networkx","nlp","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arne-cl.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-04-24T12:15:58.000Z","updated_at":"2023-06-21T09:17:54.000Z","dependencies_parsed_at":"2023-10-20T17:39:37.837Z","dependency_job_id":null,"html_url":"https://github.com/arne-cl/discoursegraphs","commit_stats":{"total_commits":1091,"total_committers":7,"mean_commits":"155.85714285714286","dds":0.384051329055912,"last_synced_commit":"4e14688e19c980ac9bbac75ff1bf5d751ef44ac3"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arne-cl%2Fdiscoursegraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arne-cl%2Fdiscoursegraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arne-cl%2Fdiscoursegraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arne-cl%2Fdiscoursegraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arne-cl","download_url":"https://codeload.github.com/arne-cl/discoursegraphs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223906265,"owners_count":17223046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conversion","converter","natural-language-processing","networkx","nlp","python"],"created_at":"2024-08-01T12:04:17.050Z","updated_at":"2024-11-10T02:55:31.612Z","avatar_url":"https://github.com/arne-cl.png","language":"Python","funding_links":[],"categories":["Python","Software","nlp"],"sub_categories":["Utilities"],"readme":"DiscourseGraphs\n===============\n\n.. image:: http://img.shields.io/pypi/v/discoursegraphs.svg\n   :alt: Latest version\n   :align: right\n   :target: https://pypi.python.org/pypi/discoursegraphs\n.. image:: http://img.shields.io/badge/license-BSD-yellow.svg\n   :alt: BSD License\n   :align: right\n   :target: http://opensource.org/licenses/BSD-3-Clause\n\n.. image:: https://travis-ci.org/arne-cl/discoursegraphs.svg?branch=master\n   :alt: Build status\n   :align: right\n   :target: https://travis-ci.org/arne-cl/discoursegraphs\n.. image:: https://codecov.io/github/arne-cl/discoursegraphs/coverage.svg?branch=master\n   :alt: Test coverage\n   :align: right\n   :target: https://codecov.io/github/arne-cl/discoursegraphs?branch=master\n.. image:: https://www.quantifiedcode.com/api/v1/project/3076854b9ea74bed867f12808d98f437/badge.svg\n   :alt: Code Issues\n   :align: right\n   :target: https://www.quantifiedcode.com/app/project/3076854b9ea74bed867f12808d98f437\n.. image:: https://img.shields.io/docker/build/nlpbox/charniak.svg\n   :alt: Docker build status\n   :align: right\n   :target: https://hub.docker.com/r/nlpbox/charniak\n\n\nThis library enables you to process linguistic corpora with multiple levels\nof annotations by:\n\n1. converting the different annotation formats into separate graphs and\n2. merging these graphs into a single multidigraph (based on the common\n   tokenization of the annotation layers)\n3. exporting your (merged) graphs into several output formats\n4. `visualizing linguistic graphs`_ directly in an `IPython notebook`_\n\n.. _`visualizing linguistic graphs`: http://nbviewer.ipython.org/github/arne-cl/alt-mulig/blob/master/python/discoursegraphs-visualization-examples.ipynb\n.. _`IPython notebook`: http://ipython.org/notebook.html\n\nImport formats\n--------------\n\nSo far, the following formats can be imported and merged:\n\n* `TigerXML`_ (a format for representing tree-like syntax graphs with\n  secondary edges)\n* `NeGra Export Format`_ (a format used i.a. for the TüBa-D/Z Treebank)\n* `Penn Treebank \u003chttp://www.cis.upenn.edu/~treebank/\u003e`_ format (an s-expressions/lisp/brackets format for representing syntax trees)\n* a number of formats for Rhetorical Structure Theory:\n\n  - RS3 (a format used by `RSTTool`_ to annotate documents with Rhetorical Structure Theory)\n  - the .dis \"LISP\" format used by the RST-DT corpus\n  - `URML`_ (a format for underspecified rhetorical structure trees)\n  \n* `MMAX2`_ (a format / GUI tool for annotating spans and connections between\n  them (e.g. coreferences)\n* `CoNLL 2009`_ and `CoNLL 2010`_ formats (used for annotating i.a. dependency parses\n  and coreference links)\n* ConanoXML (a format for annotating connectives, used by `Conano`_)\n* Decour (an XML format used by a corpus of\n  `DEceptive statements in Italian COURts \u003chttp://www.lrec-conf.org/proceedings/lrec2012/pdf/377_Paper.pdf\u003e`_)\n* `EXMARaLDA \u003chttp://exmaralda.org/\u003e`_, a format for annotating spans in spoken\n  or written language\n* an ad-hoc plain text format for annotating expletives (you're probably not\n  interested in)\n\n.. _`TigerXML`: http://www.ims.uni-stuttgart.de/forschung/ressourcen/werkzeuge/TIGERSearch/doc/html/TigerXML.html\n.. _`NeGra Export Format`: http://www.sfs.uni-tuebingen.de/resources/exformat3.ps \n.. _`RSTTool`: http://www.wagsoft.com/RSTTool/\n.. _`URML`: http://www.david-reitter.com/compling/urml/index.html\n.. _`MMAX2`: http://mmax2.sourceforge.net/\n.. _`CoNLL 2009`: http://ufal.mff.cuni.cz/conll2009-st/task-description.html\n.. _`CoNLL 2010`: http://web.archive.org/web/20130119013221/http://www.inf.u-szeged.hu/rgai/conll2010st\n.. _`Conano`: http://www.ling.uni-potsdam.de/acl-lab/Forsch/pcc/pcc.html\n\nExport formats\n--------------\n\ndiscoursegraphs can export graphs into the following formats /\nfor the following tools:\n\n* dot format, which is used by the open source graph visualization software `graphviz`_\n* geoff format, used by the `neo4j`_ graph database\n* `GEXF \u003chttp://gexf.net/format/\u003e`_  and `GraphML \u003chttp://graphml.graphdrawing.org/\u003e`_\n  (common interchange formats for graphs used by various tools such as\n  `Gephi \u003chttps://gephi.github.io/\u003e`_ and `Cytoscape \u003chttp://www.cytoscape.org/\u003e`_)\n* `PAULA XML 1.1 \u003chttps://www.sfb632.uni-potsdam.de/en/paula.html\u003e`_, an exchange format\n  for linguistic data (exporter is still buggy)\n* `EXMARaLDA \u003chttp://exmaralda.org/\u003e`_, a tool for annotating spans in spoken\n  or written language\n* `CoNLL 2009`_ (so far, only tokens, sentence boundaries and coreferences are exported)\n\n\nInstallation\n------------\n\nThis should work on both Linux and Mac OSX using `Python 2.7`_ and\neither `pip`_ or easy_install.\n\n.. _`Python 2.7`: https://www.python.org/downloads/\n.. _`pip`: https://pip.pypa.io/en/latest/installing.html\n\nInstall from PyPI\n~~~~~~~~~~~~~~~~~\n\n::\n\n    pip install discoursegraphs # prepend 'sudo' if needed\n\nor, if you're oldschool:\n\n::\n\n    easy_install discoursegraphs # prepend 'sudo' if needed\n\n\nInstall from source\n~~~~~~~~~~~~~~~~~~~\n\n::\n\n    sudo apt-get install python-dev libxml2-dev libxslt-dev pkg-config graphviz-dev libgraphviz-dev -y\n    sudo easy_install -U setuptools\n    git clone https://github.com/arne-cl/discoursegraphs.git\n    cd discoursegraphs\n    sudo python setup.py install\n\n\nUsage\n-----\n\nThe command line interface of DiscourseGraphs allows you to\nmerge syntax, rhetorical structure, connectives and expletives\nannotation files into one graph and to  store this graph in one of several\noutput formats (e.g. the `geoff`_ format used by the `neo4j`_ graph database\nor the `dot`_ format used by the graphviz plotting tool).\n\n.. _`neo4j`:  http://www.neo4j.org/\n.. _`dot`: http://www.graphviz.org/content/dot-language\n.. _`geoff`: http://www.neo4j.org/develop/python/geoff\n\n\n\n::\n\n    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\n    dot -Tpdf doc.dot \u003e discoursegraph.pdf # generates a PDF from the dot file\n\nIf you're interested in working with just one of those layers, you'll\nhave to call the code directly::\n\n    import discoursegraphs as dg\n    tiger_docgraph = dg.read_tiger('syntax/doc.xml')\n    rst_docgraph = dg.read_rs3('rst/doc.rs3')\n    expletives_docgraph = dg.read_anaphoricity('expletives/doc.txt')\n\nAll the document graphs generated in this example are derived from the\n`networkx.MultiDiGraph`_ class, so you should be able to use all of its\nmethods.\n\n.. _`networkx.MultiDiGraph`: http://networkx.lanl.gov/reference/classes.multidigraph.html\n\n\nDocumentation\n-------------\n\nSource code documentation is available\n`here \u003chttps://pythonhosted.org/pypolibox/\u003e`_, but you can always get an\nup-to-date local copy using `Sphinx`_.\n\nYou can generate an HTML or PDF version by running these commands in\nthe ``docs`` directory::\n\n    make latexpdf\n\nto produce a PDF (``docs/_build/latex/discoursegraphs.pdf``) and ::\n\n    make html\n\nto produce a set of HTML files (``docs/_build/html/index.html``).\n\n.. _`Sphinx`: http://sphinx-doc.org/\n\n\nRequirements\n------------\n\n- `lxml \u003chttp://lxml.de/\u003e`_\n- `networkx \u003chttp://networkx.github.io/\u003e`_\n\nIf you'd like to visualize your graphs, you will also need:\n\n- `graphviz \u003chttp://graphviz.org/\u003e`_\n- `pygraphviz \u003chttp://pygraphviz.github.io/\u003e`_\n\n\nLicense and Citation\n--------------------\n\nThis software is released under a 3-Clause BSD license. If you use\ndiscoursegraphs in your academic work, please cite the following paper:\n\nNeumann, A. 2015. discoursegraphs: A graph-based merging tool and converter\nfor multilayer annotated corpora. In *Proceedings of the 20th Nordic Conference\nof Computational Linguistics (NODALIDA 2015)*, pp. 309-312.\n\n::\n\n    @inproceedings{neumann2015discoursegraphs,\n      title={discoursegraphs: A graph-based merging tool and converter for multilayer annotated corpora},\n      author={Neumann, Arne},\n      booktitle={Proceedings of the 20th Nordic Conference of Computational Linguistics (NODALIDA 2015)},\n      pages={309-312},\n      year={2015}\n    }\n\nAuthor\n------\nArne Neumann\n\n\nPeople who downloaded this also like\n------------------------------------\n\n- `SaltNPepper`_: a converter framework for various linguistic data formats\n- `educe`_: a library for handling discourse-annotated corpora (SDRT, RST and PDTB)\n- `treetools`_: a library for converting treebanks and grammar extraction (supports\n  i.a. TigerXML and Negra/Tüba-Export formats)\n- `TCFnetworks`_: library for creating graphs from annotated text corpora (based on TCF).\n\n.. _`SaltNPepper`: https://korpling.german.hu-berlin.de/p/projects/saltnpepper/wiki/\n.. _`educe`: https://github.com/irit-melodi/educe\n.. _`treetools`: https://github.com/wmaier/treetools\n.. _`TCFnetworks`: https://github.com/SeNeReKo/TCFnetworks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farne-cl%2Fdiscoursegraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farne-cl%2Fdiscoursegraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farne-cl%2Fdiscoursegraphs/lists"}