You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge branch 'feature/assessment-thresholds' into 'develop'
Enhanced Confidence Threshold Support with Visual Indicators
See merge request genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator!163
Copy file name to clipboardExpand all lines: config_library/pattern-2/default/config.yaml
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,13 @@ classes:
13
13
attributes:
14
14
- name: sender_name
15
15
description: The name of the person or entity who wrote or sent the letter. Look for text following or near terms like 'from', 'sender', 'authored by', 'written by', or at the end of the letter before a signature.
16
+
confidence_threshold: '0.85'
16
17
- name: sender_address
17
18
description: The physical address of the sender, typically appearing at the top of the letter. May be labeled as 'address', 'location', or 'from address'.
19
+
confidence_threshold: '0.8'
18
20
- name: recipient_name
19
21
description: The name of the person or entity receiving the letter. Look for this after 'to', 'recipient', 'addressee', or at the beginning of the letter.
22
+
confidence_threshold: '0.9'
20
23
- name: recipient_address
21
24
description: The physical address where the letter is to be delivered. Often labeled as 'to address' or 'delivery address', typically appearing below the recipient name.
22
25
- name: date
@@ -588,6 +591,7 @@ summarization:
588
591
system_prompt: >-
589
592
You are a document summarization expert who can analyze and summarize documents from various domains including medical, financial, legal, and general business documents. Your task is to create a summary that captures the key information, main points, and important details from the document. Your output must be in valid JSON format. \nSummarization Style: Balanced\\nCreate a balanced summary that provides a moderate level of detail. Include the main points and key supporting information, while maintaining the document's overall structure. Aim for a comprehensive yet concise summary.\n Your output MUST be in valid JSON format with markdown content. You MUST strictly adhere to the output format specified in the instructions.
@@ -13,6 +13,8 @@ The Assessment feature provides automated confidence evaluation of document extr
13
13
-**Per-Attribute Scoring**: Provides individual confidence scores and explanations for each extracted attribute
14
14
-**Token-Optimized Processing**: Uses condensed text confidence data for 80-90% token reduction compared to full OCR results
15
15
-**UI Integration**: Seamlessly displays assessment results in the web interface with explainability information
16
+
-**Confidence Threshold Support**: Configurable global and per-attribute confidence thresholds with color-coded visual indicators
17
+
-**Enhanced Visual Feedback**: Real-time confidence assessment with green/red/black color coding in all data viewing interfaces
16
18
-**Optional Deployment**: Controlled by `IsAssessmentEnabled` parameter (defaults to false for cost optimization)
17
19
-**Flexible Image Usage**: Images only processed when explicitly requested via `{DOCUMENT_IMAGE}` placeholder
18
20
@@ -174,11 +176,161 @@ Assessment results are appended to extraction results in the `explainability_inf
174
176
}
175
177
```
176
178
179
+
## Confidence Thresholds
180
+
181
+
### Overview
182
+
183
+
The assessment feature supports flexible confidence threshold configuration to help users identify extraction results that may require review. Thresholds can be set globally or per-attribute, with the UI providing immediate visual feedback through color-coded displays.
184
+
185
+
### Configuration Options
186
+
187
+
#### Global Thresholds
188
+
Set system-wide confidence requirements for all attributes:
189
+
190
+
```json
191
+
{
192
+
"inference_result": {
193
+
"YTDNetPay": "75000",
194
+
"PayPeriodStartDate": "2024-01-01"
195
+
},
196
+
"explainability_info": [
197
+
{
198
+
"global_confidence_threshold": 0.85,
199
+
"YTDNetPay": {
200
+
"confidence": 0.92,
201
+
"confidence_reason": "Clear match found in document"
202
+
},
203
+
"PayPeriodStartDate": {
204
+
"confidence": 0.75,
205
+
"confidence_reason": "Moderate OCR confidence"
206
+
}
207
+
}
208
+
]
209
+
}
210
+
```
211
+
212
+
#### Per-Attribute Thresholds
213
+
Override global settings for specific fields requiring different confidence levels:
214
+
215
+
```json
216
+
{
217
+
"explainability_info": [
218
+
{
219
+
"YTDNetPay": {
220
+
"confidence": 0.92,
221
+
"confidence_threshold": 0.95,
222
+
"confidence_reason": "Financial data requires high confidence"
223
+
},
224
+
"PayPeriodStartDate": {
225
+
"confidence": 0.75,
226
+
"confidence_threshold": 0.70,
227
+
"confidence_reason": "Date fields can accept moderate confidence"
228
+
}
229
+
}
230
+
]
231
+
}
232
+
```
233
+
234
+
#### Mixed Configuration
235
+
Combine global defaults with attribute-specific overrides:
236
+
237
+
```json
238
+
{
239
+
"explainability_info": [
240
+
{
241
+
"global_confidence_threshold": 0.80,
242
+
"CriticalField": {
243
+
"confidence": 0.85,
244
+
"confidence_threshold": 0.95,
245
+
"confidence_reason": "Override: higher threshold for critical data"
246
+
},
247
+
"StandardField": {
248
+
"confidence": 0.82,
249
+
"confidence_reason": "Uses global threshold of 0.80"
250
+
}
251
+
}
252
+
]
253
+
}
254
+
```
255
+
256
+
### Assessment Prompt Integration
257
+
258
+
Include threshold guidance in your assessment prompts to ensure consistent confidence evaluation:
259
+
260
+
```yaml
261
+
assessment:
262
+
task_prompt: |
263
+
Assess extraction confidence using these thresholds as guidance:
264
+
- Financial data (amounts, taxes): 0.90+ confidence required
265
+
- Personal information (names, addresses): 0.85+ confidence required
266
+
- Dates and standard fields: 0.75+ confidence acceptable
267
+
268
+
Provide confidence scores between 0.0 and 1.0 with explanatory reasoning:
269
+
{
270
+
"attribute_name": {
271
+
"confidence": 0.85,
272
+
"confidence_threshold": 0.90,
273
+
"confidence_reason": "Explanation of confidence assessment"
274
+
}
275
+
}
276
+
```
277
+
177
278
## UI Integration
178
279
179
-
Assessment results automatically appear in the web interface:
280
+
Assessment results automatically appear in the web interface with enhanced visual indicators:
281
+
282
+
### Visual Feedback System
283
+
284
+
The UI provides immediate confidence feedback through color-coded displays:
285
+
286
+
#### Color Coding
287
+
- 🟢 **Green**: Confidence meets or exceeds threshold (high confidence)
0 commit comments