Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ophelielacroix committed Jul 14, 2021
1 parent cd73f93 commit 271a9fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/docs/tasks/coreference.md
Expand Up @@ -39,17 +39,21 @@ coref_model = load_xlmr_coref_model()
# a document is a list of tokenized sentences
doc = [["Lotte", "arbejder", "med", "Mads", "."], ["Hun", "er", "tandlæge", "."]]

# apply coreference resolution on the document
# apply coreference resolution to the document and get a list of features (see below)
preds = coref_model.predict(doc)

# apply coreference resolution to the document and get a list of clusters
clusters = coref_model.predict_clusters(doc)
```

The `preds` variable is a dictionary including the following entries :
* `top_spans` : list of indices of all references (spans) in the document
* `antecedent_indices` : list of antecedents indices
* `predicted_antecedents` : list of indices of the antecedent span (from `top_spans`), i.e. previous reference
* `document` : list of tokens' indices for the whole document
* `clusters` : list of clusters
* `clusters` : list of clusters (indices of tokens)
The most relevant entry to use is the list of clusters. One cluster contains the indices of references (spans) that refer to the same entity.
To make it easier, we provide the `predict_clusters` function that returns a list of the clusters with the references and their ids in the document.


## 📈 Benchmarks
Expand Down

0 comments on commit 271a9fc

Please sign in to comment.