Text Processor
Normalize text, remove unwanted content, rank candidates, compare text similarity, or deduplicate lists.
What this block does
The Text Processor block exposes four UI-selected operations:
normalize_textremove_texttext_rankertext_matching
The selected operation controls both the block configuration and the exact keys allowed in msg.payload.
Inputs and configuration
1. Normalize Text (normalize_text)
Configure in the block UI:
normalization_method:lemmatizeorstemmer
Required input in msg.payload:
text(string)
No other input keys are accepted for this mode.
2. Remove Text (remove_text)
Configure in the block UI:
select:remove_html_tagremove_stop_wordsremove_additional_white_spaceremove_using_regexremove_trailing_text
Required input in msg.payload:
text(string)
Required only for remove_using_regex and remove_trailing_text:
pattern(string)
For the other remove modes, pattern must not be present.
3. Text Ranking (text_ranker)
Configure in the block UI:
model_id:ranker_deeporranker_fastthreshold: optional default threshold from the block editor
Required input in msg.payload:
query(string)rank_items(string[])
Optional input in msg.payload:
threshold(number from0to1)
If msg.payload.threshold is provided, it overrides the threshold configured in the block.
4. Text Matching (text_matching)
Configure in the block UI:
operation:similarityordeduplicationmodel_id:- for
similarity:matcher_semanticormatcher_string - for
deduplication: the handler uses semantic deduplication internally
- for
threshold
For operation = similarity, required input in msg.payload:
source_text(string)target_text(string)
For operation = deduplication, required input in msg.payload:
target_texts(string[])
Optional input in msg.payload:
threshold
Threshold rules:
- Semantic matching uses
0to1 - String matching uses
0to100
Outputs
The block sends its result directly as msg.payload.
normalize_text: processed stringremove_text: processed stringtext_ranker: object withrankedanddetailstext_matchingwithsimilarity: object withscoreandpassedtext_matchingwithdeduplication: object withunique_texts
Examples
Normalize text
Input (msg.payload)
{
"text": "Running tests on better normalized words"
}Output (msg.payload)
"run test on better normal word"Remove text with regex
Input (msg.payload)
{
"text": "Order ID: 99123",
"pattern": "[0-9]+"
}Output (msg.payload)
"Order ID: "Rank candidates
Input (msg.payload)
{
"query": "refund policy",
"rank_items": [
"Our refund policy allows returns within 30 days.",
"Shipping usually takes 5 business days."
],
"threshold": 0.6
}Output (msg.payload)
{
"ranked": [
"Our refund policy allows returns within 30 days."
],
"details": {
"Our refund policy allows returns within 30 days.": {
"rank": 1,
"score": 0.78
}
}
}Similarity check
Input (msg.payload)
{
"source_text": "refund period is thirty days",
"target_text": "returns are allowed within 30 days"
}Output (msg.payload)
{
"score": 0.82,
"passed": true
}Deduplicate text list
Input (msg.payload)
{
"target_texts": [
"invoice total is 120",
"invoice total is $120",
"shipping date is tomorrow"
]
}Output (msg.payload)
{
"unique_texts": [
"invoice total is 120",
"shipping date is tomorrow"
]
}Limitations
- Validation is strict: unexpected keys can cause the request to fail.
text_rankeraccepts onlyquery,rank_items, and optionalthreshold.text_matchingaccepts different input keys depending on whether you chosesimilarityordeduplication.
Common mistakes
- Sending
patternfor remove modes that do not use it. - Sending extra keys that are not accepted by the selected operation.
- Using a
0-1threshold for string similarity mode, which expects0-100. - Expecting deduplication to use arbitrary matching models; the request handler switches to semantic deduplication internally.