Adjusted descriptions for more consistency

This commit is contained in:
thomashacker 2023-01-31 11:42:37 +01:00
parent dfa9f6da09
commit 5c5fef533f

View File

@ -342,12 +342,11 @@ use with the `manual=True` argument in `displacy.render`.
### Visualizer data structures {id="displacy_structures"} ### Visualizer data structures {id="displacy_structures"}
You can also use displaCy's data format to manually render data. This can be You can use displaCy's data format to manually render data. This can be useful
useful if you want to visualize output from other libaries. You can find if you want to visualize output from other libaries. You can find examples of
examples of displaCy's data format on the displaCy's different data formats below.
[usage page](/usage/visualizers#manual-usage).
> #### DEP data structure > #### DEP example data structure
> >
> ```json > ```json
> { > {
@ -368,33 +367,33 @@ examples of displaCy's data format on the
#### Dependency Visualizer data structure {id="structure-dep"} #### Dependency Visualizer data structure {id="structure-dep"}
| Dictionary Key | Description | | Dictionary Key | Description |
| -------------- | ----------------------------------------- | | -------------- | ----------------------------------------------------------------------------------------------------------- |
| `words` | List of words. ~~List[Dict[str, Any]]~~ | | `words` | List of dictionaries describing a word token (see structure below). ~~List[Dict[str, Any]]~~ |
| `arcs` | List of arcs. ~~List[Dict[str, Any]]~~ | | `arcs` | List of dictionaries describing the relations between words (see structure below). ~~List[Dict[str, Any]]~~ |
| `settings` | Visualization options. ~~Dict[str, Any]~~ | | `settings` | Dependency Visualizer options (see [here](/api/top-level#displacy_options)). ~~Dict[str, Any]~~ |
<Accordion title="Word data structure"> <Accordion title="Words data structure">
| Dictionary Key | Description | | Dictionary Key | Description |
| -------------- | ------------------------------------ | | -------------- | ---------------------------------------- |
| `text` | The string of the word. ~~str~~ | | `text` | Text content of the word. ~~str~~ |
| `tag` | Dependency tag of the word. ~~str~~ | | `tag` | Fine-grained part-of-speech. ~~str~~ |
| `lemma` | Lemma of the word. ~~Optional[str]~~ | | `lemma` | Base form of the word. ~~Optional[str]~~ |
</Accordion> </Accordion>
<Accordion title="Arc data structure"> <Accordion title="Arcs data structure">
| Dictionary Key | Description | | Dictionary Key | Description |
| -------------- | ----------------------------------------------- | | -------------- | ---------------------------------------------------- |
| `start` | Start index. ~~int~~ | | `start` | The index of the starting token. ~~int~~ |
| `end` | End index. ~~int~~ | | `end` | The index of the ending token. ~~int~~ |
| `label` | Label of the arc. ~~str~~ | | `label` | The type of dependency relation. ~~str~~ |
| `dir` | Direction of the arc (`left`, `right`). ~~str~~ | | `dir` | Direction of the relation (`left`, `right`). ~~str~~ |
</Accordion> </Accordion>
> #### ENT data structure > #### ENT example data structure
> >
> ```json > ```json
> { > {
@ -407,25 +406,25 @@ examples of displaCy's data format on the
#### Named Entity Recognition data structure {id="structure-ent"} #### Named Entity Recognition data structure {id="structure-ent"}
| Dictionary Key | Description | | Dictionary Key | Description |
| -------------- | ------------------------------------------ | | -------------- | ------------------------------------------------------------------------------------------- |
| `text` | Text of the document. ~~str~~ | | `text` | String representation of the document text. ~~str~~ |
| `ents` | List of entities. ~~List[Dict[str, Any]]~~ | | `ents` | List of dictionaries describing entities (see structure below). ~~List[Dict[str, Any]]~~ |
| `title` | Title of the visualization. ~~str~~ | | `title` | Title of the visualization. ~~str~~ |
| `settings` | Visualization options. ~~Dict[str, Any]~~ | | `settings` | Entity Visualizer options (see [here](/api/top-level#displacy_options)). ~~Dict[str, Any]~~ |
<Accordion title="Entity data structure"> <Accordion title="Ents data structure">
| Dictionary Key | Description | | Dictionary Key | Description |
| -------------- | ---------------------------- | | -------------- | --------------------------------------------------- |
| `start` | Start index. ~~int~~ | | `start` | The index of the first token of the entity. ~~int~~ |
| `end` | End index. ~~int~~ | | `end` | The index of the last token of the entity. ~~int~~ |
| `label` | Label of the entity. ~~str~~ | | `label` | Label attached to the entity. ~~str~~ |
| `kb_id` | Knowledgebase ID. ~~str~~ | | `kb_id` | `KnowledgeBase` ID. ~~str~~ |
| `kb_url` | Knowledgebase URL. ~~str~~ | | `kb_url` | `KnowledgeBase` URL. ~~str~~ |
</Accordion> </Accordion>
> #### SPAN data structure > #### SPAN example data structure
> >
> ```json > ```json
> { > {
@ -441,24 +440,24 @@ examples of displaCy's data format on the
#### Span Classification data structure {id="structure-span"} #### Span Classification data structure {id="structure-span"}
| Dictionary Key | Description | | Dictionary Key | Description |
| -------------- | ----------------------------------------- | | -------------- | ----------------------------------------------------------------------------------------- |
| `text` | Text of the document. ~~str~~ | | `text` | String representation of the document text. ~~str~~ |
| `spans` | List of spans. ~~List[Dict[str, Any]]~~ | | `spans` | List of dictionaries describing spans (see structure below). ~~List[Dict[str, Any]]~~ |
| `title` | Title of the visualization. ~~str~~ | | `title` | Title of the visualization. ~~str~~ |
| `tokens` | List of tokens. ~~List[str]~~ | | `tokens` | List of word tokens. ~~List[str]~~ |
| `settings` | Visualization options. ~~Dict[str, Any]~~ | | `settings` | Span Visualizer options (see [here](/api/top-level#displacy_options)). ~~Dict[str, Any]~~ |
<Accordion title="Span data structure"> <Accordion title="Spans data structure">
| Dictionary Key | Description | | Dictionary Key | Description |
| -------------- | -------------------------- | | -------------- | ------------------------------------------------------------- |
| `start` | Start index. ~~int~~ | | `start` | The index of the first token of the span. ~~int~~ |
| `end` | End index. ~~int~~ | | `end` | The index of the last token of the span. ~~int~~ |
| `start_token` | Start token. ~~int~~ | | `start_token` | The index of the first token of the span in `tokens`. ~~int~~ |
| `end_token` | End token. ~~int~~ | | `end_token` | The index of the last token of the span in `tokens`. ~~int~~ |
| `label` | Label of the span. ~~str~~ | | `label` | Label attached to the span. ~~str~~ |
| `kb_id` | Knowledgebase ID. ~~str~~ | | `kb_id` | `KnowledgeBase` ID. ~~str~~ |
| `kb_url` | Knowledgebase URL. ~~str~~ | | `kb_url` | `KnowledgeBase` URL. ~~str~~ |
</Accordion> </Accordion>