Created
May 18, 2021 20:35
-
-
Save conormm/25c5219ebecdaaf02a46071e8de650b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract_tokens_plus_meta(doc:spacy.tokens.doc.Doc): | |
"""Extract tokens and metadata from individual spaCy doc.""" | |
return [ | |
(i.text, i.i, i.lemma_, i.ent_type_, i.tag_, | |
i.dep_, i.pos_, i.is_stop, i.is_alpha, | |
i.is_digit, i.is_punct) for i in doc | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment