Skip to content
Discussion options

You must be logged in to vote

You can assemble a transformer pipeline with spacy assemble just from a config, or programmatically it's equivalent to what you posted:

nlp = spacy.blank("en")
nlp.add_pipe("transformer")  # set your transformer config in kwarg `config`
nlp.initialize()

Then doc._.trf_data should contain the transformer output similar to the trf pipelines, which you can use with user hooks for things like similarity. (Although at the doc level in many cases other alternatives like sentence-transformers can be better.)

We can think about how to update the examples here, because I can see how it's a bit confusing. It's intended to be more of a sketch to show how that individual method is used internally rat…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@bpben
Comment options

@adrianeboyd
Comment options

@bpben
Comment options

Answer selected by adrianeboyd
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation and website feat / transformer Feature: Transformer
3 participants