Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 51 additions & 5 deletions ai/generative-ai-service/sentiment+categorization/files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,33 @@ This demo showcases an AI-powered solution for analyzing batches of customer mes
* Customer messages should be stored in a CSV file(s) within a folder named `data`.
* Each CSV file should contain a column with the message text.

## Python Version
This project requires **Python 3.13** or later. You can check your current Python version by running:
```
python --version
```
or
```
python3 --version
```

## Getting Started
To run the demo, follow these steps:
1. Clone the repository using `git clone`.
2. Place your CSV files containing customer messages in the `data` folder.
3. Install dependencies using `pip install -r requirements.txt`.
4. Run the application using `streamlit run app.py`.
2. *(Optional but recommended)* Create and activate a Python virtual environment:
- On Windows:
```
python -m venv venv
venv\Scripts\activate
```
- On macOS/Linux:
```
python3 -m venv venv
source venv/bin/activate
```
3. Place your CSV files containing customer messages in the `data` folder. Ensure each includes a column with the message text.
4. Install dependencies using `pip install -r requirements.txt`.
5. Run the application using `streamlit run app.py`.

## Example Use Cases
* Analyze customer feedback from surveys, reviews, or social media platforms to identify trends and patterns.
Expand All @@ -34,9 +55,34 @@ To run the demo, follow these steps:
* All aspects of the demo, including:
+ Hierarchical categorization
+ Sentiment analysis
+ Structured report generation
are powered by GenAI, ensuring accurate and efficient analysis of customer messages.
+ Structured report generation are powered by GenAI, ensuring accurate and efficient analysis of customer messages.


## Project Structure

The repository is organized as follows:

```plaintext
│ app.py # Main Streamlit application entry point
│ README.md # Project documentation
│ requirements.txt # Python dependencies
├───backend
│ │ feedback_agent.py # Logic for feedback processing agents
│ │ feedback_wrapper.py # Wrappers and interfaces for feedback functionalities
│ │ message_handler.py # Utilities for handling and preprocessing messages
│ │
│ ├───data
│ │ complaints_messages.csv # Example dataset of customer messages
│ │
│ └───utils
│ config.py # Configuration and setup for the project
│ llm_config.py # Model- and LLM-related configuration
│ prompts.py # Prompt templates for language models
└───pages
SentimentByCat.py # Additional Streamlit page for sentiment by category
```
## Output
The demo will display an interactive dashboard with the generated report, providing valuable insights into customer messages, including:
* Category distribution across all three levels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Set up logging
logging.getLogger("oci").setLevel(logging.DEBUG)
messages_path = "ai/generative-ai-service/sentiment+categorization/demo_code/backend/data/complaints_messages.csv"
messages_path = "ai/generative-ai-service/sentiment+categorization/files/backend/data/complaints_messages.csv"


class AgentState(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
langchain-community==0.3.23
langgraph==0.4.1
oci==2.150.3
plotly==6.0.1
streamlit==1.45.0