Update README.md
Browse files
README.md
CHANGED
|
@@ -8,7 +8,6 @@ widget:
|
|
| 8 |
- text: "Un homme, qui parle à son collègue, <s'> avance vers moi."
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
| 12 |
# Easter-Island/coref_classifier_ancor
|
| 13 |
|
| 14 |
## Table of Contents
|
|
@@ -33,9 +32,108 @@ This model is a state-of-the-art language model for French coreference resolutio
|
|
| 33 |
|
| 34 |
## Uses
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
## Risks, Limitations and Biases
|
|
|
|
| 8 |
- text: "Un homme, qui parle à son collègue, <s'> avance vers moi."
|
| 9 |
---
|
| 10 |
|
|
|
|
| 11 |
# Easter-Island/coref_classifier_ancor
|
| 12 |
|
| 13 |
## Table of Contents
|
|
|
|
| 32 |
|
| 33 |
## Uses
|
| 34 |
|
| 35 |
+
This model can be used for Coreference token classification tasks.
|
| 36 |
+
The model evaluates, for each token, if it is a reference of the expression between "<>".
|
| 37 |
+
|
| 38 |
+
### Example
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from transformers import pipeline
|
| 42 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 43 |
+
|
| 44 |
+
text = "Un homme me parle. <Il> est beau."
|
| 45 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 46 |
+
# results
|
| 47 |
+
['▁Un', '▁homme']
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
This coreference resolver can perform many tasks
|
| 51 |
+
|
| 52 |
+
### Reprise pronominale
|
| 53 |
+
```python
|
| 54 |
+
from transformers import AutoModelForTokenClassification, AutoTokenizer
|
| 55 |
+
|
| 56 |
+
model = AutoModelForTokenClassification.from_pretrained("models/merged/ancor_classifier")
|
| 57 |
+
tokenizer = AutoTokenizer.from_pretrained("models/merged/ancor_classifier_tokenizer")
|
| 58 |
+
from transformers import pipeline
|
| 59 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 60 |
|
| 61 |
+
text = "Platon est un philosophe antique de la Grèce classique... Il reprit le travail philosophique decertains de <ses> prédécesseurs"
|
| 62 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 63 |
+
# results
|
| 64 |
+
['▁Platon']
|
| 65 |
+
|
| 66 |
+
text = "Platon est un philosophe antique de la Grèce classique... <Il> reprit le travail philosophique decertains de ses prédécesseurs"
|
| 67 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 68 |
+
# results
|
| 69 |
+
['▁Platon', '▁un', '▁philosophe', '▁antique', '▁de','▁la', '▁Grèce', '▁classique', '▁ses']
|
| 70 |
+
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
### Anaphores fidèles
|
| 74 |
+
```python
|
| 75 |
+
from transformers import pipeline
|
| 76 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 77 |
+
|
| 78 |
+
text = "Le chat que j’ai adopté court partout... Mais j’aime beaucoup <ce chat> ."
|
| 79 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 80 |
+
# results
|
| 81 |
+
['▁Le', '▁chat']
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
### Anaphores infidèles
|
| 85 |
+
```python
|
| 86 |
+
from transformers import pipeline
|
| 87 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 88 |
+
|
| 89 |
+
text = "Le chat que j’ai adopté court partout... Mais j’aime beaucoup <cet animal> ."
|
| 90 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 91 |
+
# results
|
| 92 |
+
['▁Le', '▁chat']
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Paroles rapportées
|
| 96 |
+
```python
|
| 97 |
+
from transformers import pipeline
|
| 98 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 99 |
+
|
| 100 |
+
text = """Lionel Jospin se livre en revanche à une longue analyse de son échec du 21 avril. “Ma part de responsabilité dans l’échec existe forcément. <Je> l’ai assumée en quittant la vie politique”"""
|
| 101 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 102 |
+
# results
|
| 103 |
+
['▁Lionel', '▁Jos', 'pin', '▁son', 'Ma']
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
### Entités nommées
|
| 107 |
+
```python
|
| 108 |
+
from transformers import pipeline
|
| 109 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 110 |
+
|
| 111 |
+
text = "Paris est située sur la Seine. <La plus grande ville de France> compte plus de 10 millions d’habitants."
|
| 112 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 113 |
+
# results
|
| 114 |
+
['▁Paris']
|
| 115 |
+
```
|
| 116 |
+
### Les groupes
|
| 117 |
+
```python
|
| 118 |
+
from transformers import pipeline
|
| 119 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 120 |
+
|
| 121 |
+
text = "Jack et Rose commencent à faire connaissance. Ils s’entendent bien. <Le couple> se marie et a des enfants."
|
| 122 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 123 |
+
# results
|
| 124 |
+
['▁Jack', '▁et', '▁Rose', '▁Ils']
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
### Groupes dispersés
|
| 128 |
+
```python
|
| 129 |
+
from transformers import pipeline
|
| 130 |
+
classifier = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 131 |
+
|
| 132 |
+
text = "Jack et Rose commencent à faire connaissance. Ils s’entendent bien. <Le couple> se marie et a des enfants."
|
| 133 |
+
[elem['word'] for elem in classifier(text) if elem['entity'] == 'LABEL_1']
|
| 134 |
+
# results
|
| 135 |
+
['▁Jack', '▁et', '▁Rose', '▁Ils']
|
| 136 |
+
```
|
| 137 |
|
| 138 |
|
| 139 |
## Risks, Limitations and Biases
|