Rules & Conditions
Rules & Conditions help you narrow in on your classifications for your ensemble.
You can create separate Rules & Conditions for each label in a classifier. Each condition can use one of three conditional matching strategies: Sentence text, Sentiment, or Classification.

Using sentence text rules

When you select Sentence text as a condition, you can match text using keywords. Caravel provides the ability to match exact characters using Contains, approximate keywords using Fuzzy matches, and exact keyword matching with advanced query capabilities using Search matches.
With both Fuzzy matches and Search matches conditions you can assemble queries to search for multiple combinations of keywords. Read on below
👇
to learn how to use the powerful search capabilities made available to you.

Contains

When using the Contains condition, Caravel will do a verbatim match for the characters you input regardless of where they occur in a sentence.
This would match any sentences that contains "shop", like "shopping", "workshop", "bishop", etc.
Alternatively, you can use the Not contains condition to ignore any sentences that contain "shop":
This would ignore any sentences that contain "shop", like "shopping", "workshop", "bishop", etc.

Fuzzy matches

Fuzzy matches uses approximate search to match keywords in sentences. The 'fuzzy' refers to the fact that Caravel does not look for a perfect match when comparing two keywords. Instead, it will allow some degree of mismatch (or 'fuzziness').
The use of shop with Fuzzy matches will pickup mentions of "shop", "shopped", and "shopping" but will ignore "workshop", "bishop", and "shopify".
It also will not match "shopper" because shop and shopper have different meanings. However, with fuzzy matching, we can use a simple query syntax to match on both keywords:
Using the OR operator | ensures our classifier picks up variations of the keyword shop OR shopper.
You can also use the AND operator & to require two or more keywords to exist in a sentence:
And you can use parenthesis to group keywords together and match on combinations of operators:
This condition will match approximations of keywords "bug", "glitch", "problem", "broken", or "issue" when they occur in the same sentences as approximations of "checkout" or "cart". For example, it would positively match with the following examples:
There are problems with the shopping cart
I had an issue with the checkout
The checkout is broken

Search matches

Like Fuzzy matches, Search matches will match by keywords. But unlike Fuzzy match, it does verbatim keyword matching while also allowing for more advanced search queries like prefixes and phrase proximity.
This will match the "shop" keyword but not "shopping".
Whereas appending "shop" with the prefix operator :* will result in matches for both "shop" and "shopping".
You can use the phrase proximity operator <-> to match keywords that follow one another within a certain keyword distance:
Using <-> will match sentences where the word "issue" immediately follows the word "checkout". And you can user numbers to define the range:
This would match a sentence that has word "checkout" followed by the word "issue" as long as it occurs within three words or less.
And just like Fuzzy matches, you can use parenthesis ()to create groups, along with the & and | operators:

Using sentiment as a condition

You can use sentiment classification in your Rules & Conditions in ensembles to further refine your ensemble's classification.

Using classifications as a condition

You can use Caravel's prebuilt classifiers in your Rules & Conditions to further refine prebuilt classifiers into custom sub-topics:
And you can use this in combination with other Rules & Conditions narrow your classification:
This would use Caravel's Bug classifier in combination with keyword search to identify bugs with your checkout experience.
Alternatively, you could input "checkout" as a Zero-shot label with a Bug classification condition. This would use Caravel's Zero Shot Classification capability to predict mentions of the checkout experience within the context of bugs.
Copy link
On this page
Using sentence text rules
Contains
Fuzzy matches
Search matches
Using sentiment as a condition
Using classifications as a condition