
u"Google in 2007, few people outside of the company took him "
u"seriously. “I can tell you very senior CEOs of major American "
u"car companies would shake my hand and turn away because I wasn’t "
u"worth talking to,” said Thrun, now the co-founder and CEO of "
u"online higher education startup Udacity, in an interview with "
u"Recode earlier this week.")
doc = nlp(text)
# Find named entities, phrases and concepts
for entity in doc.ents:
print(entity.text, entity.label_)
# Determine semantic similarities
doc1 = nlp(u"my fries were super gross")
doc2 = nlp(u"such disgusting fries")
similarity = doc1.similarity(doc2)
print(doc1.text, doc2.text, similarity)
在这个示例中,我们首先下载English tokenizer, tagger, parser, NER和word vectors。然后创建一些文本,打印找到的实体、短语和概念,最后确定两个短语的语义相似性。运行这段代码,你会得到:
Sebastian Thrun PERSON
Google ORG
2007 DATE
American NORP
Thrun PERSON
Recode ORG
earlier this week DATE
my fries were super gross such disgusting fries 0.7139701635071919
2. jupytext
重启Jupyter,即运行:
jupyter notebook
你可以在这里试试:
1.Chartify ——让数据科学家很容易创建图表的Python库
ch.set_subtitle("Represent changes in distribution.")
ch.plot.area(
data_frame=total_quantity_by_month_and_fruit,
x_column='month',
y_column='quantity',
color_column='fruit',
stacked=True)
ch.show('png')
超级容易创建一个互动的plot。
更多示例:

免责声明:本网站部 分文章和信息来源于互联网,本网转载出于传递更多信息和学习之目的,并不意味着赞同其观点或证实其内容的真实性。如转载稿涉及版权等问题,请立即联系管理
员,我们会予以更改或删除相关文章,保证您的权利。对使用本网站信息和服务所引起的后果,本网站不作任何承诺。