Last active
March 20, 2019 10:06
-
-
Save GeorgeSeif/9bd66eb275af34a18523b1c29fcc7bc5 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
| # coding: utf-8 | |
| import spacy | |
| ### Load spaCy's English NLP model | |
| nlp = spacy.load('en_core_web_lg') | |
| ### The text we want to examine | |
| text = "Amazon.com, Inc., doing business as Amazon, is an American electronic commerce and cloud computing company based in Seattle, Washington, that was founded by Jeff Bezos on July 5, 1994. The tech giant is the largest Internet retailer in the world as measured by revenue and market capitalization, and second largest after Alibaba Group in terms of total sales. The amazon.com website started as an online bookstore and later diversified to sell video downloads/streaming, MP3 downloads/streaming, audiobook downloads/streaming, software, video games, electronics, apparel, furniture, food, toys, and jewelry. The company also produces consumer electronics - Kindle e-readers, Fire tablets, Fire TV, and Echo - and is the world's largest provider of cloud infrastructure services (IaaS and PaaS). Amazon also sells certain low-end products under its in-house brand AmazonBasics." | |
| ### Parse the text with spaCy | |
| ### Our 'document' variable now contains a parsed version of text. | |
| document = nlp(text) | |
| ### print out all the named entities that were detected | |
| for entity in document.ents: | |
| print(entity.text, entity.label_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment