import spacy
nlp = spacy.blank("en") # empty English pipeline
# create the config with the name of your model
# values omitted will get default values
config = {
"model": {
"@architectures": "spacy-transformers.TransformerModel.v3",
"name": "roberta-base" # XXX customize this bit
}
}
nlp.add_pipe("transformer", config=config)
nlp.initialize() # XXX don't forget this step!
doc = nlp("Robots in disguise")
print(doc._.trf_data) # all the Transformer output is stored here