Customer-support
Complaint Analysis Tool Documentation
Overview:
The Complaint Analysis Tool is a Streamlit-based application designed to help users analyze customer complaints by leveraging the WorqHat AI API. The tool processes inputs such as audio conversations, order notes, and product images to provide a detailed analysis of the complaint. This analysis includes evaluating the level of damage to a product and summarizing the conversation with emotional cues from the customer.
Purpose:
The tool aims to streamline the process of understanding and addressing customer complaints by providing a quick and insightful AI-generated analysis. By integrating multiple inputs like audio, images, and order notes, the tool delivers a comprehensive and structured output that assists in resolving customer issues effectively.
Key Features:
Audio and Image Input:
- Users can upload audio files of customer conversations and images of the damaged and correct products for analysis.
AI-Powered Complaint Analysis:
- The WorqHat AI API processes the audio file to detect emotions and summarize the conversation. It also compares the images to generate a damage score between 0 and 10.
Order Notes Context:
- Additional order notes are considered during the analysis, providing context for the complaint and enhancing the accuracy of the output.
Error Handling:
- The tool includes error handling for failed API requests, missing inputs, and response issues, ensuring smooth user interaction.
JSON Output:
- The analysis is returned in a structured JSON format, displaying a summary of the damage score, emotional analysis, key points from the conversation, and a proposed resolution.
Benefits:
- Comprehensive Analysis: Integrates audio, images, and order details for a complete analysis of customer complaints.
- Improved Productivity: Automates the analysis process, allowing users to focus on resolving complaints quickly and effectively.
- Tailored Resolution Suggestions: Provides suggestions for complaint resolution based on the customer’s conversation.
- User-Friendly Interface: Built using Streamlit, ensuring a simple and intuitive interface for submitting inputs and viewing results.
How It Works:
- Audio and Image Input: Users upload the audio of the customer complaint along with images of both the damaged product and the correct product.
- Order Notes Input: Users can provide additional context about the order through the text input.
- API Call: Upon submission, the app sends the audio file, images, and order notes to the WorqHat AI API for analysis.
- AI Analysis: The API analyzes the damage by comparing the images and evaluates the customer conversation for emotions, key points, and potential resolution.
- Display Result: The tool displays the AI-generated analysis in JSON format, summarizing the results for the user.
Procedure to Follow:
Enter WORQHAT API Key:
- Obtain a WORQHAT API key and input it in the designated field. If you do not have one you can visit our website WorqHat to get your own API key
Upload Audio Conversation:
- Upload an audio file of the customer conversation in either
.wav
or.mp3
format.
- Upload an audio file of the customer conversation in either
Input Additional Order Notes:
- Provide any relevant notes related to the customer’s order to give more context for the analysis.
Upload Images:
- Upload images of the damaged product and the correct product in
.jpg
,.jpeg
, or.png
format.
- Upload images of the damaged product and the correct product in
Analyze Complaint:
- Click the "Analyze Complaint" button to process the input files. The tool will send a request to the WorqHat API, analyze the complaint, and return the JSON output.
Example Code Snippet:
Here is the core function that handles the API call and response parsing:
def process_complaint(api_key, audio_file, order_notes, damaged_image, correct_image):
url = WORQHAT_ENDPOINT_URL
headers = {'Authorization': f'Bearer {api_key}'}
files = [
('files', (audio_file.name, audio_file, audio_file.type)),
('files', (damaged_image.name, damaged_image, damaged_image.type)),
('files', (correct_image.name, correct_image, correct_image.type))
]
data = Data
response = requests.post(url, headers=headers, files=files, data=data)
if response.status_code == 200:
result = response.json()
st.success("Complaint processed successfully!")
st.json(result)
else:
st.error(f"Error processing complaint: {response.text}")
Example JSON Output:
{
"damage analysis": {
"score": 7,
"description": "The damage score indicates moderate damage to the product."
},
"audio analysis": {
"emotions": "Frustration detected in the customer’s voice.",
"summary": "Customer received a damaged product and demands a replacement.",
"potential_resolution": "Offer a replacement product and a discount for future orders.",
"key_points": [
"Product was damaged upon arrival.",
"Customer needs a quick resolution."
]
},
"summary": "The complaint involves a moderately damaged product, and the customer is frustrated. A replacement and discount are suggested."
}
Conclusion:
The Complaint Analysis Tool is an efficient solution for handling customer complaints by analyzing conversations and product images. It provides actionable insights by leveraging the WorqHat AI API and offers users a streamlined process to address complaints with accurate and concise information.
Try it Yourself:
Explore the Complaint Analysis Tool at Streamlit App Page.
Check out the Code on GitHub: WorqHat GitHub Repository.