Coreference
Introduction
With the Lettria API, you can identify and resolve references to entities in a given text. For example, identifying when a pronoun refers to a specific noun, determining when two nouns are referring to the same entity, or disambiguating entities that have multiple meanings.
You can use this for:
- Language translation
- Text summarisation
- Information extraction
It can help improve the accuracy and clarity of natural language processing tasks by providing a more complete understanding of the relationships between entities in the text.
Format
Key | Type | Description |
---|---|---|
spans | Span [ ] | Sentences inside the document |
clusters | Cluster [ ] | Cluster |
Example
{ "spans": [ { "sentence_index": 0, "token_indexes": [0], "cluster_index": 0 }, { "sentence_index": 0, "token_indexes": [4], "cluster_index": 0 }, { "sentence_index": 1, "token_indexes": [0], "cluster_index": 0 } ], "clusters": [[0, 4, 3, 1, 5, 7, 2, 6]] }
Spans
Span Format
Key | Type | Description |
---|---|---|
sentence_index | Number | Index of the sentence |
token_indexes | number [] | Indexes of the tokens |
cluster_index | Number | Index of the cluster |
Span Example
{ "sentence_index": 0, "token_indexes": [4], "cluster_index": 0 }
Cluster
Cluster Format
number []
Cluster Example
[0, 1]
Next steps
xxxxxxxxxx
1
114
---
title: "Coreference in Document: Comprehension – Lettria API"
description: The Lettria API can identify and resolve references to entities in a given text, to use for translation, summarisation or information extraction.
---
# Coreference
## Introduction
With the Lettria API, you can identify and resolve references to entities in a given text. For example, identifying when a pronoun refers to a specific noun, determining when two nouns are referring to the same entity, or disambiguating entities that have multiple meanings.
You can use this for:
- Language translation
- Text summarisation
- Information extraction
It can help improve the accuracy and clarity of natural language processing tasks by providing a more complete understanding of the relationships between entities in the text.
## Format
{% table %}
- Key
- Type
- Description {% width="40%" %}
---
- `spans`
- [Span](/api-reference/comprehension/2.0/schemas/document/coreference#spans) [ ]
- Sentences inside the document
---
- `clusters`
- [Cluster](/api-reference/comprehension/2.0/schemas/document/coreference#cluster) [ ]
- Cluster
---
{% /table %}
## Example
```json
{
"spans": [
{ "sentence_index": 0, "token_indexes": [0], "cluster_index": 0 },
{ "sentence_index": 0, "token_indexes": [4], "cluster_index": 0 },
{ "sentence_index": 1, "token_indexes": [0], "cluster_index": 0 }
],
"clusters": [[0, 4, 3, 1, 5, 7, 2, 6]]
}
```
## Spans
### Span Format
{% table %}
- Key
- Type
- Description {% width="40%" %}
---
- `sentence_index`
- `Number`
- Index of the sentence
---
- `token_indexes`
- `number []`
- Indexes of the tokens
---
- `cluster_index`
- `Number`
- Index of the cluster
{% /table %}
### Span Example
```json
{
"sentence_index": 0,
"token_indexes": [4],
"cluster_index": 0
}
```
## Cluster
### Cluster Format
```json
number []
```
### Cluster Example
```json
[0, 1]
```
## Next steps
- [Sentence](/api-reference/comprehension/2.0/schemas/sentence)