pelinker.onto¶
ChunkMapper
dataclass
¶
Bases: BaseDataclass
Maps encoder chunks back to documents and optional pooled span rows.
When :func:pelinker.util.texts_to_vrep runs multiple word_modes, it calls
:func:pelinker.util.render_elementary_tensor_table repeatedly on the same
instance. Fields text_word_spans_list, token_word_spans_list,
tt_expressions, and mapping_table therefore reflect only the last
grouping pass; read per-mode results from :class:ReportBatch instead.
Source code in pelinker/onto.py
MentionCandidate
dataclass
¶
Bases: BaseDataclass
Typed mention payload used by :class:pelinker.model.Linker predictions.
Source code in pelinker/onto.py
ReportBatch
dataclass
¶
Bases: BaseDataclass
Batch of texts with shared encoder state and one holder list per WordGrouping.
chunk_mapper is shared across groupings; its span/pooling fields may match
only the last mode processed—use _data / __getitem__ for mode-specific
embeddings and expressions.
Source code in pelinker/onto.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
get_text_embeddings(layers_spec)
¶
Extract sentence-level embeddings for each text in the batch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers_spec
|
str | list[int]
|
Layer specification (string digits or negative indices); see
:func: |
required |
Returns:
| Type | Description |
|---|---|
|
list[torch.Tensor]: List of embeddings, one per text in self.texts |