| --- |
| library_name: lucid |
| license: mit |
| tags: |
| - token-classification |
| - bert |
| - lucid |
| datasets: |
| - conll2003 |
| pipeline_tag: token-classification |
| model-index: |
| - name: bert-base-token-cls |
| results: |
| - task: { type: token-classification } |
| dataset: { name: conll2003, type: conll2003 } |
| metrics: |
| - { type: f1, value: 91.3 } |
| --- |
| |
| # BERT-Base (CoNLL-2003 NER) |
|
|
| > https://arxiv.org/abs/1810.04805 |
|
|
| [Lucid](https://github.com/ChanLumerico/lucid) port of `transformers/dslim/bert-base-NER`, |
| converted to Lucid-native safetensors. |
|
|
| ## Available weights |
|
|
| | Tag | f1 | Params | GFLOPs | Size | Source | |
| |---|---|---|---|---|---| |
| | `CONLL2003` *(default)* | 91.3 | 108.3M | — | 413.22 MB | transformers | |
|
|
| ## Usage |
|
|
| ```python |
| import lucid |
| import lucid.models as models |
| from lucid.models.weights import BERTBaseNERWeights |
| |
| # default tag |
| model = models.bert_base_token_cls(pretrained=True) |
| |
| # explicit tag (enum or string) |
| model = models.bert_base_token_cls(weights=BERTBaseNERWeights.CONLL2003) |
| model = models.bert_base_token_cls(pretrained="CONLL2003") |
| |
| # feed token ids (tokenize with the matching lucid.utils.tokenizer) |
| input_ids = lucid.tensor([[101, 7592, 2088, 102]], dtype=lucid.int64) |
| out = model(input_ids) |
| logits = out.logits # classification logits |
| ``` |
|
|
| ## Conversion |
|
|
| Converted from `transformers/dslim/bert-base-NER` via |
| `python -m tools.convert_weights bert_base_token_cls --tag CONLL2003`. |
| Key mapping + numerical parity verified against the source. |
|
|
| ## License |
|
|
| `mit` — inherited from the original weights. |
|
|
| ## Citation |
|
|
| ``` |
| Devlin et al., "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding", NAACL 2019. Miniatures: Turc et al., "Well-Read Students Learn Better", 2019. |
| ``` |
|
|