textRuleDevelop compileCategory

Standard Customer Feedback Categorization

Scénario de test & Cas d'usage

Business Context

A retail company receives thousands of customer reviews daily. They want to automatically classify these reviews into broad topics such as 'Shipping', 'Product Quality', and 'Billing' to route them to the correct department. This scenario tests the basic functionality of the action using standard English rules.
Data Preparation

Creation of a rule definition table for classifying feedback.

Copied!
1 
2DATA mycas.feedback_rules;
3LENGTH config $200;
4INFILE DATALINES dsd;
5INPUT config $;
6DATALINES;
7"CATEGORY:Shipping,(OR, 'late', 'delay', 'not received', 'tracking')" "CATEGORY:Billing,(OR, 'charge', 'invoice', 'credit card', 'refund')" "CATEGORY:Quality,(OR, 'broken', 'damaged', 'poor', 'defective')" ;
8 
9RUN;
10 

Étapes de réalisation

1
Load the rule definitions into memory.
Copied!
1 
2PROC CAS;
3TABLE.loadTable / path='feedback_rules.sashdat' caslib='casuser' casout={name='feedback_rules', replace=true};
4 
5RUN;
6 
2
Compile the category model using default parameters (English).
Copied!
1 
2PROC CAS;
3textRuleDevelop.compileCategory / TABLE={name='feedback_rules'} config='config' casOut={name='feedback_model', replace=true};
4 
5RUN;
6 

Expected Result


The action should successfully compile the text rules and generate a binary model table named 'feedback_model' (MCO file). This model can subsequently be used by the applyCategory action.