mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-14 18:22:27 +03:00
Update spacy.util documentation
This commit is contained in:
parent
0c6c65aa3c
commit
3871157d84
|
@ -144,7 +144,8 @@ def parse_package_meta(package_path, require=True):
|
||||||
|
|
||||||
|
|
||||||
def is_in_jupyter():
|
def is_in_jupyter():
|
||||||
"""Check if user is in a Jupyter notebook. Mainly used for displaCy.
|
"""Check if user is running spaCy from a Jupyter notebook by detecting the
|
||||||
|
IPython kernel. Mainly used for the displaCy visualizer.
|
||||||
|
|
||||||
RETURNS (bool): True if in Jupyter, False if not.
|
RETURNS (bool): True if in Jupyter, False if not.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -167,6 +167,26 @@ p
|
||||||
+cell dict / #[code None]
|
+cell dict / #[code None]
|
||||||
+cell Model meta data or #[code None].
|
+cell Model meta data or #[code None].
|
||||||
|
|
||||||
|
+h(2, "is_in_jupyter") util.is_in_jupyter
|
||||||
|
+tag function
|
||||||
|
|
||||||
|
p
|
||||||
|
| Check if user is running spaCy from a #[+a("https://jupyter.org") Jupyter]
|
||||||
|
| notebook by detecting the IPython kernel. Mainly used for the
|
||||||
|
| #[+api("displacy") #[code displacy]] visualizer.
|
||||||
|
|
||||||
|
+aside-code("Example").
|
||||||
|
html = '<h1>Hello world!</h1>'
|
||||||
|
if util.is_in_jupyter():
|
||||||
|
from IPython.core.display import display, HTML
|
||||||
|
return display(HTML(html))
|
||||||
|
|
||||||
|
+table(["Name", "Type", "Description"])
|
||||||
|
+footrow
|
||||||
|
+cell returns
|
||||||
|
+cell bool
|
||||||
|
+cell #[code True] if in Jupyter, #[code False] if not.
|
||||||
|
|
||||||
+h(2, "update_exc") util.update_exc
|
+h(2, "update_exc") util.update_exc
|
||||||
+tag function
|
+tag function
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user