From 3aff8834344071974503d7a9b819260161273448 Mon Sep 17 00:00:00 2001 From: ines Date: Tue, 23 May 2017 23:15:39 +0200 Subject: [PATCH] Add displaCy examples to lightning tour --- website/docs/usage/lightning-tour.jade | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/website/docs/usage/lightning-tour.jade b/website/docs/usage/lightning-tour.jade index 967d0c61e..24654b853 100644 --- a/website/docs/usage/lightning-tour.jade +++ b/website/docs/usage/lightning-tour.jade @@ -24,6 +24,23 @@ p en_doc = en_nlp(u'Hello, world. Here are two sentences.') de_doc = de_nlp(u'ich bin ein Berliner.') ++h(2, "displacy-dep") Visualize a dependency parse in your browser + ++code. + from spacy import displacy + + doc = nlp(u'This is a sentence.') + displacy.serve(doc, style='dep') + ++h(2, "displacy-ent") Visualize named entities in your browser + ++code. + from spacy import displacy + + doc = nlp(u'When Sebastian Thrun started working on self-driving cars at ' + u'Google in 2007, few people outside of the company took him seriously.') + displacy.serve(doc, style='ent') + +h(2, "multi-threaded") Multi-threaded generator +code.