customer_review_analysis.json
Overview
The customer_review_analysis.json file defines a sophisticated automated workflow designed for Customer Support purposes. Its primary function is to classify customer reviews automatically using a Large Language Model (LLM) and then route these classified reviews via email to the appropriate departments for handling.
This automation helps streamline customer feedback processing by:
Differentiating between positive and negative reviews.
Further categorizing negative reviews into specific issue types (e.g., after-sales issues, transportation issues).
Sending notifications to relevant teams via email.
Aggregating and reporting the success status of these email notifications.
The workflow is implemented as a Directed Acyclic Graph (DAG) of components, each representing a discrete step or action in the processing pipeline. These components interact via well-defined inputs and outputs.
Detailed Components Description
The file describes a DSL (Domain-Specific Language) workflow with multiple components interconnected. Below is a detailed explanation of each component and its parameters.
1. Begin Component (begin)
Type:
BeginPurpose: Entry point of the workflow where the customer review text is input.
Parameters:
enablePrologue: true (displays an initial greeting message)inputs: single required input named "review" of type"line"for entering the review text.mode:"conversational"allowing interactive input.prologue: A welcome message"Hi! I'm your customer review analysis assistant. You can send a review to me.\n"
Upstream: None (start node)
Downstream: Categorize:RottenWallsObey
Usage Example:
User inputs a review text at this node to start the analysis.
2. Categorize Component: Categorize:RottenWallsObey
Type:
CategorizePurpose: First level classification to distinguish between positive and negative reviews.
Parameters:
category_description:Negative review: Reviews that indicate dissatisfaction or issues.
Positive review: Reviews expressing satisfaction or praise.
llm_id:"deepseek-chat@DeepSeek"(the LLM used for classification)llm_filter:"all"(process all inputs)message_history_window_size: 1 (context window size for LLM)query: "sys.query" (the input text passed to LLM)temperature: 0.2 (controls randomness in LLM output)outputs: includescategory_name(string) indicating classification result.
Upstream:
beginDownstream:
For
"Negative review": Categorize:FourTeamsFoldFor
"Positive review":Email:WickedSymbolsLeave
Usage Example:
Input: "I have issues with my product."
Output: category_name = "Negative review" → routes to further categorization.
3. Categorize Component: Categorize:FourTeamsFold
Type:
CategorizePurpose: Second-level classification for negative reviews to specify the issue category.
Parameters:
category_description:After-sales issues: Problems related to product quality or replacement.
Transportation issue: Problems related to delivery or shipment delays.
llm_id:"deepseek-chat@DeepSeek"message_history_window_size: 1query: "sys.query"temperature: 0 (deterministic output)outputs:category_name(string)
Upstream: Categorize:RottenWallsObey
Downstream:
For
"After-sales issues":Email:SharpDeerExistFor
"Transportation issue":Email:ChillyBusesDraw
Usage Example:
Input: "The product easily broke down."
Output: category_name = "After-sales issues" → routes email to product experience department.
4. Email Components
There are three email components responsible for sending categorized review notifications to different departments:
Email:WickedSymbolsLeave
Handles emails for positive reviews.
Parameters include SMTP server details (empty placeholders), email content (
{begin@1}), and outputs a booleansuccessflag.
Email:SharpDeerExist
Handles emails related to after-sales issues.
Same parameters as above.
Email:ChillyBusesDraw
Handles emails related to transportation issues.
Same parameters as above.
All email components share a similar parameter structure:
Parameter | Type | Description | Default/Example |
|---|---|---|---|
cc_email | string | CC recipient emails | "" (empty) |
content | string | Email body content (from review input) | "{begin@1}" |
string | Sender email address | "" (empty) | |
outputs | object | Contains | |
password | string | SMTP password | "" (empty) |
sender_name | string | Name of email sender | "" (empty) |
smtp_port | number | SMTP server port | 465 |
smtp_server | string | SMTP server address | "" (empty) |
subject | string | Email subject | "" (empty) |
to_email | string | Recipient email address | "" (empty) |
Upstream:
Email:WickedSymbolsLeave← Categorize:RottenWallsObey (positive reviews)Email:SharpDeerExist← Categorize:FourTeamsFold (after-sales)Email:ChillyBusesDraw← Categorize:FourTeamsFold (transportation)
Downstream: All lead to
StringTransform:FuzzySpiesTrain
5. StringTransform Component: StringTransform:FuzzySpiesTrain
Type:
StringTransformPurpose: Aggregates the success flags from all email components into a single merged string.
Parameters:
delimiters: [","]method:"merge"(merges multiple strings)script: Concatenates success status from all email sends:{Email:WickedSymbolsLeave@success}{Email:SharpDeerExist@success}{Email:ChillyBusesDraw@success}outputs:result(string)
Upstream: Email components
Downstream:
Message:ShaggyAnimalsWin
6. Message Component: Message:ShaggyAnimalsWin
Type:
MessagePurpose: Displays or logs the result string from the
StringTransformcomponent.Parameters:
content: List containing the result string fromStringTransform:FuzzySpiesTrain
Upstream:
StringTransform:FuzzySpiesTrainDownstream: None (end node)
Important Implementation Details and Algorithms
Hierarchical Classification Using LLM:
The workflow uses two hierarchicalCategorizecomponents leveraging a Large Language Model (deepseek-chat@DeepSeek) to classify reviews first as positive or negative, then sub-classifies negative reviews into more specific categories.LLM Parameters:
Parameters such astemperature,message_history_window_size, andllm_filtercontrol the LLM behavior and output determinism.Routing via Email:
After classification, emails are sent to relevant departments. The email parameters are placeholders and need to be configured with actual SMTP credentials and addresses.Result Aggregation:
TheStringTransformcomponent merges the success flags of all email sends, which is useful for monitoring and reporting.Conversational Mode:
TheBegincomponent uses a conversational mode with a prologue greeting, enabling an interactive review input.
Interaction with Other System Parts
Input Source:
Customer reviews are input manually or via an integrated customer feedback system into theBegincomponent.LLM Service:
The workflow depends on an external LLM service identified byllm_id = "deepseek-chat@DeepSeek"for natural language classification.Email Infrastructure:
Requires configuration of SMTP servers and credentials to send emails to departments.Downstream Systems:
The emails are expected to be received and processed by relevant departmental systems or personnel for further action.Monitoring:
The final message component can be used by UI or logging systems to monitor workflow success.
Workflow Diagram
flowchart TD
Begin["Begin\n(Input review)"] --> Categorize1["Categorize: RottenWallsObey\n(Positive / Negative)"]
Categorize1 -- Negative review --> Categorize2["Categorize: FourTeamsFold\n(After-sales / Transportation)"]
Categorize1 -- Positive review --> EmailPositive["Email: WickedSymbolsLeave\n(Positive review email)"]
Categorize2 -- After-sales issues --> EmailAfterSales["Email: SharpDeerExist\n(After-sales email)"]
Categorize2 -- Transportation issue --> EmailTransportation["Email: ChillyBusesDraw\n(Transportation email)"]
EmailPositive --> StringMerge["StringTransform: FuzzySpiesTrain\n(Merge email success flags)"]
EmailAfterSales --> StringMerge
EmailTransportation --> StringMerge
StringMerge --> Message["Message: ShaggyAnimalsWin\n(Display aggregated result)"]
Summary
The customer_review_analysis.json file defines a multi-stage automated customer review classification and routing workflow using a Large Language Model to categorize reviews and send corresponding emails. It is designed to improve customer support efficiency by automatically directing feedback to the relevant internal teams based on review sentiment and issue type.
Usage Example
Suppose a customer submits the review:
"The transportation is delayed too much. I can't find where is my order now."
Workflow Execution:
Input the review in
Begin.Categorize:RottenWallsObey identifies it as a Negative review.
Categorize:FourTeamsFold further classifies it as a Transportation issue.
An email is sent via
Email:ChillyBusesDrawto the transportation department.Email success flags are merged and displayed in the final
Messagenode.
This modular and extensible structure allows for easy updates, such as adding more categories or adjusting email parameters, to tailor the workflow to evolving business needs.