Parser

class convokit.parser.parser.Parser(spacy_nlp=None, n_threads=1)

Transformer that adds SpaCy parses to each Utterance in a Corpus. This parsing step is a prerequisite for most of the models included in convokit.

Parameters

spacy_nlp – if provided, the Parser will use this SpaCy object to do parsing. Otherwise, it will initialize a SpaCy object via load(‘en’)

transform(corpus: convokit.model.corpus.Corpus) → convokit.model.corpus.Corpus

Runs the SpaCy parser on each utterance in the corpus, and adds the parses to the utterance metadata table.

Returns

corpus, modified with parses assigned to each utterance