Views
No views yet
d_model 1024, depth 32, banded attention: three of every four blocks attend within a
256-character window, the fourth globally). Its input is factored into five aligned planes --
letters, word/sentence boundaries, diacritics, capitalization, punctuation -- each of which can
be masked independently to an explicit unknown state at inference. That is what lets one model
read an edited text, scriptio continua, and a lacuna of unknown length without changing
anything but its input.Stoicheia-doc_clean with four heads on one shared backbone through an ELMo-style scalar mix:
factored XPOS, an edit-script lemmatizer, a UPOS auxiliary, and a biaffine dependency parser.
Everything below comes from a single forward pass -- there is no pipeline of separate models.1import sys, torch
2from transformers import AutoModel
3from huggingface_hub import snapshot_download
4
5REPO = "anonymous-stoicheia/Stoicheia-tagger-parser"
6# this model's processor needs the label vocabularies beside it, so take the whole snapshot
7local = snapshot_download(REPO, allow_patterns=["*.json", "*.txt", "*.py", "*.model"])
8sys.path.insert(0, local)
9from processing_char_bert_joint import CharBertJointProcessor
10
11model = AutoModel.from_pretrained(REPO, trust_remote_code=True).eval()
12proc = CharBertJointProcessor.from_pretrained(local)
13
14batch = proc(["μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος".split()])
15with torch.no_grad():
16 out = model(**batch)
17
18for i, w in enumerate(proc.decode(out, batch, ud=True)[0], 1):
19 print(i, w["form"], w["lemma"], w["upos"], w["xpos"], w["head"], w["deprel"])
20# 1 μῆνιν μῆνις NOUN ... 2 obj
21# 2 ἄειδε ἀείδω VERB ... 0 root
22# 3 θεὰ θεά NOUN ... 2 orphan
23# 4 Πηληϊάδεω Πηληιάδης NOUN ... 5 appos
24# 5 Ἀχιλῆος Ἀχιλλεύς NOUN ... 1 nmod