Union
UnionExtractor
Extractor that repeats extraction multiple times and aggregates results per key.
This extractor calls the base extraction function multiple times (for each entry in overrides) on the same input text and aggregates the structured outputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aggregator
|
Aggregator
|
Aggregator function to use for aggregating results |
required |
overrides
|
list[dict] | dict[str, dict]
|
A list of dictionaries containing parameter overrides for each extraction. |
required |
return_as_list
|
list[str] | None
|
List of field names to return as lists of all extracted values (default: None) |
None
|
**kwargs
|
Additional keyword arguments passed to the base extraction function. |
{}
|
Source code in src/kibad_llm/extractors/union.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |