Created
April 21, 2019 16:09
-
-
Save keithrozario/dcc85b21a5192f409a4c28dd16381668 to your computer and use it in GitHub Desktop.
spaCy Lambda Layer example
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
import spacy | |
import json | |
def lambda_handler(event, context): | |
nlp = spacy.load('/opt/en_core_web_sm-2.1.0') | |
test = 'Keith is one awesome dude' | |
nlp_test = nlp(test) | |
output_ner = [(i, i.label_, i.label) for i in nlp_test.ents] | |
print(output_ner) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment