Run this model with HF Jobs
Run tner/bert-base-tweetner7-2020 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/tner/bert-base-tweetner7-2020. 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/tner/bert-base-tweetner7-2020 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 tner/bert-base-tweetner7-2020 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tner/bert-base-tweetner7-2020 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="tner/bert-base-tweetner7-2020")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("tner/bert-base-tweetner7-2020") model = AutoModelForTokenClassification.from_pretrained("tner/bert-base-tweetner7-2020", device_map="auto") - Notebooks
- Google Colab
- Kaggle
model update
Browse filesFiles changed (10)
- README.mdAdded+176
- eval/metric.jsonDeleted-1
- eval/metric.test_2020.jsonAdded+1
- eval/metric.test_2021.jsonAdded+1
- eval/metric_span.test_2020.jsonAdded+1
- eval/metric_span.test_2021.jsonAdded+1
- eval/prediction.2020.dev.jsonDeleted
- eval/prediction.2020.test.jsonDeleted
- eval/prediction.2021.test.jsonDeleted
- trainer_config.json+1-1
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176---datasets:- tner/tweetner7metrics:- f1- precision- recallmodel-index:- name: tner/bert-base-tweetner7-2020 results: - task: name: Token Classification type: token-classification dataset: name: tner/tweetner7/test_2021 type: tner/tweetner7/test_2021 args: tner/tweetner7/test_2021 metrics: - name: F1 type: f1 value: 0.6008989019741707 - name: Precision type: precision value: 0.591443610706686 - name: Recall type: recall value: 0.6106614246068455 - name: F1 (macro) type: f1_macro value: 0.5467450408285621 - name: Precision (macro) type: precision_macro value: 0.537717358363018 - name: Recall (macro) type: recall_macro value: 0.5582367980568581 - name: F1 (entity span) type: f1_entity_span value: 0.7560892328704758 - name: Precision (entity span) type: precision_entity_span value: 0.744313725490196 - name: Recall (entity span) type: recall_entity_span value: 0.7682433213831387 - task: name: Token Classification type: token-classification dataset: name: tner/tweetner7/test_2020 type: tner/tweetner7/test_2020 args: tner/tweetner7/test_2020 metrics: - name: F1 type: f1 value: 0.6087425796006476 - name: Precision type: precision value: 0.6340640809443507 - name: Recall type: recall value: 0.5853658536585366 - name: F1 (macro) type: f1_macro value: 0.5648877924450979 - name: Precision (macro) type: precision_macro value: 0.5930039411771633 - name: Recall (macro) type: recall_macro value: 0.5426595099078766 - name: F1 (entity span) type: f1_entity_span value: 0.7242309767943875 - name: Precision (entity span) type: precision_entity_span value: 0.7543563799887577 - name: Recall (entity span) type: recall_entity_span value: 0.6964193046185781
pipeline_tag: token-classificationwidget:- text: "Get the all-analog Classic Vinyl Edition of `Takin' Off` Album from {{@Herbie Hancock@}} via {{USERNAME}} link below: {{URL}}" example_title: "NER Example 1"---# tner/bert-base-tweetner7-2020
This model is a fine-tuned version of [bert-base-cased](https://huggingface.co/bert-base-cased) on the [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2020` split).Model fine-tuning is done via [T-NER](https://github.com/asahi417/tner)'s hyper-parameter search (see the repositoryfor more detail). It achieves the following results on the test set of 2021:- F1 (micro): 0.6008989019741707- Precision (micro): 0.591443610706686- Recall (micro): 0.6106614246068455- F1 (macro): 0.5467450408285621- Precision (macro): 0.537717358363018- Recall (macro): 0.5582367980568581
The per-entity breakdown of the F1 score on the test set are below:- corporation: 0.4411294619072989- creative_work: 0.3751552795031057- event: 0.40279069767441866- group: 0.5576791808873721- location: 0.6179921773142112- person: 0.8051622154507977- product: 0.6273062730627307
For F1 scores, the confidence interval is obtained by bootstrap as below:- F1 (micro): - 90%: [0.5924664556782363, 0.6106294776916564] - 95%: [0.5905572257793882, 0.6119935888266077] - F1 (macro): - 90%: [0.5924664556782363, 0.6106294776916564] - 95%: [0.5905572257793882, 0.6119935888266077]
Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bert-base-tweetner7-2020/raw/main/eval/metric.json) and [metric file of entity span](https://huggingface.co/tner/bert-base-tweetner7-2020/raw/main/eval/metric_span.json).
### UsageThis model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip ```shellpip install tner```and activate model as below.```pythonfrom tner import TransformersNERmodel = TransformersNER("tner/bert-base-tweetner7-2020")model.predict(["Jacob Collier is a Grammy awarded English artist from London"])```It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
### Training hyperparameters
The following hyperparameters were used during training: - dataset: ['tner/tweetner7'] - dataset_split: train_2020 - dataset_name: None - local_dataset: None - model: bert-base-cased - crf: True - max_length: 128 - epoch: 30 - batch_size: 32 - lr: 1e-05 - random_seed: 0 - gradient_accumulation_steps: 1 - weight_decay: 1e-07 - lr_warmup_step_ratio: 0.15 - max_grad_norm: 1
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/bert-base-tweetner7-2020/raw/main/trainer_config.json).
### ReferenceIf you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
```
@inproceedings{ushio-camacho-collados-2021-ner, title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition", author = "Ushio, Asahi and Camacho-Collados, Jose", booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations", month = apr, year = "2021", address = "Online", publisher = "Association for Computational Linguistics", url = "https://aclanthology.org/2021.eacl-demos.7", doi = "10.18653/v1/2021.eacl-demos.7", pages = "53--62", abstract = "Language model (LM) pretraining has led to consistent improvements in many NLP downstream tasks, including named entity recognition (NER). In this paper, we present T-NER (Transformer-based Named Entity Recognition), a Python library for NER LM finetuning. In addition to its practical utility, T-NER facilitates the study and investigation of the cross-domain and cross-lingual generalization ability of LMs finetuned on NER. Our library also provides a web app where users can get model predictions interactively for arbitrary text, which facilitates qualitative model evaluation for non-expert programmers. We show the potential of the library by compiling nine public NER datasets into a unified format and evaluating the cross-domain and cross- lingual performance across the datasets. The results from our initial experiments show that in-domain performance is generally competitive across datasets. However, cross-domain generalization is challenging even with a large pretrained LM, which has nevertheless capacity to learn domain-specific features if fine- tuned on a combined dataset. To facilitate future research, we also release all our LM checkpoints via the Hugging Face model hub.",}
```1{"2020.dev": {"micro/f1": 0.6070060207991242, "micro/f1_ci": {}, "micro/recall": 0.5794148380355277, "micro/precision": 0.6373563218390804, "macro/f1": 0.5467850521523531, "macro/f1_ci": {}, "macro/recall": 0.5207678704660276, "macro/precision": 0.5797488300321645, "per_entity_metric": {"corporation": {"f1": 0.448, "f1_ci": {}, "precision": 0.4883720930232558, "recall": 0.41379310344827586}, "creative_work": {"f1": 0.4136125654450261, "f1_ci": {}, "precision": 0.4540229885057471, "recall": 0.3798076923076923}, "event": {"f1": 0.3472803347280335, "f1_ci": {}, "precision": 0.3738738738738739, "recall": 0.32421875}, "group": {"f1": 0.5349397590361447, "f1_ci": {}, "precision": 0.5904255319148937, "recall": 0.4889867841409692}, "location": {"f1": 0.6047745358090184, "f1_ci": {}, "precision": 0.5816326530612245, "recall": 0.6298342541436464}, "person": {"f1": 0.8340283569641368, "f1_ci": {}, "precision": 0.831946755407654, "recall": 0.8361204013377926}, "product": {"f1": 0.644859813084112, "f1_ci": {}, "precision": 0.7379679144385026, "recall": 0.5726141078838174}}}, "2021.test": {"micro/f1": 0.6008989019741707, "micro/f1_ci": {"90": [0.5924664556782363, 0.6106294776916564], "95": [0.5905572257793882, 0.6119935888266077]}, "micro/recall": 0.6106614246068455, "micro/precision": 0.591443610706686, "macro/f1": 0.5467450408285621, "macro/f1_ci": {"90": [0.537317329281437, 0.5560337192806812], "95": [0.5354694155361338, 0.5580169049677575]}, "macro/recall": 0.5582367980568581, "macro/precision": 0.537717358363018, "per_entity_metric": {"corporation": {"f1": 0.4411294619072989, "f1_ci": {"90": [0.4151031001476261, 0.4668282751041523], "95": [0.4105067256738155, 0.47152140567132833]}, "precision": 0.42374616171954965, "recall": 0.46}, "creative_work": {"f1": 0.3751552795031057, "f1_ci": {"90": [0.3457281280218126, 0.405156902550491], "95": [0.34063869755792114, 0.41240861376957344]}, "precision": 0.3435722411831627, "recall": 0.4131326949384405}, "event": {"f1": 0.40279069767441866, "f1_ci": {"90": [0.3787119736963134, 0.4261736127060404], "95": [0.3742672669780581, 0.43103672973184526]}, "precision": 0.41198858230256896, "recall": 0.3939945404913558}, "group": {"f1": 0.5576791808873721, "f1_ci": {"90": [0.5357206877355878, 0.5791400107976302], "95": [0.5319548928759554, 0.5857991484361441]}, "precision": 0.5786118980169972, "recall": 0.5382081686429513}, "location": {"f1": 0.6179921773142112, "f1_ci": {"90": [0.5907379257184063, 0.6452965887051165], "95": [0.5849555120039597, 0.6503756726024427]}, "precision": 0.5794621026894865, "recall": 0.6620111731843575}, "person": {"f1": 0.8051622154507977, "f1_ci": {"90": [0.7940780338055736, 0.8169159097793982], "95": [0.7911344383076124, 0.8199079325067802]}, "precision": 0.7833972793861179, "recall": 0.8281710914454278}, "product": {"f1": 0.6273062730627307, "f1_ci": {"90": [0.6036743989614689, 0.6494340793310508], "95": [0.600650185458071, 0.6527402503143698]}, "precision": 0.6432432432432432, "recall": 0.6121399176954733}}}, "2020.test": {"micro/f1": 0.6087425796006476, "micro/f1_ci": {"90": [0.5869140222403038, 0.6303137007490964], "95": [0.583969030579955, 0.6335264711755912]}, "micro/recall": 0.5853658536585366, "micro/precision": 0.6340640809443507, "macro/f1": 0.5648877924450979, "macro/f1_ci": {"90": [0.541183700525316, 0.585728250601802], "95": [0.5380102168624624, 0.591001416229615]}, "macro/recall": 0.5426595099078766, "macro/precision": 0.5930039411771633, "per_entity_metric": {"corporation": {"f1": 0.5076923076923078, "f1_ci": {"90": [0.4456521739130435, 0.5648113256921546], "95": [0.4376895486195893, 0.5757609577922077]}, "precision": 0.49748743718592964, "recall": 0.518324607329843}, "creative_work": {"f1": 0.4406779661016949, "f1_ci": {"90": [0.3846046710949218, 0.5], "95": [0.3716590434523217, 0.5099408614379356]}, "precision": 0.44571428571428573, "recall": 0.43575418994413406}, "event": {"f1": 0.3834586466165414, "f1_ci": {"90": [0.3339654883922945, 0.4358004007303413], "95": [0.32399628008752734, 0.446370839473633]}, "precision": 0.38202247191011235, "recall": 0.3849056603773585}, "group": {"f1": 0.5318352059925093, "f1_ci": {"90": [0.47824719715613895, 0.5828882751694703], "95": [0.4639112831305961, 0.5931040718338841]}, "precision": 0.6367713004484304, "recall": 0.4565916398713826}, "location": {"f1": 0.6329113924050632, "f1_ci": {"90": [0.5619170872324033, 0.6942846790495442], "95": [0.5498484235005866, 0.7070288046928012]}, "precision": 0.6622516556291391, "recall": 0.6060606060606061}, "person": {"f1": 0.810580204778157, "f1_ci": {"90": [0.7831524826802577, 0.8346320308628404], "95": [0.7777679623085985, 0.8402630660959797]}, "precision": 0.8246527777777778, "recall": 0.7969798657718121}, "product": {"f1": 0.6470588235294118, "f1_ci": {"90": [0.591608369865995, 0.6975540206577531], "95": [0.5796820837872635, 0.711355295878703]}, "precision": 0.7021276595744681, "recall": 0.6}}}, "2021.test (span detection)": {"micro/f1": 0.7560892328704758, "micro/f1_ci": {}, "micro/recall": 0.7682433213831387, "micro/precision": 0.744313725490196, "macro/f1": 0.7560892328704758, "macro/f1_ci": {}, "macro/recall": 0.7682433213831387, "macro/precision": 0.744313725490196}, "2020.test (span detection)": {"micro/f1": 0.7242309767943875, "micro/f1_ci": {}, "micro/recall": 0.6964193046185781, "micro/precision": 0.7543563799887577, "macro/f1": 0.7242309767943875, "macro/f1_ci": {}, "macro/recall": 0.6964193046185781, "macro/precision": 0.7543563799887577}}1{"micro/f1": 0.6087425796006476, "micro/f1_ci": {"90": [0.5869140222403038, 0.6303137007490964], "95": [0.583969030579955, 0.6335264711755912]}, "micro/recall": 0.5853658536585366, "micro/precision": 0.6340640809443507, "macro/f1": 0.5648877924450979, "macro/f1_ci": {"90": [0.541183700525316, 0.585728250601802], "95": [0.5380102168624624, 0.591001416229615]}, "macro/recall": 0.5426595099078766, "macro/precision": 0.5930039411771633, "per_entity_metric": {"corporation": {"f1": 0.5076923076923078, "f1_ci": {"90": [0.4456521739130435, 0.5648113256921546], "95": [0.4376895486195893, 0.5757609577922077]}, "precision": 0.49748743718592964, "recall": 0.518324607329843}, "creative_work": {"f1": 0.4406779661016949, "f1_ci": {"90": [0.3846046710949218, 0.5], "95": [0.3716590434523217, 0.5099408614379356]}, "precision": 0.44571428571428573, "recall": 0.43575418994413406}, "event": {"f1": 0.3834586466165414, "f1_ci": {"90": [0.3339654883922945, 0.4358004007303413], "95": [0.32399628008752734, 0.446370839473633]}, "precision": 0.38202247191011235, "recall": 0.3849056603773585}, "group": {"f1": 0.5318352059925093, "f1_ci": {"90": [0.47824719715613895, 0.5828882751694703], "95": [0.4639112831305961, 0.5931040718338841]}, "precision": 0.6367713004484304, "recall": 0.4565916398713826}, "location": {"f1": 0.6329113924050632, "f1_ci": {"90": [0.5619170872324033, 0.6942846790495442], "95": [0.5498484235005866, 0.7070288046928012]}, "precision": 0.6622516556291391, "recall": 0.6060606060606061}, "person": {"f1": 0.810580204778157, "f1_ci": {"90": [0.7831524826802577, 0.8346320308628404], "95": [0.7777679623085985, 0.8402630660959797]}, "precision": 0.8246527777777778, "recall": 0.7969798657718121}, "product": {"f1": 0.6470588235294118, "f1_ci": {"90": [0.591608369865995, 0.6975540206577531], "95": [0.5796820837872635, 0.711355295878703]}, "precision": 0.7021276595744681, "recall": 0.6}}}1{"micro/f1": 0.6008989019741707, "micro/f1_ci": {"90": [0.5924664556782363, 0.6106294776916564], "95": [0.5905572257793882, 0.6119935888266077]}, "micro/recall": 0.6106614246068455, "micro/precision": 0.591443610706686, "macro/f1": 0.5467450408285621, "macro/f1_ci": {"90": [0.537317329281437, 0.5560337192806812], "95": [0.5354694155361338, 0.5580169049677575]}, "macro/recall": 0.5582367980568581, "macro/precision": 0.537717358363018, "per_entity_metric": {"corporation": {"f1": 0.4411294619072989, "f1_ci": {"90": [0.4151031001476261, 0.4668282751041523], "95": [0.4105067256738155, 0.47152140567132833]}, "precision": 0.42374616171954965, "recall": 0.46}, "creative_work": {"f1": 0.3751552795031057, "f1_ci": {"90": [0.3457281280218126, 0.405156902550491], "95": [0.34063869755792114, 0.41240861376957344]}, "precision": 0.3435722411831627, "recall": 0.4131326949384405}, "event": {"f1": 0.40279069767441866, "f1_ci": {"90": [0.3787119736963134, 0.4261736127060404], "95": [0.3742672669780581, 0.43103672973184526]}, "precision": 0.41198858230256896, "recall": 0.3939945404913558}, "group": {"f1": 0.5576791808873721, "f1_ci": {"90": [0.5357206877355878, 0.5791400107976302], "95": [0.5319548928759554, 0.5857991484361441]}, "precision": 0.5786118980169972, "recall": 0.5382081686429513}, "location": {"f1": 0.6179921773142112, "f1_ci": {"90": [0.5907379257184063, 0.6452965887051165], "95": [0.5849555120039597, 0.6503756726024427]}, "precision": 0.5794621026894865, "recall": 0.6620111731843575}, "person": {"f1": 0.8051622154507977, "f1_ci": {"90": [0.7940780338055736, 0.8169159097793982], "95": [0.7911344383076124, 0.8199079325067802]}, "precision": 0.7833972793861179, "recall": 0.8281710914454278}, "product": {"f1": 0.6273062730627307, "f1_ci": {"90": [0.6036743989614689, 0.6494340793310508], "95": [0.600650185458071, 0.6527402503143698]}, "precision": 0.6432432432432432, "recall": 0.6121399176954733}}}1{"micro/f1": 0.7242309767943875, "micro/f1_ci": {}, "micro/recall": 0.6964193046185781, "micro/precision": 0.7543563799887577, "macro/f1": 0.7242309767943875, "macro/f1_ci": {}, "macro/recall": 0.6964193046185781, "macro/precision": 0.7543563799887577}1{"micro/f1": 0.7560892328704758, "micro/f1_ci": {}, "micro/recall": 0.7682433213831387, "micro/precision": 0.744313725490196, "macro/f1": 0.7560892328704758, "macro/f1_ci": {}, "macro/recall": 0.7682433213831387, "macro/precision": 0.744313725490196}1{"data_split": "2020.train", "model": "bert-base-cased", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-05, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}1{"dataset": ["tner/tweetner7"], "dataset_split": "train_2020", "dataset_name": null, "local_dataset": null, "model": "bert-base-cased", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-05, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}
README.mdAdded+176
eval/metric.jsonDeleted-1
eval/metric.test_2020.jsonAdded+1
eval/metric.test_2021.jsonAdded+1
eval/metric_span.test_2020.jsonAdded+1
eval/metric_span.test_2021.jsonAdded+1
eval/prediction.2020.dev.jsonDeleted
eval/prediction.2020.test.jsonDeleted
eval/prediction.2021.test.jsonDeleted
trainer_config.json+1-1