5 "When Sebastian Thrun started working on self-driving cars at "
6 "Google in 2007, few people outside of the company took him "
7 "seriously. “I can tell you very senior CEOs of major American "
8 "car companies would shake my hand and turn away because I wasn’t "
9 "worth talking to,” said Thrun, in an interview with Recode earlier "
15 return spacy
.load("en_core_web_sm")
19 def doc_en_core_web_sm(en_core_web_sm
):
20 return en_core_web_sm(en_text
)
23 def test_entities(doc_en_core_web_sm
):
24 entities
= list(map(lambda e
: (e
.text
, e
.label_
),
25 doc_en_core_web_sm
.ents
))
28 ('Sebastian Thrun', 'PERSON'),
33 ('earlier this week', 'DATE'),
37 def test_nouns(doc_en_core_web_sm
):
39 chunk
.text
for chunk
in doc_en_core_web_sm
.noun_chunks
] == [
49 'major American car companies',
57 def test_verbs(doc_en_core_web_sm
):
59 token
.lemma_
for token
in doc_en_core_web_sm
if token
.pos_
== "VERB"] == [