edsnlp.utils.collections
dedup(sequence, key=None)
Deduplicate a sequence, keeping the last occurrence of each item.
PARAMETER | DESCRIPTION |
---|---|
sequence |
Sequence to deduplicate
TYPE:
|
key |
Key function to use for deduplication, by default None
TYPE:
|
Source code in edsnlp/utils/collections.py
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|