This release is a pre-release and may not be stable for production use.
cltl-dialogueclassification
Description
Detects dialogue acts in texts and annotates the signals with the dialogue act labels and scores. The annotations are pushed to the event bus and can be taken up for further processing.
We implemented three dialogue act classifiers:
- Deberta fine-tuned with the SILICONE data set:
Based on: https://huggingface.co/diwank/silicone-deberta-pair
- RoBERTa fine-tined with the MIDAS data set:
Based on: https://github.com/DianDYu/MIDAS_dialog_act
- XLM-RoBERTa fine-tuned with the MIDAS data set:
Based on: https://github.com/DianDYu/MIDAS_dialog_act
Getting started
Prerequisites
This repository uses Python >= 3.9
Be sure to run in a virtual python environment (e.g. conda, venv, mkvirtualenv, etc.)
Installation
-
In the root directory of this repo run
pip install -e .
-
Download the fine-tuned RoBERTA model from:
https://vu.data.surfsara.nl/index.php/s/xLou1DPl739Lbq6
and put the file "classifier.pt" in the directory:
resources/midas-da-roberta
Alternatively, download the XLM-roberta from:
https://vu.data.surfsara.nl/index.php/s/dw0YCJAVFM870DT
and put the "pytorchmodel.bin" in the directory:
resources/midas-da-xlmroberta
Usage
To apply this to emissor conversations:
```bash
python3 examples/annotato_emissor_conversation_with_emotions.py --emissor "../data/emissor"
```
For using this repository as a package different project and on a different virtual environment, you may
-
install a published version from PyPI:
pip install cltl.dialogue_act_classification
-
or, for the latest snapshot, run:
pip install git+git://github.com/leolani/cltl-dialogueclassification.git@main
Then you can import it in a python script as:
import cltl.dialogue_act_classification
To test the classifier run:
PYTHONPATH=src python -m unittest
References:
- Chapuis, Emile, Pierre Colombo, Matteo Manica, Matthieu Labeau, and Chloe Clavel. "Hierarchical pre-training for sequence labelling in spoken dialog." arXiv preprint arXiv:2009.11152 (2020).
- Yu, Dian, and Zhou Yu. "Midas: A dialog act annotation scheme for open domain human machine spoken conversations." arXiv preprint arXiv:1908.10023 (2019).
Integration in the Leolani event-bus
Can be integrated in the event-bus and to generate annotations in EMISSOR through a service.py that is included. In the configuration file of the event-bus,the input and output topics need to specified as well as the emotion detectors.
Metadata
Release files for cltl.dialogueclassification 0.2.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cltl_dialogueclassification-0.2.dev1.tar.gz | 10.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cltl.dialogueclassification-0.2.dev1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.5 kB
Release files / cltl_dialogueclassification-0.2.dev1.tar.gz
| Download URL | cltl_dialogueclassification-0.2.dev1.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d16bed74fd922c9463fb5d1d38b5b1931bd370e6a7bb46b41ebb13b2de77cc4
|
|
BLAKE2b-256 checksum How to use checksums |
73920040b62bf1ee87233b54d817b40fcc2590e2ff4f38236e220a04c85b8993
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.16
|
Release files / cltl.dialogueclassification-0.2.dev1-py3-none-any.whl
| Download URL | cltl.dialogueclassification-0.2.dev1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab0a46d9d65a17d99d81d1144a9363707eab6386ada138bc0582eb758f3cc02b
|
|
BLAKE2b-256 checksum How to use checksums |
193d5021946e39943fcd16ca8b8c3f2385dd76496dae104d5abfeaba8115902f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.16
|