Add causal span model (mDeBERTa-v3 BIO tagger)
Browse files
README.md
CHANGED
|
@@ -7,8 +7,18 @@ tags:
|
|
| 7 |
- cause-effect
|
| 8 |
- span-extraction
|
| 9 |
- causal-news-corpus
|
|
|
|
| 10 |
language:
|
| 11 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# causal-span-pointer-mdeberta
|
|
@@ -59,12 +69,29 @@ print(predict_sentence(model, tokenizer, "Heavy rainfall caused severe flooding.
|
|
| 59 |
`<ARG0>` = cause, `<ARG1>` = effect, `<SIG0>` = signal. The prediction is a list of
|
| 60 |
tagged relation strings (up to two per sentence).
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
## Notes
|
| 63 |
|
| 64 |
-
- Trained on English CNC; not tuned for multilingual span extraction (for robust
|
| 65 |
-
multilingual zero-shot, see the BIO sibling model).
|
| 66 |
- It is NOT compatible with a generic token-classification ONNX consumer -- it
|
| 67 |
needs its own start/end + beam-search decoder (provided by the package).
|
|
|
|
|
|
|
| 68 |
|
| 69 |
## License
|
| 70 |
|
|
|
|
| 7 |
- cause-effect
|
| 8 |
- span-extraction
|
| 9 |
- causal-news-corpus
|
| 10 |
+
- multilingual
|
| 11 |
language:
|
| 12 |
- en
|
| 13 |
+
- es
|
| 14 |
+
- fr
|
| 15 |
+
- de
|
| 16 |
+
- pt
|
| 17 |
+
- tr
|
| 18 |
+
- ru
|
| 19 |
+
- ar
|
| 20 |
+
- zh
|
| 21 |
+
- ja
|
| 22 |
---
|
| 23 |
|
| 24 |
# causal-span-pointer-mdeberta
|
|
|
|
| 69 |
`<ARG0>` = cause, `<ARG1>` = effect, `<SIG0>` = signal. The prediction is a list of
|
| 70 |
tagged relation strings (up to two per sentence).
|
| 71 |
|
| 72 |
+
### Multilingual
|
| 73 |
+
|
| 74 |
+
Trained on English spans, but multilingual at inference (mDeBERTa encoder +
|
| 75 |
+
script-aware segmentation). Use `predict_relations`, which returns character-exact
|
| 76 |
+
spans in any script:
|
| 77 |
+
|
| 78 |
+
```python
|
| 79 |
+
from causal_span_model.pointer.infer import predict_relations
|
| 80 |
+
|
| 81 |
+
predict_relations(model, tokenizer, "暴雨导致该地区发生严重洪灾。")
|
| 82 |
+
# [{'cause': '暴雨', 'effect': '该地区发生严重洪灾', 'signal': '导致'}]
|
| 83 |
+
predict_relations(model, tokenizer, "Las fuertes lluvias provocaron inundaciones.")
|
| 84 |
+
# [{'cause': 'Las fuertes lluvias', 'effect': 'inundaciones', 'signal': 'provocaron'}]
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
Verified on es/fr/de/pt/tr/ru/ar and CJK (zh/ja).
|
| 88 |
+
|
| 89 |
## Notes
|
| 90 |
|
|
|
|
|
|
|
| 91 |
- It is NOT compatible with a generic token-classification ONNX consumer -- it
|
| 92 |
needs its own start/end + beam-search decoder (provided by the package).
|
| 93 |
+
- It is a span EXTRACTOR that assumes the input is causal (no causal/non-causal
|
| 94 |
+
gate), so gate it before feeding arbitrary text.
|
| 95 |
|
| 96 |
## License
|
| 97 |
|