AACKGDemo / README.md
willwade's picture
Initial commit
f5b302e
|
raw
history blame
4.09 kB

AAC Social Graph Assistant

An Augmentative and Alternative Communication (AAC) system that uses a social graph to provide contextually relevant suggestions for users with Motor Neurone Disease (MND). This demo is designed to be hosted on Hugging Face Spaces using Gradio.

Features

  • Person-Specific Suggestions: Select who you're talking to and get suggestions tailored to that relationship
  • Context-Aware: Uses a social graph to understand relationships and common topics
  • Multiple Suggestion Types: Get suggestions from a language model, common phrases, or predefined utterance categories
  • British Context: Designed with British English and NHS healthcare context in mind
  • MND-Specific: Tailored for the needs of someone with Motor Neurone Disease
  • Expandable: Easily improve the system by enhancing the social graph JSON file

Getting Started

Prerequisites

  • Python 3.8+
  • Dependencies listed in requirements.txt

Installation

  1. Clone this repository
  2. Install the required dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py
  1. Open your browser and navigate to the URL shown in the terminal (typically http://127.0.0.1:7860)

How It Works

  1. Social Graph: The system uses a JSON-based social graph (social_graph.json) that contains information about people, their relationships, common topics, and phrases.

  2. Context Retrieval: When you select a person, the system retrieves relevant context information from the social graph.

  3. Suggestion Generation: Based on the selected person and optional conversation context, the system generates suggestions using:

    • A language model (Flan-T5)
    • Common phrases associated with the person
    • General utterance categories (greetings, needs, emotions, questions)
  4. User Interface: The Gradio interface provides an intuitive way to interact with the system, select people, and get suggestions.

Customizing the Social Graph

You can customize the system by editing the social_graph.json file. The file has the following structure:

{
  "people": {
    "person_id": {
      "name": "Person Name",
      "role": "Relationship",
      "topics": ["Topic 1", "Topic 2"],
      "frequency": "daily/weekly/monthly",
      "common_phrases": ["Phrase 1", "Phrase 2"],
      "context": "Detailed context about the relationship"
    }
  },
  "places": ["Place 1", "Place 2"],
  "topics": ["Topic 1", "Topic 2"],
  "common_utterances": {
    "category1": ["Utterance 1", "Utterance 2"],
    "category2": ["Utterance 3", "Utterance 4"]
  }
}

Current Social Graph Context

The current social graph represents a British person with MND who:

  • Lives in Manchester with their wife Emma and two children (Mabel, 4 and Billy, 7)
  • Was diagnosed with MND 5 months ago
  • Works as a computer programmer
  • Has friends from Scout days growing up in South East London
  • Enjoys cycling and hiking in the Peak District and Lake District
  • Has a healthcare team including a neurologist, MND nurse specialist, physiotherapist, and speech therapist
  • Is supported by work colleagues with flexible arrangements
  • Has family in South East London

Deployment to Hugging Face Spaces

To deploy this application to Hugging Face Spaces:

  1. Create a new Space on Hugging Face
  2. Select Gradio as the SDK
  3. Upload the files from this repository
  4. The Space will automatically build and deploy the application

Future Improvements

  • Add speech recognition for input
  • Implement text-to-speech for output
  • Add a visual representation of the social graph
  • Support for multiple users with different social graphs
  • Add emotion/sentiment detection for more contextually appropriate suggestions

License

This project is open source and available under the MIT License.

Acknowledgments