Natural Language Processing
Choose the piece that covers more new ground
A shorter spelling covers more new positions
Botie has room for another vocabulary entry. The useful gain is how many still-uncovered positions it adds, which may have little to do with the piece's spelling length.
BOTIE
The inputs we are comparing
Uncovered positions per candidate
Example 1
[
[
0,
1
],
[
2,
3,
4,
5
],
[
6
]
]Example 2
[
[
0,
1,
2
],
[
3
],
[
4,
5
]
]Candidate pieces
Example 1
- 0longer
- 1ab
- 2x
Example 2
- 0xy
- 1lengthy
- 2z
Result for example 1
ab
The longest named candidate adds nothing new
This check uses the pieces from “Choose the candidate with the largest additional coverage”.
BOTIE
- Uncovered positions per candidate
[ [ 2, 7, 9 ], [], [ 0, 1, 3, 4 ] ]- Candidate pieces
- 0xy
- 1longword
- 2z
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
Why must the remaining coverage sets be updated before selecting another entry?
Marginal gains depend on what has already been chosen; avoid counting the same improvement twice.
The marginal position sets are supplied. This is vocabulary selection by coverage, not longest-first tokenisation.
Work through the Python challenges →