mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Update formatting of deprecation note
This commit is contained in:
parent
a7bf38bf31
commit
9e429b5a8a
|
@ -58,16 +58,16 @@ p
|
||||||
nlp.from_disk(model_data_path) # load in model data
|
nlp.from_disk(model_data_path) # load in model data
|
||||||
|
|
||||||
+infobox("Deprecation note", "⚠️")
|
+infobox("Deprecation note", "⚠️")
|
||||||
.o-block
|
| As of spaCy 2.0, the #[code path] keyword argument is deprecated. spaCy
|
||||||
| 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
|
||||||
| 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,
|
||||||
| return an empty #[code Language] object. If you need a blank language,
|
| you can use the new function #[+api("spacy#blank") #[code spacy.blank()]]
|
||||||
| you can use the new function #[+api("spacy#blank") #[code spacy.blank()]]
|
| or import the class explicitly, e.g.
|
||||||
| or import the class explicitly, e.g.
|
| #[code from spacy.lang.en import English].
|
||||||
| #[code from spacy.lang.en import English].
|
|
||||||
|
|
||||||
+code-new nlp = spacy.load('/model')
|
+code-wrapper
|
||||||
+code-old nlp = spacy.load('en', path='/model')
|
+code-new nlp = spacy.load('/model')
|
||||||
|
+code-old nlp = spacy.load('en', path='/model')
|
||||||
|
|
||||||
+h(3, "spacy.blank") spacy.blank
|
+h(3, "spacy.blank") spacy.blank
|
||||||
+tag function
|
+tag function
|
||||||
|
|
|
@ -84,13 +84,13 @@ p
|
||||||
+cell A container for accessing the annotations.
|
+cell A container for accessing the annotations.
|
||||||
|
|
||||||
+infobox("Deprecation note", "⚠️")
|
+infobox("Deprecation note", "⚠️")
|
||||||
.o-block
|
| Pipeline components to prevent from being loaded can now be added as
|
||||||
| Pipeline components to prevent from being loaded can now be added as
|
| a list to #[code disable], instead of specifying one keyword argument
|
||||||
| a list to #[code disable], instead of specifying one keyword argument
|
| per component.
|
||||||
| per component.
|
|
||||||
|
|
||||||
+code-new doc = nlp(u"I don't want parsed", disable=['parser'])
|
+code-wrapper
|
||||||
+code-old doc = nlp(u"I don't want parsed", parse=False)
|
+code-new doc = nlp(u"I don't want parsed", disable=['parser'])
|
||||||
|
+code-old doc = nlp(u"I don't want parsed", parse=False)
|
||||||
|
|
||||||
+h(2, "pipe") Language.pipe
|
+h(2, "pipe") Language.pipe
|
||||||
+tag method
|
+tag method
|
||||||
|
@ -533,15 +533,15 @@ p
|
||||||
+cell The modified #[code Language] object.
|
+cell The modified #[code Language] object.
|
||||||
|
|
||||||
+infobox("Deprecation note", "⚠️")
|
+infobox("Deprecation note", "⚠️")
|
||||||
.o-block
|
| As of spaCy v2.0, the #[code save_to_directory] method has been
|
||||||
| As of spaCy v2.0, the #[code save_to_directory] method has been
|
| renamed to #[code to_disk], to improve consistency across classes.
|
||||||
| renamed to #[code to_disk], to improve consistency across classes.
|
| Pipeline components to prevent from being loaded can now be added as
|
||||||
| Pipeline components to prevent from being loaded can now be added as
|
| a list to #[code disable], instead of specifying one keyword argument
|
||||||
| a list to #[code disable], instead of specifying one keyword argument
|
| per component.
|
||||||
| per component.
|
|
||||||
|
|
||||||
+code-new nlp = English().from_disk(disable=['tagger', 'ner'])
|
+code-wrapper
|
||||||
+code-old nlp = spacy.load('en', tagger=False, entity=False)
|
+code-new nlp = English().from_disk(disable=['tagger', 'ner'])
|
||||||
|
+code-old nlp = spacy.load('en', tagger=False, entity=False)
|
||||||
|
|
||||||
+h(2, "to_bytes") Language.to_bytes
|
+h(2, "to_bytes") Language.to_bytes
|
||||||
+tag method
|
+tag method
|
||||||
|
@ -595,13 +595,13 @@ p Load state from a binary string.
|
||||||
+cell The #[code Language] object.
|
+cell The #[code Language] object.
|
||||||
|
|
||||||
+infobox("Deprecation note", "⚠️")
|
+infobox("Deprecation note", "⚠️")
|
||||||
.o-block
|
| Pipeline components to prevent from being loaded can now be added as
|
||||||
| Pipeline components to prevent from being loaded can now be added as
|
| a list to #[code disable], instead of specifying one keyword argument
|
||||||
| a list to #[code disable], instead of specifying one keyword argument
|
| per component.
|
||||||
| per component.
|
|
||||||
|
|
||||||
+code-new nlp = English().from_bytes(bytes, disable=['tagger', 'ner'])
|
+code-wrapper
|
||||||
+code-old nlp = English().from_bytes('en', tagger=False, entity=False)
|
+code-new nlp = English().from_bytes(bytes, disable=['tagger', 'ner'])
|
||||||
|
+code-old nlp = English().from_bytes('en', tagger=False, entity=False)
|
||||||
|
|
||||||
+h(2, "attributes") Attributes
|
+h(2, "attributes") Attributes
|
||||||
|
|
||||||
|
|
|
@ -203,18 +203,18 @@ p
|
||||||
| dict describes a token.
|
| dict describes a token.
|
||||||
|
|
||||||
+infobox("Deprecation note", "⚠️")
|
+infobox("Deprecation note", "⚠️")
|
||||||
.o-block
|
| As of spaCy 2.0, #[code Matcher.add_pattern] and #[code Matcher.add_entity]
|
||||||
| As of spaCy 2.0, #[code Matcher.add_pattern] and #[code Matcher.add_entity]
|
| are deprecated and have been replaced with a simpler
|
||||||
| are deprecated and have been replaced with a simpler
|
| #[+api("matcher#add") #[code Matcher.add]] that lets you add a list of
|
||||||
| #[+api("matcher#add") #[code Matcher.add]] that lets you add a list of
|
| patterns and a callback for a given match ID.
|
||||||
| patterns and a callback for a given match ID.
|
|
||||||
|
|
||||||
+code-new.
|
+code-wrapper
|
||||||
matcher.add('GoogleNow', merge_phrases, [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
+code-new.
|
||||||
|
matcher.add('GoogleNow', merge_phrases, [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
||||||
|
|
||||||
+code-old.
|
+code-old.
|
||||||
matcher.add_entity('GoogleNow', on_match=merge_phrases)
|
matcher.add_entity('GoogleNow', on_match=merge_phrases)
|
||||||
matcher.add_pattern('GoogleNow', [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
matcher.add_pattern('GoogleNow', [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
||||||
|
|
||||||
+h(2, "remove") Matcher.remove
|
+h(2, "remove") Matcher.remove
|
||||||
+tag method
|
+tag method
|
||||||
|
|
Loading…
Reference in New Issue
Block a user