augmentation¶
topic_segmentation.augmentation
Document augmentation (DA) and topic-aware sentence structure (TSSP) labels for the paired views.
Unit
dataclass
¶
AugmentedDocument
dataclass
¶
Source code in src/topic_segmentation/augmentation.py
12 13 14 15 16 17 | |
split_units(texts, labels, input_ids, boundary_ids)
¶
Source code in src/topic_segmentation/augmentation.py
20 21 22 23 24 25 26 27 | |
section_spans(document, boundary_label)
¶
Source code in src/topic_segmentation/augmentation.py
30 31 32 33 | |
mix_sections(documents, topic_spans, document_index, rng)
¶
Shuffle topics, optionally drawing replacements from another document.
Source code in src/topic_segmentation/augmentation.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
pair_order(position, sentence_indices)
¶
TSSP label of a shuffled sentence: 2 opens a topic, 0 follows its predecessor, 1 otherwise.
Source code in src/topic_segmentation/augmentation.py
58 59 60 61 62 | |
shuffle_units(document, label_to_id, rng)
¶
Source code in src/topic_segmentation/augmentation.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
augment(sentences, labels, tokenized, label_to_id, boundary_ids, rng)
¶
Create one augmented view per document, drawing from rng in document order.
Source code in src/topic_segmentation/augmentation.py
83 84 85 86 87 88 89 90 91 | |