Run this model with HF Jobs
Run tner/roberta-large-mit-restaurant 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/roberta-large-mit-restaurant. 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/roberta-large-mit-restaurant 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/roberta-large-mit-restaurant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tner/roberta-large-mit-restaurant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="tner/roberta-large-mit-restaurant")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("tner/roberta-large-mit-restaurant") model = AutoModelForTokenClassification.from_pretrained("tner/roberta-large-mit-restaurant", device_map="auto") - Notebooks
- Google Colab
- Kaggle
model update
Browse filesFiles changed (8)
- README.mdAdded+140
- config.json+1-1
- eval/metric.jsonAdded+1
- eval/metric_span.jsonAdded+1
- eval/prediction.validation.jsonAdded
- pytorch_model.bin+2-2
- tokenizer_config.json+1-1
- trainer_config.jsonAdded+1
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140---datasets:- mit_restaurantmetrics:- f1- precision- recallmodel-index:- name: tner/roberta-large-mit-restaurant results: - task: name: Token Classification type: token-classification dataset: name: mit_restaurant type: mit_restaurant args: mit_restaurant metrics: - name: F1 type: f1 value: 0.8164676304211189 - name: Precision type: precision value: 0.8085901027077498 - name: Recall type: recall value: 0.8245001586797842 - name: F1 (macro) type: f1_macro value: 0.8081522050756316 - name: Precision (macro) type: precision_macro value: 0.7974927131040113 - name: Recall (macro) type: recall_macro value: 0.8199029986502094 - name: F1 (entity span) type: f1_entity_span value: 0.8557510999371464 - name: Precision (entity span) type: precision_entity_span value: 0.8474945533769063 - name: Recall (entity span) type: recall_entity_span value: 0.8641701047286575
pipeline_tag: token-classificationwidget:- text: "Jacob Collier is a Grammy awarded artist from England." example_title: "NER Example 1"---# tner/roberta-large-mit-restaurant
This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) on the [tner/mit_restaurant](https://huggingface.co/datasets/tner/mit_restaurant) dataset.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:- F1 (micro): 0.8164676304211189- Precision (micro): 0.8085901027077498- Recall (micro): 0.8245001586797842- F1 (macro): 0.8081522050756316- Precision (macro): 0.7974927131040113- Recall (macro): 0.8199029986502094
The per-entity breakdown of the F1 score on the test set are below:- amenity: 0.7140221402214022- cuisine: 0.8558052434456929- dish: 0.829103214890017- location: 0.8611793611793611- money: 0.8579710144927537- rating: 0.8- restaurant: 0.8713375796178344- time: 0.6757990867579908
For F1 scores, the confidence interval is obtained by bootstrap as below:- F1 (micro): - 90%: [0.8050039870241192, 0.8289531287254172] - 95%: [0.8030897272187587, 0.8312785732455824] - F1 (macro): - 90%: [0.8050039870241192, 0.8289531287254172] - 95%: [0.8030897272187587, 0.8312785732455824]
Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-mit-restaurant/raw/main/eval/metric.json) and [metric file of entity span](https://huggingface.co/tner/roberta-large-mit-restaurant/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/roberta-large-mit-restaurant")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/mit_restaurant'] - dataset_split: train - dataset_name: None - local_dataset: None - model: roberta-large - crf: True - max_length: 128 - epoch: 15 - batch_size: 64 - lr: 1e-05 - random_seed: 42 - gradient_accumulation_steps: 1 - weight_decay: None - lr_warmup_step_ratio: 0.1 - max_grad_norm: 10.0
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-large-mit-restaurant/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.",}
```12345{"_name_or_path": "tner_ckpt/mit_restaurant_roberta_large/best_model","architectures": ["RobertaForTokenClassification"],12345{"_name_or_path": "tner_ckpt/mit_restaurant_roberta_large/model_rcsnba/epoch_5","architectures": ["RobertaForTokenClassification"],
1{"micro/f1": 0.8164676304211189, "micro/f1_ci": {"90": [0.8050039870241192, 0.8289531287254172], "95": [0.8030897272187587, 0.8312785732455824]}, "micro/recall": 0.8245001586797842, "micro/precision": 0.8085901027077498, "macro/f1": 0.8081522050756316, "macro/f1_ci": {"90": [0.7954595245799596, 0.8219360781988571], "95": [0.792555816856374, 0.825200956567577]}, "macro/recall": 0.8199029986502094, "macro/precision": 0.7974927131040113, "per_entity_metric": {"amenity": {"f1": 0.7140221402214022, "f1_ci": {"90": [0.683327540549487, 0.7436187631209326], "95": [0.678020677628301, 0.7517245237181946]}, "precision": 0.7023593466424682, "recall": 0.726078799249531}, "cuisine": {"f1": 0.8558052434456929, "f1_ci": {"90": [0.833801564945227, 0.8766126228464227], "95": [0.8292487217750814, 0.8803160836742926]}, "precision": 0.8526119402985075, "recall": 0.8590225563909775}, "dish": {"f1": 0.829103214890017, "f1_ci": {"90": [0.7969955469192779, 0.8597312956236187], "95": [0.7924528301886793, 0.8644379746637839]}, "precision": 0.8085808580858086, "recall": 0.8506944444444444}, "location": {"f1": 0.8611793611793611, "f1_ci": {"90": [0.8402656883936412, 0.8813415532273775], "95": [0.8362810514435675, 0.8845460980496779]}, "precision": 0.8590686274509803, "recall": 0.8633004926108374}, "money": {"f1": 0.8579710144927537, "f1_ci": {"90": [0.8159509202453988, 0.8963682024533951], "95": [0.8072020389249304, 0.904497826286624]}, "precision": 0.8505747126436781, "recall": 0.8654970760233918}, "rating": {"f1": 0.8, "f1_ci": {"90": [0.7592525006758584, 0.8345533282112174], "95": [0.7518762102471958, 0.8421052631578947]}, "precision": 0.7589285714285714, "recall": 0.845771144278607}, "restaurant": {"f1": 0.8713375796178344, "f1_ci": {"90": [0.8471992536498038, 0.896299785653756], "95": [0.8420912467587077, 0.9023500668180059]}, "precision": 0.8929503916449086, "recall": 0.8507462686567164}, "time": {"f1": 0.6757990867579908, "f1_ci": {"90": [0.621840639870406, 0.7241566310120426], "95": [0.6140051214994007, 0.7334963325183375]}, "precision": 0.6548672566371682, "recall": 0.6981132075471698}}}1{"micro/f1": 0.8557510999371464, "micro/f1_ci": {"90": [0.8457549886322284, 0.866532074562069], "95": [0.8439094859106241, 0.8689014756604962]}, "micro/recall": 0.8641701047286575, "micro/precision": 0.8474945533769063, "macro/f1": 0.8557510999371464, "macro/f1_ci": {"90": [0.8457549886322284, 0.866532074562069], "95": [0.8439094859106241, 0.8689014756604962]}, "macro/recall": 0.8641701047286575, "macro/precision": 0.8474945533769063}123version https://git-lfs.github.com/spec/v1oid sha256:0d2e091e9d78302ff4904bd9cdfd878b10ac33a35ff737f6cd634790afd7b6c1size 1417441393123version https://git-lfs.github.com/spec/v1oid sha256:58e1e876ca140f5c57210bac516075cd00f5f1a761973316b0dfaef37cf54fd6size 1417446833
5 unmodified lines67891011125 unmodified lines"errors": "replace","mask_token": "<mask>","model_max_length": 512,"name_or_path": "tner_ckpt/mit_restaurant_roberta_large/best_model","pad_token": "<pad>","sep_token": "</s>","special_tokens_map_file": "tner_ckpt/mit_restaurant_roberta_large/model_rcsnba/epoch_5/special_tokens_map.json",5 unmodified lines67891011125 unmodified lines"errors": "replace","mask_token": "<mask>","model_max_length": 512,"name_or_path": "tner_ckpt/mit_restaurant_roberta_large/model_rcsnba/epoch_5","pad_token": "<pad>","sep_token": "</s>","special_tokens_map_file": "tner_ckpt/mit_restaurant_roberta_large/model_rcsnba/epoch_5/special_tokens_map.json",
1{"dataset": ["tner/mit_restaurant"], "dataset_split": "train", "dataset_name": null, "local_dataset": null, "model": "roberta-large", "crf": true, "max_length": 128, "epoch": 15, "batch_size": 64, "lr": 1e-05, "random_seed": 42, "gradient_accumulation_steps": 1, "weight_decay": null, "lr_warmup_step_ratio": 0.1, "max_grad_norm": 10.0}README.mdAdded+140
config.json+1-1
eval/metric.jsonAdded+1
eval/metric_span.jsonAdded+1
eval/prediction.validation.jsonAdded
pytorch_model.bin+2-2
tokenizer_config.json+1-1
trainer_config.jsonAdded+1