Skip to content

Insight extraction using call center conversation scripts (json, etc.) with Azure Open AI

Notifications You must be signed in to change notification settings

zhrky/Call_Center_Insights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Call Center Insights Application

This repository contains an Azure Function App designed to provide insights from call center transcripts using Azure OpenAI service. The application leverages Azure OpenAI for natural language processing and Azure Blob Storage for file storage.

Project Aim

Call Center Insights Application is designed for businesses seeking to enhance their call center operations through advanced natural language processing. By leveraging Azure OpenAI and Azure Blob Storage, the application extracts valuable insights from call center transcripts, facilitating improved decision-making and operational efficiency. This tool is particularly beneficial for call center managers, analysts, and customer service teams looking to harness AI technology to optimize performance and customer satisfaction.

Features

  • Welcome Page: A landing page with a welcome message and a link to start the process.
  • Upload Page: Allows users to upload JSON transcript files or WAV audio files.
  • Extraction Page: Processes the uploaded transcript file and extracts insights using Azure OpenAI(gpt-4o).
  • Blob Storage Integration: Stores uploaded files and generated JSON output in Azure Blob Storage.

Architecture

image

Get Started

Prerequisites

Azure Account - If you're new to Azure, get an Azure account for free and you'll get some free Azure credits to get started.

Azure subscription with access enabled for the Azure OpenAI Service - For more details, see the Azure OpenAI Service documentation on how to get access.

Azure OpenAI resource - For these samples, you'll need to deploy models like GPT-3.5 Turbo, GPT 4, DALL-E, and Whisper. See the Azure OpenAI Service documentation for more details on deploying models and model availability .

Configuration

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>

    then open with Visual Studio Code or other IDE

  2. Create the virtual environment (venv)(optional):

    python -m venv venv

-Note: create venv in your directory.

image

Activate virtual environment :

  • Windows:

            venv\Scripts\activate.ps1
  • MacOS/Linux:

           source venv/bin/activate.ps1
  1. Set Environment Variables:

    Ensure the following environment variables are set in your Azure Function App configuration:

    • AZURE_ENDPOINTS: Your Azure OpenAI endpoint.
    • API_KEY: Your Azure OpenAI API key.
    • API_VERSION: Azure OpenAI API version.
    • BLOB_STORAGE_CONNEC_STRING: Azure Blob Storage connection string.
    • AzureWebJobsStorage: Azure WebJobs storage connection string.
    • FUNCTIONS_WORKER_RUNTIME: Python.
    • AzureWebJobsFeatureFlags: EnableWorkerIndexing.

Example local.settings.json (fill the keyaccording to description in your LOCAL ):

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "<your-blob-storage-connection-string>",
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
    "BLOB_STORAGE_CONNEC_STRING": "<your-blob-storage-connection-string>",
    "AZURE_ENDPOINTS": "<your-azure-openAI-endpoints>",
    "API_KEY": "<your-azure-openAI-api-key>",
    "API_VERSION": "<your-api-azure-openAI-version>",
    "StorageAccountName": "<your-storage-account-name>",
    "StorageInputContainerName": "<STORAGE-INPUT-CONTAINER-NAME>",
    "StorageOutputContainerName": "<STORAGE-OUTPUT-CONTAINER-NAME>",
    "WelcomeBackgroundSAS": "<welcome-page-background-sas-url>",
    "UploadBackgroundSAS": "<upload-page-background-sas-url>",
    "ExtractionBackgroundSAS": "<extraction-page-background-sas-url>",
    "LogoSAS": "<Brand-logo-sas-url>",
    "LoadingGifSAS": "<loading-gif-sas-url>"
  }
}

! please create local.settings.json and copy paste this json examle in it and fill the requirement places

Dependencies

  1. Install the necessary Python packages:

    pip install azure-functions azure-storage-blob openai requests

    or

    pip install -r requirements.txt
  2. Deploy the function App

    After fill and run the commands, deploy this app to Azure

    -Click azure symbol in VsCode

    image

    -Then create a Function App

    image

    -Give the name callcenter-insights

    -Select python 3.11

    -Select region sweden central(optionally you can choose this region)

    Deployment image**

    After succesfully deployed app your function resource look like in Azure. Click browse and try the app : )

File Structure

  • function_app.py: Main application file containing HTTP-triggered functions and routes.
  • helpers.py: Helper functions for processing transcripts and interacting with Azure Blob Storage.

Functions

Welcome Page

Route: /api/Welcomepage

Displays a welcome page with a background image and a link to start the process.

Screenshot 2024-05-22 172303

Upload Page

Route: /api/Uploadpage

Provides a form for uploading JSON transcript files or WAV audio files, along with a text prompt.

Screenshot 2024-06-28 131210

Extraction Page

Route: /api/Extractionpage

Handles the extraction of insights from the uploaded transcript file using Azure OpenAI(gpt-4o).

Screenshot 2024-05-21 131053

Helper Functions

  • upload_json_file(req: func.HttpRequest) -> func.HttpResponse: Handles the upload of JSON files to Azure Blob Storage.
  • insight_extraction(file_content, prompt): Processes the transcript and extracts insights using Azure OpenAI.

Usage

  1. After configurations run the functions

  2. Start the Process: Click the "Let's Start" button to navigate to the Upload Page.

  3. Upload Files: Choose a transcript JSON file or a WAV audio file, enter a prompt, and submit.

  4. View Results: The Extraction Page will display the uploaded content and the extracted insights.

Notes

  • Ensure all necessary Azure resources (Function App, Blob Storage, AzurevOpenAI) are correctly configured and accessible.
  • Update the connection_string and other configuration settings as per your Azure setup.
  • please check the azure function supported python version in this scenario I used python 3.11.9

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

About

Insight extraction using call center conversation scripts (json, etc.) with Azure Open AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages