Skip to content

how to add header when using a parser I trained rather than provided by conllu #22

Answered by BramVanroy
toufiglu asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @toufiglu thanks for the question. If you load your own spaCy model, you'll need to add the spacy_conll component separately, like so:

nlp = spacy.load(...)  # load your own trained parser

# add spacy_conll
config = {"include_headers": True}
nlp.add_pipe("conll_formatter", config=config, last=True)

# parse
doc = nlp ("كنت كتعصب فاش مكتبغيش تصيب ليك")
print (doc._.conll_pd)

This is described in Usage.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@toufiglu
Comment options

@BramVanroy
Comment options

Answer selected by toufiglu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants