Instructions to use preneond/newlinefix-encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use preneond/newlinefix-encoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="preneond/newlinefix-encoder")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("preneond/newlinefix-encoder") model = AutoModelForTokenClassification.from_pretrained("preneond/newlinefix-encoder", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload newline-fixer encoder
Browse files- config.json +40 -0
- model.safetensors +3 -0
- predictor_config.json +21 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
- training_log.json +48 -0
config.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"RobertaForTokenClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": 2,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 768,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "JOIN",
|
| 16 |
+
"1": "SPACE",
|
| 17 |
+
"2": "NEWLINE",
|
| 18 |
+
"3": "PARA"
|
| 19 |
+
},
|
| 20 |
+
"initializer_range": 0.02,
|
| 21 |
+
"intermediate_size": 3072,
|
| 22 |
+
"is_decoder": false,
|
| 23 |
+
"label2id": {
|
| 24 |
+
"JOIN": 0,
|
| 25 |
+
"NEWLINE": 2,
|
| 26 |
+
"PARA": 3,
|
| 27 |
+
"SPACE": 1
|
| 28 |
+
},
|
| 29 |
+
"layer_norm_eps": 1e-05,
|
| 30 |
+
"max_position_embeddings": 514,
|
| 31 |
+
"model_type": "roberta",
|
| 32 |
+
"num_attention_heads": 12,
|
| 33 |
+
"num_hidden_layers": 6,
|
| 34 |
+
"pad_token_id": 1,
|
| 35 |
+
"tie_word_embeddings": true,
|
| 36 |
+
"transformers_version": "5.15.0",
|
| 37 |
+
"type_vocab_size": 1,
|
| 38 |
+
"use_cache": true,
|
| 39 |
+
"vocab_size": 50265
|
| 40 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4d743d89c3bf0de3f55efb3028b287577ada8c7aff7c19c47efd7a114209031
|
| 3 |
+
size 326135848
|
predictor_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_words": 180,
|
| 3 |
+
"overlap": 64,
|
| 4 |
+
"model_name": "distilroberta-base",
|
| 5 |
+
"val_metrics": {
|
| 6 |
+
"accuracy": 0.9795400902058844,
|
| 7 |
+
"macro_f1_structural": 0.7832464081700393,
|
| 8 |
+
"precision_JOIN": 0.887536112257532,
|
| 9 |
+
"recall_JOIN": 0.9830857142857143,
|
| 10 |
+
"f1_JOIN": 0.9328706214076565,
|
| 11 |
+
"precision_SPACE": 0.9972153093227003,
|
| 12 |
+
"recall_SPACE": 0.9830608435529667,
|
| 13 |
+
"f1_SPACE": 0.9900874903362599,
|
| 14 |
+
"precision_NEWLINE": 0.6938279112192156,
|
| 15 |
+
"recall_NEWLINE": 0.8199784405318002,
|
| 16 |
+
"f1_NEWLINE": 0.7516469038208169,
|
| 17 |
+
"precision_PARA": 0.5414314516129032,
|
| 18 |
+
"recall_PARA": 0.8623956326268465,
|
| 19 |
+
"f1_PARA": 0.6652216992816448
|
| 20 |
+
}
|
| 21 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": true,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"cls_token": "<s>",
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"is_local": false,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"model_max_length": 512,
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"sep_token": "</s>",
|
| 14 |
+
"tokenizer_class": "RobertaTokenizer",
|
| 15 |
+
"trim_offsets": true,
|
| 16 |
+
"unk_token": "<unk>"
|
| 17 |
+
}
|
training_log.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"steps": [
|
| 3 |
+
{
|
| 4 |
+
"step": 50,
|
| 5 |
+
"loss": 0.50878637611866,
|
| 6 |
+
"lr": 8.510638297872341e-05
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"step": 100,
|
| 10 |
+
"loss": 0.18682242080569267,
|
| 11 |
+
"lr": 6.382978723404256e-05
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"step": 150,
|
| 15 |
+
"loss": 0.15591484516859055,
|
| 16 |
+
"lr": 4.2553191489361704e-05
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"step": 200,
|
| 20 |
+
"loss": 0.1426215897500515,
|
| 21 |
+
"lr": 2.1276595744680852e-05
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"step": 250,
|
| 25 |
+
"loss": 0.14926597610116005,
|
| 26 |
+
"lr": 0.0
|
| 27 |
+
}
|
| 28 |
+
],
|
| 29 |
+
"epochs": [
|
| 30 |
+
{
|
| 31 |
+
"epoch": 1,
|
| 32 |
+
"accuracy": 0.9795400902058844,
|
| 33 |
+
"macro_f1_structural": 0.7832464081700393,
|
| 34 |
+
"precision_JOIN": 0.887536112257532,
|
| 35 |
+
"recall_JOIN": 0.9830857142857143,
|
| 36 |
+
"f1_JOIN": 0.9328706214076565,
|
| 37 |
+
"precision_SPACE": 0.9972153093227003,
|
| 38 |
+
"recall_SPACE": 0.9830608435529667,
|
| 39 |
+
"f1_SPACE": 0.9900874903362599,
|
| 40 |
+
"precision_NEWLINE": 0.6938279112192156,
|
| 41 |
+
"recall_NEWLINE": 0.8199784405318002,
|
| 42 |
+
"f1_NEWLINE": 0.7516469038208169,
|
| 43 |
+
"precision_PARA": 0.5414314516129032,
|
| 44 |
+
"recall_PARA": 0.8623956326268465,
|
| 45 |
+
"f1_PARA": 0.6652216992816448
|
| 46 |
+
}
|
| 47 |
+
]
|
| 48 |
+
}
|