Contract Statements Knowledge Service for Chatbots

Marcin Detyniecki, Ph.D., Boris Ruf, Matteo Sammarco, Marcin DetynieckiSMC 2019

TL;DR

This paper introduces a novel approach to enable chatbots to answer complex questions about contractual conditions by modeling contract statements as hypergraphs. This method allows for dynamic, rule-based responses, significantly reducing the complexity and maintenance burden compared to traditional FAQ bots.

What Problem Does This Paper Address?

Conversational agents, or chatbots, are becoming increasingly sophisticated, but they often struggle with handling nuanced questions, especially in specialized domains like legal contracts. Existing approaches, such as FAQ bots, require manually creating an answer for every possible question, which becomes unmanageable for complex documents with numerous conditions and variations. This paper addresses the challenge of formalizing contract statements in a machine-readable way to empower chatbots to provide accurate and dynamic answers to user inquiries about contract terms, specifically focusing on insurance policies.

Methods

The authors propose a top-down knowledge engineering approach. They identify relevant contract statements and model their underlying rules using hypergraphs. A hypergraph, in this context, consists of vertices representing parameter values (e.g., type of sport, country) and possible responses (e.g., price), with edges representing the rules that connect these vertices. This structure allows for flexible rule definition, where edges can connect any number of vertices, unlike traditional graphs.

The system comprises three main components:

  1. Chatbot client: The user interface for interaction.
  2. Chatbot framework: Manages conversation flow and preprocesses inquiries using NLP for intent classification and named-entity recognition to extract parameter-value pairs.
  3. Knowledge service: This is the core innovation. It receives structured queries from the chatbot framework, identifies the matching rule within the hypergraph model of a contract statement, and returns the appropriate answer.

The authors also developed a user-friendly web application prototype to facilitate the creation and management of these hypergraph models. The knowledge service exposes its functionality via a generic API for seamless integration with any chatbot framework.

Datasets

Not discussed in the paper. The paper uses a toy scenario (fictional accident insurance) to illustrate its concepts and does not refer to any specific real-world datasets for training or evaluation.

Key Insights and Ideas

  • Hypergraphs for Contract Modeling: Representing contract statements as hypergraphs offers a powerful way to capture complex, multi-parameter rules that traditional graph structures or simple rule-based systems might struggle with.
  • Dynamic vs. Static Answers: The hypergraph approach enables chatbots to generate dynamic answers based on rules, rather than relying on pre-written, static answers for every possible question. This drastically reduces the effort required for content creation and maintenance.
  • Complexity Reduction: By factorizing possible answers into rules, a single hypergraph model can replace a very large number of conventional FAQ bot questions, leading to significant efficiency gains.
  • Framework Agnosticism: Exposing the knowledge service via a generic API makes the system adaptable to various chatbot frameworks, promoting wider adoption.
  • Poka-yoke Principle: The prototype incorporates built-in edge validation to prevent logical errors during hypergraph creation, embodying the "mistake-proofing" principle.

Key Results

The paper demonstrates the theoretical expressivity of their approach by calculating the number of conventional FAQ bot questions a single hypergraph can replace. For their toy scenario with 3 parameters and 9 nodes, a single hypergraph statement can substitute up to 34 conventional FAQ bot questions. They also show that the number of questions covered grows exponentially with the number of keywords per parameter and the number of parameters, highlighting the scalability of their method. The prototype implementation showcases a user-friendly interface for creating and managing these hypergraph models and an API for integration.

Limitations and Future Work

The authors acknowledge several limitations and suggest future research directions:

  • Keyword Matching: Current keyword matching is exact. Future work could involve fuzzy matching to handle typos and using word embeddings to match synonyms, making the system more robust.
  • Data Types: The current model primarily handles string-based keywords. Expanding support to ranges of numbers and dates would increase its applicability.
  • Conversational Flow: While the system can prompt for missing parameters, more sophisticated conversational flow management, such as ranking missing parameter values by probability and plausibility, is a potential area for improvement.
  • Language Agnosticism: The current implementation is likely language-dependent. Developing a language-agnostic architecture is a future goal.
  • Error Handling: The current handling of invalid input queries is basic, relying on the chatbot framework for more complex error management.

Summary updated

BibTeX
@inproceedings{phd2019contract,
  author = {Marcin Detyniecki, Ph.D. and Boris Ruf and Matteo Sammarco and Marcin Detyniecki},
  title = {{Contract Statements Knowledge Service for Chatbots}},
  booktitle = {SMC},
  year = {2019},
  doi = {10.1109/smc.2019.8913955},
}
Figure