Skip to main content

Collection of discourse segmenters (with pre-trained models for German)

Project description

Build Status MIT License

A collection of various discourse segmenters (with pre-trained models for German texts).

Description

This python module currently comprises three discourse segmenters: edseg, bparseg, and mateseg.

edseg

is a rule-based system that uses shallow discourse-oriented parsing to determine the boundaries of elementary discourse units. The rules are hard-coded in the submodule’s file and are only applicable to German input.

bparseg

is an ML-based segmentation module that operates on syntactic constituency trees (output from BitPar) and decides whether a syntactic constituent initiates a discourse segment or not using a pre-trained linear SVM model. This model was trained on the German PCC corpus, but you can also train your own classifer for any language using your own training data (cf. discourse_segmenter --help for further instructions on how to do that).

mateseg

is another ML-based segmentation module that operates on dependency trees (output from MateParser) and decides whether a sub-structure of the dependency graph initiates a discourse segment or not using a pre-trained linear SVM model. Again, this model was trained on the German PCC corpus.

Installation

To install this package from the PyPi index, run

pip install dsegmenter

Alternatively, you can also install it directly from the source repository by executing:

git clone git@github.com:discourse-lab/DiscourseSegmenter.git
pip install -r DiscourseSegmenter/requirements.txt DiscourseSegmenter/ --user

Usage

After installation, you can import the module in your python scripts (see an example here), e.g.:

from dsegmenter.bparseg import BparSegmenter

segmenter = BparSegmenter()

or, alternatively, also use the delivered front-end script discourse_segmenter to process your parsed input data, e.g.:

discourse_segmenter bparseg segment DiscourseSegmenter/examples/bpar/maz-8727.exb.bpar

or

discourse_segmenter mateseg segment DiscourseSegmenter/examples/conll/maz-8727.parsed.conll

Note that this script requires two mandatory arguments: the type of the segmenter to use (bparseg or mateseg in the above cases) and the operation to perform (which meight be specific to each segmenter).

Evaluation

Intrinsic evaluation scores of the machine learning models on the predicted vectors will be printed when training and evaluating a segmentation model.

Extrinsic evaluation scores on the predicted segmentation trees can be calculated with the evaluation script.

evaluation {FOLDER:TRUE} {FOLDER:PRED}

Note, that the script internally calls the DKpro agreement library, which requires Java 8.

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

dsegmenter-0.2.12.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dsegmenter-0.2.12-py2.py3-none-any.whl (3.9 MB view details)

Uploaded Python 2Python 3

File details

Details for the file dsegmenter-0.2.12.tar.gz.

File metadata

  • Download URL: dsegmenter-0.2.12.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dsegmenter-0.2.12.tar.gz
Algorithm Hash digest
SHA256 29dacc4b78fa26e44be69322f3645517a3bc545dc63193d4e165d8eaa2bc009e
MD5 1e9967b4c45b038b6f57bf800694c901
BLAKE2b-256 23df70ff5b0cfb00e1e161fbd6a1c277005ec052f748ef148751b22dfe1958f6

See more details on using hashes here.

File details

Details for the file dsegmenter-0.2.12-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dsegmenter-0.2.12-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 da26188cf1e11af9127bb73fd2138d4002d41c588d2ee62e94734d8ba5fad200
MD5 a48541e81b5e091c93a498acca27e3dd
BLAKE2b-256 f9f88870a3621b9c4720e6c7feeec400ce62a69a2c0fc9e88a40af3a41ecd23a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page