ModernBookNLP speaker attribution, Core ML
A Core ML conversion of the quotation-attribution model in ModernBookNLP
(ModernBERT_T2000.safetensors: a ModernBERT-large encoder fine-tuned to find who speaks each quotation in fiction),
for on-device use on iPhone and iPad.
Files:
ModernBookNLP_L2560_pal6.mlpackage: the encoder, a fixed 2,560-token window, weights palettized to 6 bits (k-means, grouped by 16 channels), float16, iOS 18+. It runs almost entirely on the Neural Engine. Inputinput_idsandattention_mask(int32, 1ร2560, pad id 50283); outputhidden(1ร2560ร1024). Attention masks use -1e4 instead of float32's minimum, so float16 padding rows stay finite.speaker-head.bin: the scoring head, float16, little-endian: W0 (2048ร4096, batch norm folded in), b0 (2048), W3 (2048), b3 (1). Score(quote, mention) = W3 ยท GELU(W0 ยท [h(q_start), h(q_end), h(m_start), h(m_end)] + b0) + b3.tokenizer.json: ModernBERT's tokenizer, unchanged.
Quality: on four PDNC novels (4,526 quotations), the converted model's speaker picks agree with the PyTorch original on 98.2% of quotations, with the same accuracy (75.3% vs 75.1% speaker correct, using BookNLP's pipeline).
Credits and licenses: ModernBookNLP by its authors (gasmichel, MIT); ModernBERT by Answer.AI and LightOn
(Apache-2.0); BookNLP by David Bamman (MIT, see LICENSE-BookNLP). Converted by Quack Later; the conversion is
released under the MIT license.
- Downloads last month
- 12
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for quacklater/ModernBookNLP-CoreML
Base model
answerdotai/ModernBERT-large