Fix documentation for the docs_to_json function (#4456)

This commit is contained in:
Anastassia 2019-10-16 17:17:58 -04:00 committed by Matthew Honnibal
parent 275c9ad872
commit 4a77d03ff7
2 changed files with 4 additions and 3 deletions

View File

@ -743,7 +743,8 @@ def docs_to_json(docs, id=0):
docs (iterable / Doc): The Doc object(s) to convert.
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):
docs = [docs]

View File

@ -62,7 +62,7 @@ Whether the provided syntactic annotations form a projective dependency tree.
Convert a list of Doc objects into 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
>
@ -77,7 +77,7 @@ Convert a list of Doc objects into the
| ----------- | ---------------- | ------------------------------------------ |
| `docs` | iterable / `Doc` | The `Doc` object(s) to convert. |
| `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"}