Run this model with HF Jobs
Run compnet-renard/bert-base-cased-literary-coref on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/compnet-renard/bert-base-cased-literary-coref. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/compnet-renard/bert-base-cased-literary-coref on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use compnet-renard/bert-base-cased-literary-coref with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use compnet-renard/bert-base-cased-literary-coref with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, BertForCoreferenceResolution tokenizer = AutoTokenizer.from_pretrained("compnet-renard/bert-base-cased-literary-coref") model = BertForCoreferenceResolution.from_pretrained("compnet-renard/bert-base-cased-literary-coref", device_map="auto") - Notebooks
- Google Colab
- Kaggle
compnet-renard/bert-base-cased-literary-coref
This model should be used with Tibert, a BERT-based end-to-end coreference solver.
Example code:
from tibert import BertForCoreferenceResolution, predict_coref_simple
from tibert.utils import pprint_coreference_document
from transformers import BertTokenizerFast
model = BertForCoreferenceResolution.from_pretrained(
"compnet-renard/bert-base-cased-literary-coref"
)
tokenizer = BertTokenizerFast.from_pretrained("bert-base-cased")
coref_out = predict_coref_simple(
"Sli did not want the earpods. He didn't like them.", model, tokenizer
)
pprint_coreference_document(coref_out)
>>> (0 Sli ) did not want the earpods. (0 He ) didn't like them.
Performance
The following table presents the results we obtained on Litbank by training this model. We evaluate on 10% of Litbank documents, each of which consists of ~2000 tokens. The split column indicate whether documents were split in blocks of 512 tokens. The HM coumns indicates whether we use hierarchical merging. Time is measured on cpu inference.
compnet-renard/bert-base-cased-literary-coref
| Dataset | Base model | split | HM | MUC | B3 | CEAF | BLANC | LEA | time (m:s) |
|---|---|---|---|---|---|---|---|---|---|
| Litbank | bert-base-cased |
no | no | 75.03 | 60.66 | 48.71 | 62.96 | 32.84 | 01:40 |
| Litbank | bert-base-cased |
yes | no | 73.84 | 49.14 | 47.88 | 48.41 | 27.63 | 00:57 |
| Litbank | bert-base-cased |
yes | yes | 74.54 | 59.30 | 46.98 | 62.69 | 42.46 | 01:36 |
- Downloads last month
- 83