Skip to content

vahuja4/dspy-test

Repository files navigation

Guideline Selector

An intelligent system that uses DSPy to select appropriate banking guidelines based on customer conversations. The system analyzes conversation context and activates relevant guidelines for customer service representatives.

Features

  • Conversation analysis using DSPy and LLMs
  • Multi-label classification for guideline activation
  • Support for complex, indirect conversations
  • Handles multiple intents in a single conversation
  • Robust testing framework with logging

Project Structure

  • train.py: Training script for the DSPy model
  • guideline_selector.py: Core guideline selector implementation
  • data_processor.py: Data loading and processing utilities
  • setup_env.py: Environment setup and configuration
  • test_model.py: Test script with various conversation scenarios
  • config.py: Configuration settings
  • conversations_data.json: Training data

Setup

  1. Install dependencies:
pip install dspy-ai
  1. Configure environment:
  • Set up OpenAI API key
  • Configure Ollama server (optional)
  1. Train the model:
python train.py
  1. Test the model:
python test_model.py

Guidelines

The system currently handles the following types of guidelines:

  • Card replacement and blocking
  • Credit/ATM/Transfer limit adjustments
  • Balance inquiries
  • Security concerns

Testing

The test suite includes various conversation scenarios:

  • Direct requests
  • Indirect/implied requests
  • Multiple intent scenarios
  • Security concerns
  • Card expiry handling

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages