mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +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
|
||||
|
||||
+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,
|
||||
| you can use the new function #[+api("spacy#blank") #[code spacy.blank()]]
|
||||
| or import the class explicitly, e.g.
|
||||
| #[code from spacy.lang.en import English].
|
||||
| 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,
|
||||
| you can use the new function #[+api("spacy#blank") #[code spacy.blank()]]
|
||||
| or import the class explicitly, e.g.
|
||||
| #[code from spacy.lang.en import English].
|
||||
|
||||
+code-new nlp = spacy.load('/model')
|
||||
+code-old nlp = spacy.load('en', path='/model')
|
||||
+code-wrapper
|
||||
+code-new nlp = spacy.load('/model')
|
||||
+code-old nlp = spacy.load('en', path='/model')
|
||||
|
||||
+h(3, "spacy.blank") spacy.blank
|
||||
+tag function
|
||||
|
|
|
@ -84,13 +84,13 @@ 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.
|
||||
| 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-new doc = nlp(u"I don't want parsed", disable=['parser'])
|
||||
+code-old doc = nlp(u"I don't want parsed", parse=False)
|
||||
+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)
|
||||
|
||||
+h(2, "pipe") Language.pipe
|
||||
+tag method
|
||||
|
@ -533,15 +533,15 @@ 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.
|
||||
| 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-new nlp = English().from_disk(disable=['tagger', 'ner'])
|
||||
+code-old nlp = spacy.load('en', tagger=False, entity=False)
|
||||
+code-wrapper
|
||||
+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
|
||||
+tag method
|
||||
|
@ -595,13 +595,13 @@ 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.
|
||||
| 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-new nlp = English().from_bytes(bytes, disable=['tagger', 'ner'])
|
||||
+code-old nlp = English().from_bytes('en', tagger=False, entity=False)
|
||||
+code-wrapper
|
||||
+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
|
||||
|
||||
|
|
|
@ -203,18 +203,18 @@ 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.
|
||||
| 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-new.
|
||||
matcher.add('GoogleNow', merge_phrases, [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
||||
+code-wrapper
|
||||
+code-new.
|
||||
matcher.add('GoogleNow', merge_phrases, [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
||||
|
||||
+code-old.
|
||||
matcher.add_entity('GoogleNow', on_match=merge_phrases)
|
||||
matcher.add_pattern('GoogleNow', [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
||||
+code-old.
|
||||
matcher.add_entity('GoogleNow', on_match=merge_phrases)
|
||||
matcher.add_pattern('GoogleNow', [{ORTH: 'Google'}, {ORTH: 'Now'}])
|
||||
|
||||
+h(2, "remove") Matcher.remove
|
||||
+tag method
|
||||
|
|
Loading…
Reference in New Issue
Block a user