Collection of discourse segmenters (with pre-trained models for German)
Project description
A collection of various discourse segmenters (with pre-trained models for German texts).
Description
This python module currently comprises two discourse segmenters: edseg and bparseg.
- edseg
is a rule-based system that uses shallow discourse-oriented parsing to determine boundaries of elementary discourse units in text. 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).
Since the current model is a serialized file and, therefore, likely to be incompatible with future releases of `numpy`, we will probably remove the model files from future versions of this package, including source data instead and performing training during the installation.
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:WladimirSidorenko/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
Note that this script requires two mandatory arguments: the type of the segmenter to use (bparseg in the above case) and the operation to perform (which are specific to each segmenter).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dsegmenter-0.0.1.dev1.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7ae03bb8bdde990f227343bbba54f56c2784deb89f25ee8a3a8ede43098bafd |
|
MD5 | d633d5ecc7fc4a5d89b841cba12f70dc |
|
BLAKE2b-256 | 81d8dda4c97034fce5863fd5e63cd2427276a6eaa5816aedfde47e19e2dd93e3 |