Update formatting of deprecation note

This commit is contained in:
ines 2017-11-01 14:13:08 +01:00
parent a7bf38bf31
commit 9e429b5a8a
3 changed files with 39 additions and 39 deletions

View File

@ -58,7 +58,6 @@ p
nlp.from_disk(model_data_path) # load in model data
+infobox("Deprecation note", "⚠️")
.o-block
| As of spaCy 2.0, the #[code path] keyword argument is deprecated. spaCy
| will also raise an error if no model could be loaded and never just
| return an empty #[code Language] object. If you need a blank language,
@ -66,6 +65,7 @@ p
| or import the class explicitly, e.g.
| #[code from spacy.lang.en import English].
+code-wrapper
+code-new nlp = spacy.load('/model')
+code-old nlp = spacy.load('en', path='/model')

View File

@ -84,11 +84,11 @@ p
+cell A container for accessing the annotations.
+infobox("Deprecation note", "⚠️")
.o-block
| Pipeline components to prevent from being loaded can now be added as
| a list to #[code disable], instead of specifying one keyword argument
| per component.
+code-wrapper
+code-new doc = nlp(u"I don't want parsed", disable=['parser'])
+code-old doc = nlp(u"I don't want parsed", parse=False)
@ -533,13 +533,13 @@ p
+cell The modified #[code Language] object.
+infobox("Deprecation note", "⚠️")
.o-block
| As of spaCy v2.0, the #[code save_to_directory] method has been
| renamed to #[code to_disk], to improve consistency across classes.
| Pipeline components to prevent from being loaded can now be added as
| a list to #[code disable], instead of specifying one keyword argument
| per component.
+code-wrapper
+code-new nlp = English().from_disk(disable=['tagger', 'ner'])
+code-old nlp = spacy.load('en', tagger=False, entity=False)
@ -595,11 +595,11 @@ p Load state from a binary string.
+cell The #[code Language] object.
+infobox("Deprecation note", "⚠️")
.o-block
| Pipeline components to prevent from being loaded can now be added as
| a list to #[code disable], instead of specifying one keyword argument
| per component.
+code-wrapper
+code-new nlp = English().from_bytes(bytes, disable=['tagger', 'ner'])
+code-old nlp = English().from_bytes('en', tagger=False, entity=False)

View File

@ -203,12 +203,12 @@ p
| dict describes a token.
+infobox("Deprecation note", "⚠️")
.o-block
| As of spaCy 2.0, #[code Matcher.add_pattern] and #[code Matcher.add_entity]
| are deprecated and have been replaced with a simpler
| #[+api("matcher#add") #[code Matcher.add]] that lets you add a list of
| patterns and a callback for a given match ID.
+code-wrapper
+code-new.
matcher.add('GoogleNow', merge_phrases, [{ORTH: 'Google'}, {ORTH: 'Now'}])