Skip to main content

State Transition Dialogue Manager

Emora State Transition Dialogue Manager (Emora STDM) is a dialogue system development framework that seamlessly integrates intent classification, pattern recognition, state machine, and information state approaches to dialogue management and natural language understanding. This allows Emora STDM to support both rapid prototyping and long-term, team-based development workflows, catering to a wide range of developer expertise.

Novice developers, or those who just want to develop a dialogue agent as quickly as possible, can easily create a state machine based chatbot using built-in functionality for intent classification and keyword matching.

Emora STDM also affords a high degree of controllability to experts: it is easy to integrate NLP models, database queries, and custom logic, and chatbots can be created entirely from state update rules, following an information state approach (ref) to dialogue. Although we provide a host of built-in NLP models and useful functionality, your imagination is the limit when extending Emora STDM.

Links: Github Paper

Quick Start

Installation

pip install emora_stdm

Once installed, see if you can run the Hello World example below, and check out the tutorials.

Hello World Example

Below is an example of a simple chatbot created with Emora STDM. The easiest way to add content to a chatbot is to use this nested dictionary syntax.

from emora_stdm import DialogueFlow

chatbot = DialogueFlow('start')
transitions = {
    'state': 'start',
    '"Hello. How are you?"': {
        '[{good, okay, fine}]': {
            '"Good. I am doing well too."': {
                'error': {
                    '"See you later!"': 'end'
                }
            }
        },
        'error': {
            '"Well I hope your day gets better!"': {
                'error': {
                    '"Bye!"': 'end'
                }
            }
        }
    }
}
chatbot.load_transitions(transitions)

chatbot.run()

Running the above code will allow you to interact with this chatbot. It asks how you are doing, and will respond differently depending on whether or not you included one of the keywords {"good", "fine", "okay"} in your answer. Below is a sample conversation produced by running the above code (S for system, U for user utterance):

S: Hello. How are you?
U: I'm good. How are you?
S: Good. I am doing well too.
U: Great!
S: See you later!

Description

overview image

Dialogue management in Emora STDM is performed in two ways:

  1. updating the state machine defined by the Dialogue Graph and
  2. applying information state Update Rules, which are structured as if...then... conditionals.

Each turn of conversation,the Dialogue Graph is updated to interpret the user input and provide an appropriate response. The Dialogue Graph is a state machine describing possible "pathways" of conversation, where each transition/edge represents either a sysem or user turn, and each state/node represents a set of options for what could be said next. A full turn of conversation (user input + system response) results in two Dialogue Graph State updates--one representing an interpretation of the user turn, and the second representing a decision of the system for how to respond.

On the user's turn, each transition out of the current Dialogue Graph State (node) represents a unique interpretation of the user input. The user input is evaluated against each out transition, and when a transition matches, the Dialogue Graph State is updated to the target of the transition. (Note that the user input will always match a transition marked as 'error', but this transition is only accepted if no other transitions match the input).

During the system turn, each outgoing transition from the current Dialogue Graph State is a possible response. The system will select one of these response options based on a priority score of each transition, or randomly if the priorities of all the options are the same. The selected transition will be used to produce the system response, and update the Dialogue Graph State.

Most simple dialogue agents will not have any update rules. However, Update Rules can very useful to maninpulate state variables and perform complex interactions. Before updating the Dialogue Graph, Update Rules are iteratively applied by evaluating each of their precondition Natexes on the user input, and applying the postcondition if the precondition succeeds. The iteration continues until no more rules preconditions pass, at which point the Dialogue Graph update is performed. You can read more about Update Rules in the Update Rules Tutorial.

Tutorials

  • Dialogue Graph Tutorial, explaining the core dialogue management functionality of Emora STDM
  • Natex Tutorial, explaining the framework's core natural language understanding and generation functionality
  • Update Rules Tutorial, explaining how to create dialogue agents using Update Rules instead of the Dialogue Graph
  • Ontology Example, showing how to use an ontology to efficiently categorize entities.
  • Multiple Components Example, a quick example of multiple dialogue agents being combined into a single larger system.

Release files for emora-stdm 2.0.5

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

Source distribution (sdist)

Source distribution for emora-stdm 2.0.5
File Size Uploaded
emora-stdm-2.0.5.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for emora-stdm 2.0.5
File Interpreter ABI Platform
emora_stdm-2.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 2.2 MB

Release files / emora-stdm-2.0.5.tar.gz

Download URL emora-stdm-2.0.5.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
bbcf4aacaefec214ce226c2d3c1eb0460bc933f3e6b51504c8ba421df41a4d7a
BLAKE2b-256 checksum
How to use checksums
62a6a0603735908f3c64cc128d238a514a14528f08a0fa1381687bcf371549f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release files / emora_stdm-2.0.5-py3-none-any.whl

Download URL emora_stdm-2.0.5-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c46b910ee039afa2128eae0e91c3b6b21ef67c141f748e2987edc7c265b1cd0f
BLAKE2b-256 checksum
How to use checksums
0dda760a37af75d8503692df2655edf572f1e4cc22efdae7415efafc5992ab8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release history Release notifications | RSS feed

This release

2.0.5 This release

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.98.1

2 release files

1.98.0

2 release files

1.97.3

2 release files

1.97.2

2 release files

1.97.1

2 release files

1.96

2 release files

1.95

2 release files

1.94

2 release files

1.93

2 release files

1.92

2 release files

1.91

2 release files

1.90

2 release files

1.89

2 release files

1.88

2 release files

1.87

2 release files

1.86

2 release files

1.85

2 release files

1.84

2 release files

1.83

2 release files

1.82

2 release files

1.81

2 release files

1.80

2 release files

1.79

2 release files

1.78

2 release files

1.77

2 release files

1.76

2 release files

1.75

2 release files

1.74

2 release files

1.73

2 release files

1.72

2 release files

1.71

2 release files

1.70

2 release files

1.69

2 release files

1.68

2 release files

1.67

2 release files

1.66

2 release files

1.65

2 release files

1.64

2 release files

1.63

2 release files

1.62

2 release files

1.61

2 release files

1.60

2 release files

1.59

2 release files

1.58

2 release files

1.57

2 release files

1.56

2 release files

1.55

2 release files

1.54

2 release files

1.53

2 release files

1.52

2 release files

1.51

2 release files

1.50

2 release files

1.49

2 release files

1.48

2 release files

1.47

2 release files

1.46

2 release files

1.45

2 release files

1.44

2 release files

1.43

2 release files

1.42

2 release files

1.41

2 release files

1.40

2 release files

1.39

2 release files

1.38

2 release files

1.37

2 release files

1.36

2 release files

1.35

2 release files

1.34

2 release files

1.33

2 release files

1.32

2 release files

1.31

2 release files

1.30

2 release files

1.29

2 release files

1.28

2 release files

1.27

2 release files

1.26

2 release files

1.25

2 release files

1.24

2 release files

1.23

2 release files

1.22

2 release files

1.21

2 release files

1.20

2 release files

1.19

2 release files

1.17

2 release files

1.16

2 release files

1.15

2 release files

1.14

2 release files

1.13

2 release files

1.12

2 release files

1.11

2 release files

1.10

2 release files

1.9

2 release files

1.8

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

0.9

1 release file

0.3

1 release file

0.2

1 release file

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