This project aims to optimize Average Handle Time (AHT) and Average Call Allocation Time in a call center environment using a predictive model. The project includes two Jupyter notebooks for data analysis and model training, as well as a Flask application to serve predictions.
Presentation Link:-
- Installation
- Usage
- Project Structure
- Endpoints
- Data Requirements
- How to Run the Application
- Example Requests
- License
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
main.ipynb
: Contains data analysis and exploration of the datasets.model.ipynb
: Contains the predictive model for calculating handle time.app.py
: The main Flask application for serving predictions.
- Predict Endpoint
-
URL:
/predict
-
Method:
POST
-
Request Body:
json `{ "customer_id": "12345", "primary_call_reason": "Flight Inquiry" }`
-
Response:
json `{ "transferred_to_agent": "agent_id_x", "least_handle_time": 300.5 }`
- Call Complete Endpoint
-
URL:
/call_complete
-
Method:
POST
-
Request Body:
json `{ "agent_id": "agent_id_x" }`
-
Response:
json `{ "message": "Agent status updated to available." }`
- Update Availability Endpoint
-
URL:
/update_availability
-
Method:
POST
-
Request Body:
json `{ "agent_id": "agent_id_x", "availability": true }`
-
Response:
json `{ "message": "Agent {agent_id} availability updated to {availability}." }`
``Ensure you have the following datasets in the dataset
directory:
`customer.csv`: Contains information about the customers.
`calls.csv`: Contains details about the calls.
`reason.csv`: Contains reasons for the calls.
`sentiment_statistics.csv`: Contains sentiment analysis statistics.``
-
Navigate to the project directory:
`cd <repository_directory>`
-
Run the Jupyter notebooks
main.ipynb
andmodel.ipynb
to perform data analysis and train the predictive model. -
Run the Flask application:
`python app.py`
```bash
`curl -X POST http://127.0.0.1:5000/predict \
-H "Content-Type: application/json" \
-d '{"customer_id": "12345", "primary_call_reason": "Flight Inquiry"}'`
```bash
`curl -X POST http://127.0.0.1:5000/call_complete \
-H "Content-Type: application/json" \
-d '{"agent_id": "agent_id_x"}'
This project is licensed under the MIT License. See the LICENSE file for more details.