Skip to main content

Tools for processing treebank trees

Project description

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/dd9c9290ba414e54a6fa6be48e2543de)](https://app.codacy.com/manual/wmaier/treetools?utm_source=github.com&utm_medium=referral&utm_content=wmaier/treetools&utm_campaign=Badge_Grade_Dashboard) [![Build Status](https://travis-ci.org/wmaier/treetools.svg?branch=master)](https://travis-ci.org/wmaier/treetools) [![Requirements Status](https://requires.io/github/wmaier/treetools/requirements.svg?branch=master)](https://requires.io/github/wmaier/treetools/requirements/?branch=master) [![PyPI version](https://badge.fury.io/py/treetools.svg)](https://badge.fury.io/py/treetools) [![Github All Releases](https://img.shields.io/github/downloads/kotlin-graphics/kotlin-unsigned/total.svg)]()

# treetools - tree processing

treetools is a collection of tools for processing treebank trees. It contains algorithms for tree manipulation (such as removal of crossing branches), tree analysis, and grammar extraction.

treetools has been developed at the Department for Computational Linguistics at the Institute for Language and Information at the University of Düsseldorf, Germany (see <http://phil.hhu.de/beyond-cfg>). The project is sponsored by Deutsche Forschungsgemeinschaft (DFG). It is maintained by Wolfgang Maier.

Author: Wolfgang Maier <mailto:maierw@hhu.de>. Contributions: Kilian Gebhardt

## Installation

Requirements:

  • Python 3.7+

To install the latest release from the Python package index, type:

pip install treetools --user

To install the latest version clone the git repository and run:

python setup.py install --user

within the repository directory.

If you have superuser privileges and want to perform a system-wide installation, omit the –user option, respectively.

## Running

### Syntax

To run treetools, type:

treetools [subcommand] [parameters] [options]

Available subcommands are:

  • transform: Process treebank trees. Run transformations and convert between different formats.

  • grammar: Extract grammars for different parsers from treebanks.

  • treeanalysis: Analyze certain properties of treebank trees, such as, e.g., gap degree.

To get see the available parameters for a subcommand, type:

treetools [subcommand] --help

To get verbose help on available transformation algorithms, available options, etc., type:

treetools [subcommand] --usage

### Examples

To attach the punctuation in TIGER and remove its crossing branches while converting it from TigerXML to the export format, type:

treetools transform tiger.xml tiger.continuous.export --trans root_attach negra_mark_heads boyd_split raising --src-format tigerxml --dest-format export

To extract the bare sentences (one per line) from a treebank in bracketed format, such as the Penn Treebank, type:

treetools transform treebank.brackets treebank.terminals --src-format brackets --dest-format terminals

To delete the traces and co-indexation from the Penn Treebank, type:

treetools transform ptb ptb.notrace --transform ptb_transform --src-format brackets --dest-format brackets

To extract an left-to-right binarized LCFRS with v1/h2 markovization in rparse format from an export-format treebank, type:

treetools grammar input_treebank output_grammar leftright --dest-format rcg --markov v:1 h:2

### License

The code is released under the GNU General Public Licence (GPL) 3.0 or higher. The license texts can be found at at <http://www.gnu.org/licenses/gpl-3.0>.

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

treetools-0.4.0.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

treetools-0.4.0-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

Details for the file treetools-0.4.0.tar.gz.

File metadata

  • Download URL: treetools-0.4.0.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for treetools-0.4.0.tar.gz
Algorithm Hash digest
SHA256 676737065b98973275e77100920af38bc82d1e589d751d27468636d2de43e9a9
MD5 7de98f8cb808b7a4a13292ae8517c5f5
BLAKE2b-256 d705fa52f3feae5fcc3e81354031ce615eebbdc99682ad524c95e5b173aab8a8

See more details on using hashes here.

File details

Details for the file treetools-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: treetools-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 56.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for treetools-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 608280edfb4e9dbd3300b792ed10b477ee4cbc2257a0b42a2fa2021a029d1693
MD5 055e0302f38c02422da4e5bc6315212f
BLAKE2b-256 6611a60d8dff8c913a2027a876a5b3ae29f3e6795c5a06f28fbfcbff5b0be3e8

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