This commit is contained in:
Matthew Honnibal 2018-07-21 15:57:18 +02:00
commit 1a16162da9
7 changed files with 117 additions and 7 deletions

View File

@ -25,7 +25,7 @@ p
+table(["Name", "Type", "Description", "Default"])
+row
+cell #[code docs]
+cell list or #[code Doc]
+cell list, #[code Doc], #[code Span]
+cell Document(s) to visualize.
+cell
@ -84,7 +84,7 @@ p Render a dependency parse tree or named entity visualization.
+table(["Name", "Type", "Description", "Default"])
+row
+cell #[code docs]
+cell list or #[code Doc]
+cell list, #[code Doc], #[code Span]
+cell Document(s) to visualize.
+cell
@ -157,6 +157,12 @@ p
| as it prevents long arcs to attach punctuation.
+cell #[code True]
+row
+cell #[code collapse_phrases]
+cell bool
+cell Merge noun phrases into one token.
+cell #[code False]
+row
+cell #[code compact]
+cell bool

View File

@ -136,6 +136,12 @@ p
+cell flag
+cell Print information as Markdown.
+row
+cell #[code --silent], #[code -s]
+tag-new("2.0.12")
+cell flag
+cell Don't print anything, just return the values.
+row
+cell #[code --help], #[code -h]
+cell flag

View File

@ -202,8 +202,8 @@ p
+aside-code("Example").
from spacy.tokens import Doc
Doc.set_extension('is_city', default=False)
extension = Doc.get_extension('is_city')
Doc.set_extension('has_city', default=False)
extension = Doc.get_extension('has_city')
assert extension == (False, None, None, None)
+table(["Name", "Type", "Description"])
@ -227,8 +227,8 @@ p Check whether an extension has been registered on the #[code Doc] class.
+aside-code("Example").
from spacy.tokens import Doc
Doc.set_extension('is_city', default=False)
assert Doc.has_extension('is_city')
Doc.set_extension('has_city', default=False)
assert Doc.has_extension('has_city')
+table(["Name", "Type", "Description"])
+row
@ -241,6 +241,31 @@ p Check whether an extension has been registered on the #[code Doc] class.
+cell bool
+cell Whether the extension has been registered.
+h(2, "remove_extension") Doc.remove_extension
+tag classmethod
+tag-new("2.0.12")
p Remove a previously registered extension.
+aside-code("Example").
from spacy.tokens import Doc
Doc.set_extension('has_city', default=False)
removed = Doc.remove_extension('has_city')
assert not Doc.has_extension('has_city')
+table(["Name", "Type", "Description"])
+row
+cell #[code name]
+cell unicode
+cell Name of the extension.
+row("foot")
+cell returns
+cell tuple
+cell
| A #[code.u-break (default, method, getter, setter)] tuple of the
| removed extension.
+h(2, "char_span") Doc.char_span
+tag method
+tag-new(2)
@ -761,6 +786,13 @@ p
+cell bool
+cell A flag indicating that the document has been syntactically parsed.
+row
+cell #[code is_sentenced]
+cell bool
+cell
| A flag indicating that sentence boundaries have been applied to
| the document.
+row
+cell #[code sentiment]
+cell float

View File

@ -219,6 +219,31 @@ p Check whether an extension has been registered on the #[code Span] class.
+cell bool
+cell Whether the extension has been registered.
+h(2, "remove_extension") Span.remove_extension
+tag classmethod
+tag-new("2.0.12")
p Remove a previously registered extension.
+aside-code("Example").
from spacy.tokens import Span
Span.set_extension('is_city', default=False)
removed = Span.remove_extension('is_city')
assert not Span.has_extension('is_city')
+table(["Name", "Type", "Description"])
+row
+cell #[code name]
+cell unicode
+cell Name of the extension.
+row("foot")
+cell returns
+cell tuple
+cell
| A #[code.u-break (default, method, getter, setter)] tuple of the
| removed extension.
+h(2, "similarity") Span.similarity
+tag method
+tag-model("vectors")

View File

@ -154,6 +154,31 @@ p Check whether an extension has been registered on the #[code Token] class.
+cell bool
+cell Whether the extension has been registered.
+h(2, "remove_extension") Token.remove_extension
+tag classmethod
+tag-new("2.0.11")
p Remove a previously registered extension.
+aside-code("Example").
from spacy.tokens import Token
Token.set_extension('is_fruit', default=False)
removed = Token.remove_extension('is_fruit')
assert not Token.has_extension('is_fruit')
+table(["Name", "Type", "Description"])
+row
+cell #[code name]
+cell unicode
+cell Name of the extension.
+row("foot")
+cell returns
+cell tuple
+cell
| A #[code.u-break (default, method, getter, setter)] tuple of the
| removed extension.
+h(2, "check_flag") Token.check_flag
+tag method
@ -484,6 +509,17 @@ p The L2 norm of the token's vector representation.
+h(2, "attributes") Attributes
+table(["Name", "Type", "Description"])
+row
+cell #[code doc]
+cell #[code Doc]
+cell The parent document.
+row
+cell #[code sent]
+tag-new("2.0.12")
+cell #[code Span]
+cell The sentence span that this token is a part of.
+row
+cell #[code text]
+cell unicode

View File

@ -76,6 +76,7 @@
},
"MODEL_LICENSES": {
"MIT": "https://opensource.org/licenses/MIT",
"CC BY 4.0": "https://creativecommons.org/licenses/by/4.0/",
"CC BY-SA": "https://creativecommons.org/licenses/by-sa/3.0/",
"CC BY-SA 3.0": "https://creativecommons.org/licenses/by-sa/3.0/",
@ -115,8 +116,12 @@
"ro": "Romanian",
"hr": "Croatian",
"tr": "Turkish",
"el": "Greek",
"he": "Hebrew",
"ar": "Arabic",
"fa": "Persian",
"ur": "Urdu",
"tt": "Tatar",
"ga": "Irish",
"bn": "Bengali",
"hi": "Hindi",

View File

@ -44,7 +44,7 @@ p
+list.o-no-block
+item #[strong Chinese]: #[+a("https://github.com/fxsjy/jieba") Jieba]
+item #[strong Japanese]: #[+a("https://github.com/mocobeta/janome") Janome]
+item #[strong Japanese]: #[+a("https://github.com/taku910/mecab") MeCab]
+item #[strong Thai]: #[+a("https://github.com/wannaphongcom/pythainlp") pythainlp]
+item #[strong Vietnamese]: #[+a("https://github.com/trungtv/pyvi") Pyvi]
+item #[strong Russian]: #[+a("https://github.com/kmike/pymorphy2") pymorphy2]