Skip to main content

DialogTag

Dialogue act classification is the task of classifying an utterance with respect to the function it serves in a dialogue, i.e. the act the speaker is performing. This python library essentially does dialogue act classification on the Switchboard corpus.

The Switchboard-1 corpus is a telephone speech corpus, consisting of about 2,400 two-sided telephone conversation among 543 speakers with about 70 provided conversation topics. The dataset includes the audio files and the transcription files, as well as information about the speakers and the calls. A subset of the Switchboard-1 corpus consisting of 1155 conversations was used. The resulting tags include dialogue acts like statement-non-opinion, acknowledge, statement-opinion, agree/accept, etc.

Annotated example:

Speaker: A, Dialogue Act: Yes-No-Question, Utterance: So do you go to college right now?

The original dataset contained around 42 tags but here we brought them down to 38 by removing a few redundant and ad-hoc tags. The available tags:

TAG EXAMPLE
Statement-non-opinion Me, I'm in the legal department.
Acknowledge (Backchannel) Uh-huh.
Statement-opinion I think it's great
Agree/Accept That's exactly it.
Appreciation I can imagine.
Yes-No-Question Do you have to have any special training?
Yes answers Yes.
Conventional-closing Well, it's been nice talking to you.
Uninterpretable But, uh, yeah
Wh-Question Well, how old are you?
No answers No.
Response Acknowledgement Oh, okay.
Hedge I don't know if I'm making any sense or not.
Declarative Yes-No-Question So you can afford to get a house?
Other Well give me a break, you know.
Backchannel in question form Is that right?
Quotation You can't be pregnant and have cats
Summarize/reformulate Oh, you mean you switched schools for the kids.
Affirmative non-yes answers It is.
Action-directive Why don't you go first
Collaborative Completion Who aren't contributing.
Repeat-phrase Oh, fajitas
Open-Question How about you?
Rhetorical-Questions Who would steal a newspaper?
Hold before answer/agreement I'm drawing a blank.
Negative non-no answers Uh, not a whole lot.
Signal-non-understanding Excuse me?
Conventional-opening How are you?
Or-Clause or is it more of a company?
Dispreferred answers Well, not so much that.
3rd-party-talk My goodness, Diane, get down from there.
Offers, Options Commits I'll have to check that out
Self-talk What's the word I'm looking for
Downplayer That's all right.
Maybe/Accept-part Something like that
Tag-Question Right?
Declarative Wh-Question You are what kind of buff?
Apology I'm sorry.
Thanking Hey thanks a lot

Installation

We recommend Python 3.7 or higher, Tensorflow 2.0.0 or higher and Transformers v3.0.0 or higher.

Install with pip

Install the DialogTag with pip:

pip install -U DialogTag

Install from sources

Alternatively, you can also clone the latest version from the repository and install it directly from the source code:

pip install -e .

DialogTag in action

This quick example will show you how to use DialogTag in your code.

from dialog_tag import DialogTag

model = DialogTag('distilbert-base-uncased')

sentence = "I'll probably go to shopping today."
output = model.predict_tag(sentence)
print(output)
# output: 'Statement-non-opinion'

sentence = "Why are you asking me this question again and again?"
output = model.predict_tag(sentence)
print(output)
# output: 'Wh-Question'

Available pre-trained models

Update: We now have bert-base-uncased model available!

Currently we have only distilbert-base-uncased available. We're planning to extend it to bert-base-uncased and roberta-base. Stay tuned for further updates!

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Metadata

Release files for DialogTag 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DialogTag 1.1.3
File Size Uploaded
DialogTag-1.1.3.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DialogTag 1.1.3
File Interpreter ABI Platform
DialogTag-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / DialogTag-1.1.3.tar.gz

Download URL DialogTag-1.1.3.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5186caddc24370cbcbaa306073a91b591f7082383b87dcb8f62457779365977e
BLAKE2b-256 checksum
How to use checksums
48313db0364a67756cedc189964237f9a79008c4a2b82828c7bfdbeb255e9817
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.5

Release files / DialogTag-1.1.3-py3-none-any.whl

Download URL DialogTag-1.1.3-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7f1068a34143f9b438ed3899ae90cba56a18e66c652634b9445f1d6dd91b026
BLAKE2b-256 checksum
How to use checksums
309b8ea84ef9bfb6627463dc804ce7a453d2c2663cc9d22844535760ae7d1fac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.0.2

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page