messageParser Documentation
Overview
The messageParser component is a part of the Vantage analytics and data platform, specifically designed to process and categorize incoming messages from various communication channels. It parses message texts to detect their source channel, categorize them based on user-defined rules, and assign priority levels based on specific keywords. This functionality can be crucial for businesses that handle large volumes of messages across different platforms, such as email, SMS, or social media.
Purpose
The primary purpose of the messageParser is to enhance the user experience in managing communication by automating the classification of messages. By detecting the source channel, categorizing based on content, and identifying the urgency of messages, organizations can streamline their response processes and improve operational efficiency.
Settings
The messageParser component has several configurable settings that dictate its behavior during the parsing process. Below is a detailed description of each setting:
1. messageColumn
- Input Type: String
- Description: Specifies the name of the column within the input data that contains the text of the message to be parsed. This is crucial as it directs the parser to the correct data field for analysis.
- Default Value:
"body"
2. senderColumn
- Input Type: String (optional)
- Description: Indicates the column name that contains the sender's information. If present, this data will be used for channel detection alongside message content. If omitted, only the message text will be analyzed.
- Default Value:
"from"
3. subjectColumn
- Input Type: String (optional)
- Description: Defines the column name that contains the subject of the message (relevant primarily for email messages). This helps in enriching the message text during the categorization process.
- Default Value:
"subject"
4. channelColumn
- Input Type: String (optional)
- Description: If specified, indicates the column that directly contains the channel information (e.g., Email, SMS, etc.). If left empty, the parser will automatically detect the channel based on the sender and message content.
- Default Value:
""(no explicit detection)
5. categories
- Input Type: Array of Objects
- Description: An array of user-defined category rules. Each object contains a
labelwhich is the name of the category andkeywords, a comma-separated string that lists keywords associated with that category. The parser uses these keywords to classify messages. - Default Value:
[](empty array)
6. priorityKeywords
- Input Type: Object
- Description: An object with two sub-properties (
urgentandlow). Each sub-property is a comma-separated string of keywords used to assess the priority of messages. The parsing logic checks if any of these keywords appear in the message text. - Sub-properties:
- urgent: Keywords indicating time-sensitive or critical messages.
- low: Keywords indicating messages that are not urgent.
- Default Value:
json
{ "urgent": "urgent, asap, critical, emergency, immediately", "low": "fyi, no rush, when you can, low priority" }
7. defaultCategory
- Input Type: String
- Description: The category that should be assigned to messages that do not match any keywords from the defined categories. This ensures that all incoming messages can still be categorized even if they lack specific keywords.
- Default Value:
"General"
8. defaultPriority
- Input Type: String
- Description: Defines the default priority level assigned to messages that do not contain any keywords identified for urgency or low priority. This ensures consistent handling of non-urgent messages.
- Default Value:
"normal"
How It Works
-
Input Handling:
messageParseraccepts input data through itsinputsparameter. It processes incoming messages and checks for valid input formats. -
Column Parsing: It uses the configured column names to extract the message text, sender information, and optional subject.
-
Channel Detection: The component attempts to determine the message's source channel. If a channel column is provided, it uses that; otherwise, it employs regex patterns to identify channels based on sender and message content.
-
Message Categorization: The text from the message and subject is analyzed against user-defined categories. The first match with any defined keyword leads to the assignment of the respective category.
-
Priority Assignment: The text is also scanned for keywords that indicate urgency or low priority. The corresponding priorities are assigned based on the keywords found.
-
Output Preparation: The parsed and categorized messages are compiled into a new data structure which is then returned as the output.
Use Cases & Examples
Use Case 1: Customer Support Automation
A company receives numerous customer inquiries through various channels (email, SMS, and social media). Using the messageParser, they can automatically categorize these messages into relevant categories such as "Support" and "Sales," enabling their support team to prioritize responses accordingly.
Use Case 2: Marketing Campaign Feedback
A marketing team utilizes the messageParser to analyze feedback from campaign responses across different platforms. Categorizing the messages will help them identify whether customers are mostly interested in promotions, discounts, or product information.
Concrete Example Configuration
Suppose a retail company wants to enable the messageParser to efficiently categorize and prioritize incoming support tickets from customers. They might configure the component as follows:
{
"messageColumn": "body",
"senderColumn": "from",
"subjectColumn": "subject",
"channelColumn": "channel",
"categories": [
{ "label": "Support", "keywords": "help, issue, problem, broken" },
{ "label": "Sales", "keywords": "pricing, quote, demo, purchase" }
],
"priorityKeywords": {
"urgent": "urgent, asap, critical, emergency, immediately",
"low": "fyi, no rush, when you can, low priority"
},
"defaultCategory": "General",
"defaultPriority": "normal"
}In this configuration:
- The system will categorize messages as "Support" if they contain keywords related to problems or issues.
- Messages can be flagged as "urgent" if they use any conditional urgency-related keywords, enabling the team to respond effectively to high-priority inquiries.
Conclusion
The messageParser component is a powerful tool for businesses looking to enhance their messaging management capabilities. By configuring it appropriately, organizations can automate the categorization and prioritization of messages, which is crucial for improving response times and operational efficiency.