You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ai/generative-ai-service/sentiment-categorization/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
The Customer Message Analyzer is a tool designed to analyze customer messages through unsupervised categorization, sentiment analysis, and summary reporting. It helps businesses understand customer feedback without requiring extensive manual labeling or analysis.
# Customer-Agent Conversation Analysis and Categorization Demo
2
-
This demo showcases an AI-powered solution for analyzing batches of customer messages, categorizing them into hierarchical levels, extracting sentiment scores, and generating structured reports.
3
2
4
-
## Key Features
5
-
***Hierarchical Categorization**: Automatically categorizes messages into three levels of hierarchy:
6
-
+ Primary Category: High-level categorization
7
-
+ Secondary Category: Mid-level categorization, building upon primary categories
8
-
+ Tertiary Category: Low-level categorization, providing increased specificity and detail
9
-
***Sentiment Analysis**: Extracts sentiment scores for each message, ranging from very negative (1) to very positive (10)
10
-
***Structured Reporting**: Generates a comprehensive report analyzing the batch of messages, including:
11
-
+ Category distribution across all three levels
12
-
+ Sentiment score distribution
13
-
+ Summaries of key findings and insights
14
-
15
-
## Data Requirements
16
-
* Customer messages should be stored in a CSV file(s) within a folder named `data`.
17
-
* Each CSV file should contain a column with the message text.
18
-
19
-
## Python Version
20
-
This project requires **Python 3.13** or later. You can check your current Python version by running:
21
-
```
22
-
python --version
23
-
```
24
-
or
25
-
```
26
-
python3 --version
27
-
```
3
+
This demo showcases an AI-powered solution for analyzing batches of customer messages, categorizing them into hierarchical levels, extracting sentiment scores, and generating structured reports. The latest version adds a professional, corporate UI theme, CSV upload/validation in the sidebar, and step-aware progress feedback during processing.
28
4
29
-
## Getting Started
30
-
To run the demo, follow these steps:
31
-
1. Clone the repository using `git clone`.
32
-
2.*(Optional but recommended)* Create and activate a Python virtual environment:
33
-
- On Windows:
34
-
```
35
-
python -m venv venv
36
-
venv\Scripts\activate
37
-
```
38
-
- On macOS/Linux:
39
-
```
40
-
python3 -m venv venv
41
-
source venv/bin/activate
42
-
```
43
-
3. Place your CSV files containing customer messages in the `data` folder. Ensure each includes a column with the message text.
44
-
4. Install dependencies using `pip install -r requirements.txt`.
45
-
5. Run the application using `streamlit run app.py`.
5
+
## Key Features
6
+
- Hierarchical Categorization
7
+
- Primary Category: High-level categorization
8
+
- Secondary Category: Mid-level categorization, building upon primary categories
9
+
- Tertiary Category: Low-level categorization, providing increased specificity and detail
10
+
- Sentiment Analysis
11
+
- Extracts sentiment scores for each message, from very negative (1) to very positive (10)
12
+
- Structured Reporting
13
+
- Category distribution across all three levels
14
+
- Sentiment score distribution
15
+
- Summaries of key findings and insights
16
+
- CSV Upload and Validation
17
+
- Upload CSV in the sidebar; validates required columns ID and Message before running
18
+
- Displays a preview in the sidebar and a full interactive table in the main area
19
+
- Execution Progress and Status
20
+
- Step-aware progress bar with status text showing the currently running stage and total steps
46
21
47
-
## Example Use Cases
48
-
* Analyze customer feedback from surveys, reviews, or social media platforms to identify trends and patterns.
49
-
* Inform product development and customer support strategies by understanding customer sentiment and preferences.
50
-
* Optimize marketing campaigns by targeting specific customer segments based on their interests and concerns.
51
22
52
23
## Technical Details
53
-
* The solution leverages Oracle Cloud Infrastructure (OCI) GenAI, a suite of AI services designed to simplify AI adoption.
54
-
* Specifically, this demo utilizes the Cohere R+ model, a state-of-the-art language model optimized for natural language processing tasks.
55
-
* All aspects of the demo, including:
56
-
+ Hierarchical categorization
57
-
+ Sentiment analysis
58
-
+ Structured report generation are powered by GenAI, ensuring accurate and efficient analysis of customer messages.
59
-
24
+
- Built on Oracle Cloud Infrastructure (OCI) GenAI services
25
+
- End-to-end flow powered by GenAI for:
26
+
- Hierarchical categorization
27
+
- Sentiment analysis
28
+
- Structured report generation
60
29
61
30
## Project Structure
62
-
63
-
The repository is organized as follows:
64
-
65
31
```plaintext
66
32
│ app.py # Main Streamlit application entry point
67
33
│ README.md # Project documentation
@@ -70,31 +36,46 @@ The repository is organized as follows:
70
36
├───backend
71
37
│ │ feedback_agent.py # Logic for feedback processing agents
72
38
│ │ feedback_wrapper.py # Wrappers and interfaces for feedback functionalities
73
-
│ │ message_handler.py # Utilities for handling and preprocessing messages
74
39
│ │
75
40
│ ├───data
76
41
│ │ complaints_messages.csv # Example dataset of customer messages
77
42
│ │
78
43
│ └───utils
79
44
│ config.py # Configuration and setup for the project
80
-
│ llm_config.py # Model- and LLM-related configuration
81
45
│ prompts.py # Prompt templates for language models
82
46
│
83
-
└───pages
84
-
SentimentByCat.py # Additional Streamlit page for sentiment by category
47
+
└───data
48
+
complaints_messages.csv# Example dataset of customer messages
85
49
```
86
-
## Output
87
-
The demo will display an interactive dashboard with the generated report, providing valuable insights into customer messages, including:
88
-
* Category distribution across all three levels
89
-
* Sentiment score distribution
90
-
* Summaries of key findings and insights
91
50
92
-
## Contributing
93
-
We welcome contributions to improve and expand the capabilities of this demo. Please fork the repository and submit a pull request with your changes.
51
+
## Getting Started
52
+
1. Clone the repository using git clone.
53
+
2. (Optional) Create and activate a Python virtual environment:
54
+
- Windows:
55
+
- python -m venv venv
56
+
- venv\Scripts\activate
57
+
- macOS/Linux:
58
+
- python3 -m venv venv
59
+
- source venv/bin/activate
60
+
3. Place your CSV files in the data folder. Ensure each includes the required columns ID and Message.
61
+
4. Install dependencies with pip install -r requirements.txt.
62
+
5. Run the application with `streamlit run app.py`.
63
+
64
+
## Data Requirements
65
+
- Input format: CSV with two columns: ID and Message
66
+
- The app validates:
67
+
- File extension is CSV
68
+
- Both required columns are present
69
+
- The full dataset is visualized in the main view after successful validation.
70
+
71
+
## Output
72
+
The dashboard displays an interactive report with:
73
+
- Category distribution across all three levels
74
+
- Sentiment score distribution
75
+
- Summaries of key findings and insights
76
+
- Step-by-step execution status and overall progress of the analysis run
94
77
95
78
## License
96
79
Copyright (c) 2025 Oracle and/or its affiliates.
97
-
98
80
Licensed under the Universal Permissive License (UPL), Version 1.0.
99
-
100
-
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
81
+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
0 commit comments