mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
Fix documentation for the docs_to_json function (#4456)
This commit is contained in:
parent
275c9ad872
commit
4a77d03ff7
|
@ -743,7 +743,8 @@ def docs_to_json(docs, id=0):
|
||||||
|
|
||||||
docs (iterable / Doc): The Doc object(s) to convert.
|
docs (iterable / Doc): The Doc object(s) to convert.
|
||||||
id (int): Id for the JSON.
|
id (int): Id for the JSON.
|
||||||
RETURNS (list): The data in spaCy's JSON format.
|
RETURNS (dict): The data in spaCy's JSON format
|
||||||
|
- each input doc will be treated as a paragraph in the output doc
|
||||||
"""
|
"""
|
||||||
if isinstance(docs, Doc):
|
if isinstance(docs, Doc):
|
||||||
docs = [docs]
|
docs = [docs]
|
||||||
|
|
|
@ -62,7 +62,7 @@ Whether the provided syntactic annotations form a projective dependency tree.
|
||||||
|
|
||||||
Convert a list of Doc objects into the
|
Convert a list of Doc objects into the
|
||||||
[JSON-serializable format](/api/annotation#json-input) used by the
|
[JSON-serializable format](/api/annotation#json-input) used by the
|
||||||
[`spacy train`](/api/cli#train) command.
|
[`spacy train`](/api/cli#train) command. Each input doc will be treated as a 'paragraph' in the output doc.
|
||||||
|
|
||||||
> #### Example
|
> #### Example
|
||||||
>
|
>
|
||||||
|
@ -77,7 +77,7 @@ Convert a list of Doc objects into the
|
||||||
| ----------- | ---------------- | ------------------------------------------ |
|
| ----------- | ---------------- | ------------------------------------------ |
|
||||||
| `docs` | iterable / `Doc` | The `Doc` object(s) to convert. |
|
| `docs` | iterable / `Doc` | The `Doc` object(s) to convert. |
|
||||||
| `id` | int | ID to assign to the JSON. Defaults to `0`. |
|
| `id` | int | ID to assign to the JSON. Defaults to `0`. |
|
||||||
| **RETURNS** | list | The data in spaCy's JSON format. |
|
| **RETURNS** | dict | The data in spaCy's JSON format. |
|
||||||
|
|
||||||
### gold.align {#align tag="function"}
|
### gold.align {#align tag="function"}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user