MCPcopy Create free account
hub / github.com/awslabs/gap-text2sql / gen_position_indicator

Function gen_position_indicator

relogic/logickit/utils/utils.py:31–37  ·  view source on GitHub ↗
(span, length)

Source from the content-addressed store, hash-verified

29 return np.exp(-np.logaddexp(0, -x))
30
31def gen_position_indicator(span, length):
32 indicator = [0] * length
33 for idx, i in enumerate(range(span[0], -1, -1)):
34 indicator[i] = -idx
35 for idx, i in enumerate(range(span[1], length)):
36 indicator[i] = idx + 1
37 return indicator
38
39def indicator_vector(index, length, default_label=0, indicator_label=1, head_index=None):
40 vector = [default_label] * length

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected