labelCount

label​Count:​* computes a limit on the number of labels returned by the from​Documents stage.

The following label​Count:​* stage types are available for use in analysis request JSONs:

label​Count:​fixed

An explicit limit that is document-count insensitive.

label​Count:​progressive

A limit that scales progressively with the number of documents.

label​Count:​unlimited

No limit.


label​Count:​reference

References a label​Count:​* component defined in the request or in the project's default components.


label​Count:​fixed

A fixed limit on the number of labels.

{
  "type": "labelCount:fixed",
  "value": 10000
}

value

Type
limit
Default
10000
Required
no

The limit value, inclusive.

label​Count:​progressive

A limit that scales progressively with the number of documents.

{
  "type": "labelCount:progressive",
  "exponent": 0.75,
  "max": "unlimited",
  "min": 0,
  "multiplier": 2
}

Lingo4G uses the following formula to compute the limit:

limit = min ( p max , min ( p min , p multiplier * N p exponent ) )

Where

N
is the number of documents from which Lingo4G collects labels,
p min
is the min property,
p max
is the max property,
p multiplier
is the multiplier property,
p exponent
is the exponent property.

Intuitively, the formula above computes the label limit between the provided minimum and maximum values, but scaling it progressively with the number of documents. The following table shows a few example p multiplier * N p exponent component values for an increasing number of documents.

N (documents) multiplier = 2, exponent= 0.75 multiplier = 4, exponent= 0.75 multiplier = 2, exponent= 0.5 multiplier = 4, exponent= 0.5
100 63 126 20 40
500 211 422 44 89
1000 355 711 63 126
5000 1189 2378 141 282
10000 2000 4000 200 400
100000 11246 22493 632 1264
1000000 63245 126491 2000 4000

exponent

Type
number
Default
0.75
Constraints
value >= 0
Required
no

Smoothing exponent applied to the number of documents, see the formula.

max

Type
limit
Default
unlimited
Required
no

The limit on the maximum number of labels, see the formula.

min

Type
integer
Default
0
Constraints
value >= 0
Required
no

The limit on the minimum number of labels, see the formula.

multiplier

Type
number
Default
2
Constraints
value >= 0
Required
no

Smoothed document count multiplier, see the formula.

label​Count:​unlimited

This component specifies no limit on the number of labels.

{
  "type": "labelCount:unlimited"
}

Consumers of label​Count:​*

The following stages and components take label​Count:​* as input:

Stage or component Property
labels:​from​Documents
  • max​Labels