mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: enforce nlp entity weight restrictions
This commit is contained in:
@@ -82,7 +82,7 @@ For each entity in the block's pattern:
|
||||
- `Confidence` is a value between 0 and 1, returned by the NLU engine.
|
||||
- `Weight` is a configured importance factor for that specific entity type.
|
||||
- If the match is a wildcard (i.e., the block accepts any value):
|
||||
- A **penalty factor** is applied to slightly reduce its contribution:
|
||||
- A **penalty factor** is applied to slightly reduce its contribution:
|
||||
``confidence × weight × penaltyFactor``. This encourages more specific matches when available.
|
||||
|
||||
### Scoring Formula Summary
|
||||
|
||||
@@ -61,7 +61,7 @@ export class NlpEntityStub extends BaseSchema {
|
||||
/**
|
||||
* Entity's weight used to determine the next block to trigger in the conversational flow.
|
||||
*/
|
||||
@Prop({ type: Number, default: 1 })
|
||||
@Prop({ type: Number, default: 1, min: 0 })
|
||||
weight: number;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user