Token Classification
Transformers
Safetensors
longformer
Generated from Trainer
Eval Results (legacy)
Instructions to use Theoreticallyhugo/longformer-spans with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Theoreticallyhugo/longformer-spans with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Theoreticallyhugo/longformer-spans")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Theoreticallyhugo/longformer-spans") model = AutoModelForTokenClassification.from_pretrained("Theoreticallyhugo/longformer-spans", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| base_model: allenai/longformer-base-4096 | |
| tags: | |
| - generated_from_trainer | |
| datasets: | |
| - essays_su_g | |
| metrics: | |
| - accuracy | |
| model-index: | |
| - name: longformer-spans | |
| results: | |
| - task: | |
| name: Token Classification | |
| type: token-classification | |
| dataset: | |
| name: essays_su_g | |
| type: essays_su_g | |
| config: spans | |
| split: train[80%:100%] | |
| args: spans | |
| metrics: | |
| - name: Accuracy | |
| type: accuracy | |
| value: 0.9382671349433361 | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| # longformer-spans | |
| This model is a fine-tuned version of [allenai/longformer-base-4096](https://huggingface.co/allenai/longformer-base-4096) on the essays_su_g dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.1775 | |
| - B: {'precision': 0.8277385159010601, 'recall': 0.8983700862895494, 'f1-score': 0.8616091954022989, 'support': 1043.0} | |
| - I: {'precision': 0.9442383361439011, 'recall': 0.9681844380403458, 'f1-score': 0.9560614684120662, 'support': 17350.0} | |
| - O: {'precision': 0.9404392319190525, 'recall': 0.886516366789508, 'f1-score': 0.9126820286782348, 'support': 9226.0} | |
| - Accuracy: 0.9383 | |
| - Macro avg: {'precision': 0.9041386946546712, 'recall': 0.9176902970398011, 'f1-score': 0.9101175641641999, 'support': 27619.0} | |
| - Weighted avg: {'precision': 0.9385697801465175, 'recall': 0.9382671349433361, 'f1-score': 0.9380038837155341, 'support': 27619.0} | |
| ## Model description | |
| More information needed | |
| ## Intended uses & limitations | |
| More information needed | |
| ## Training and evaluation data | |
| More information needed | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 2e-05 | |
| - train_batch_size: 8 | |
| - eval_batch_size: 8 | |
| - seed: 42 | |
| - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 | |
| - lr_scheduler_type: linear | |
| - num_epochs: 6 | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | B | I | O | Accuracy | Macro avg | Weighted avg | | |
| |:-------------:|:-----:|:----:|:---------------:|:-------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------:|:--------:|:-------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------:| | |
| | No log | 1.0 | 41 | 0.2767 | {'precision': 0.8252032520325203, 'recall': 0.38926174496644295, 'f1-score': 0.5289902280130293, 'support': 1043.0} | {'precision': 0.8942471288813271, 'recall': 0.9693948126801153, 'f1-score': 0.9303058797499861, 'support': 17350.0} | {'precision': 0.9191008534679649, 'recall': 0.8287448515066117, 'f1-score': 0.8715873468224564, 'support': 9226.0} | 0.9005 | {'precision': 0.8795170781272708, 'recall': 0.7291338030510567, 'f1-score': 0.7769611515284907, 'support': 27619.0} | {'precision': 0.8999420381641764, 'recall': 0.9005032767297875, 'f1-score': 0.8955359963526497, 'support': 27619.0} | | |
| | No log | 2.0 | 82 | 0.2284 | {'precision': 0.7671568627450981, 'recall': 0.900287631831256, 'f1-score': 0.8284075871195412, 'support': 1043.0} | {'precision': 0.9168915272531031, 'recall': 0.9792507204610951, 'f1-score': 0.947045707915273, 'support': 17350.0} | {'precision': 0.9646535282898919, 'recall': 0.8223498807717321, 'f1-score': 0.8878357030015798, 'support': 9226.0} | 0.9239 | {'precision': 0.8829006394293644, 'recall': 0.900629411021361, 'f1-score': 0.8877629993454645, 'support': 27619.0} | {'precision': 0.9271916455225395, 'recall': 0.9238567652702849, 'f1-score': 0.9227866447586169, 'support': 27619.0} | | |
| | No log | 3.0 | 123 | 0.1770 | {'precision': 0.8351648351648352, 'recall': 0.8744007670182167, 'f1-score': 0.8543325526932084, 'support': 1043.0} | {'precision': 0.9442345644206371, 'recall': 0.9651873198847263, 'f1-score': 0.954595981188542, 'support': 17350.0} | {'precision': 0.9328935395814377, 'recall': 0.8890093214827661, 'f1-score': 0.9104229104229105, 'support': 9226.0} | 0.9363 | {'precision': 0.90409764638897, 'recall': 0.909532469461903, 'f1-score': 0.906450481434887, 'support': 27619.0} | {'precision': 0.9363272534108158, 'recall': 0.9363119591585503, 'f1-score': 0.9360538360419275, 'support': 27619.0} | | |
| | No log | 4.0 | 164 | 0.1804 | {'precision': 0.8234265734265734, 'recall': 0.9031639501438159, 'f1-score': 0.8614540466392319, 'support': 1043.0} | {'precision': 0.9435452033162258, 'recall': 0.9642651296829972, 'f1-score': 0.9537926512927226, 'support': 17350.0} | {'precision': 0.9335544373284538, 'recall': 0.8847821374376761, 'f1-score': 0.9085141903171953, 'support': 9226.0} | 0.9354 | {'precision': 0.9001754046904177, 'recall': 0.917403739088163, 'f1-score': 0.9079202960830499, 'support': 27619.0} | {'precision': 0.9356716909523425, 'recall': 0.9354067851841124, 'f1-score': 0.9351805275513196, 'support': 27619.0} | | |
| | No log | 5.0 | 205 | 0.1774 | {'precision': 0.8283450704225352, 'recall': 0.9022051773729626, 'f1-score': 0.8636989444699403, 'support': 1043.0} | {'precision': 0.9497974784642592, 'recall': 0.9595965417867435, 'f1-score': 0.9546718655924767, 'support': 17350.0} | {'precision': 0.9269600178691088, 'recall': 0.8996314762627358, 'f1-score': 0.9130913091309132, 'support': 9226.0} | 0.9374 | {'precision': 0.9017008555853011, 'recall': 0.9204777318074807, 'f1-score': 0.9104873730644435, 'support': 27619.0} | {'precision': 0.9375822182072485, 'recall': 0.9373981679278758, 'f1-score': 0.9373465833358712, 'support': 27619.0} | | |
| | No log | 6.0 | 246 | 0.1775 | {'precision': 0.8277385159010601, 'recall': 0.8983700862895494, 'f1-score': 0.8616091954022989, 'support': 1043.0} | {'precision': 0.9442383361439011, 'recall': 0.9681844380403458, 'f1-score': 0.9560614684120662, 'support': 17350.0} | {'precision': 0.9404392319190525, 'recall': 0.886516366789508, 'f1-score': 0.9126820286782348, 'support': 9226.0} | 0.9383 | {'precision': 0.9041386946546712, 'recall': 0.9176902970398011, 'f1-score': 0.9101175641641999, 'support': 27619.0} | {'precision': 0.9385697801465175, 'recall': 0.9382671349433361, 'f1-score': 0.9380038837155341, 'support': 27619.0} | | |
| ### Framework versions | |
| - Transformers 4.37.2 | |
| - Pytorch 2.2.0+cu121 | |
| - Datasets 2.17.0 | |
| - Tokenizers 0.15.2 | |