πŸ“„ zero_vs_many_entitiesΒΆ

Note

ID: operators.balancers.ner.zero_vs_many_entities | Type: LengthBalancer

{
    "fields": [
        "outputs/labels"
    ],
    "segments_boundaries": [
        1
    ],
    "type": "length_balancer"
}

Explanation about LengthBalancerΒΆ

Balances by a signature that reflects the total length of the fields’ values, quantized into integer segments.

Args:

segments_boundaries (List[int]): distinct integers sorted in increasing order, that maps a given total length into the index of the least of them that exceeds the total length. (If none exceeds – into one index beyond, namely, the length of segments_boundaries)

fields (Optional, List[str])

Example:

when input [{β€œa”: [1, 3], β€œb”: 0, β€œid”: 0}, {β€œa”: [1, 3], β€œb”: 0, β€œid”: 1}, {β€œa”: [], β€œb”: β€œa”, β€œid”: 2}] is fed into

LengthBalancer(fields=["a"], segments_boundaries=[1])

input instances will be counted and balanced against two categories: empty total length (less than 1), and non-empty.

Read more about catalog usage here.