tomaarsen HF staff commited on
Commit
fb8f7a8
1 Parent(s): 758b951

Upload improved README

Browse files
Files changed (1) hide show
  1. README.md +93 -4
README.md CHANGED
@@ -8,12 +8,67 @@ tags:
8
  - ner
9
  - named-entity-recognition
10
  pipeline_tag: token-classification
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- # SpanMarker for Named Entity Recognition
14
 
15
- This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition. In particular, this SpanMarker model uses [bert-base-uncased](https://huggingface.co/bert-base-uncased) as the underlying encoder.
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  ## Usage
19
 
@@ -29,9 +84,43 @@ You can then run inference with this model like so:
29
  from span_marker import SpanMarkerModel
30
 
31
  # Download from the 🤗 Hub
32
- model = SpanMarkerModel.from_pretrained("span_marker_model_name")
33
  # Run inference
34
- entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
35
  ```
36
 
37
  See the [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) repository for documentation and additional information on this library.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  - ner
9
  - named-entity-recognition
10
  pipeline_tag: token-classification
11
+ widget:
12
+ - text: "here, da = direct assessment, rr = relative ranking, ds = discrete scale and cs = continuous scale."
13
+ example_title: "Uncased Example 1"
14
+ - text: "modifying or replacing the erasable programmable read only memory (eprom) in a phone would allow the configuration of any esn and min via software for cellular devices."
15
+ example_title: "Uncased Example 2"
16
+ - text: "we propose a technique called aggressive stochastic weight averaging (aswa) and an extension called norm-filtered aggressive stochastic weight averaging (naswa) which improves te stability of models over random seeds."
17
+ example_title: "Uncased Example 3"
18
+ - text: "the choice of the encoder and decoder modules of dnpg can be quite flexible, for instance long-short term memory networks (lstm) or convolutional neural network (cnn)."
19
+ example_title: "Uncased Example 4"
20
+ model-index:
21
+ - name: SpanMarker w. bert-base-uncased on Acronym Identification by Tom Aarsen
22
+ results:
23
+ - task:
24
+ type: token-classification
25
+ name: Named Entity Recognition
26
+ dataset:
27
+ type: acronym_identification
28
+ name: Acronym Identification
29
+ split: validation
30
+ revision: c3c245a18bbd57b1682b099e14460eebf154cbdf
31
+ metrics:
32
+ - type: f1
33
+ value: 0.9198
34
+ name: F1
35
+ - type: precision
36
+ value: 0.9252
37
+ name: Precision
38
+ - type: recall
39
+ value: 0.9145
40
+ name: Recall
41
+ datasets:
42
+ - acronym_identification
43
+ language:
44
+ - en
45
+ metrics:
46
+ - f1
47
+ - recall
48
+ - precision
49
  ---
50
 
51
+ # SpanMarker for uncased Acronyms Named Entity Recognition
52
 
53
+ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition. In particular, this SpanMarker model uses [bert-base-uncased](https://huggingface.co/bert-base-uncased) as the underlying encoder. See [train.py](train.py) for the training script.
54
 
55
+ Is your data only capitalized correctly? Then consider using the cased variant of this model instead for better performance:
56
+ [tomaarsen/span-marker-bert-base-acronyms](https://huggingface.co/tomaarsen/span-marker-bert-base-acronyms).
57
+
58
+ ## Metrics
59
+
60
+ It achieves the following results on the validation set:
61
+ - Overall Precision: 0.9252
62
+ - Overall Recall: 0.9145
63
+ - Overall F1: 0.9198
64
+ - Overall Accuracy: 0.9797
65
+
66
+ ## Labels
67
+
68
+ | **Label** | **Examples** |
69
+ |-----------|--------------|
70
+ | SHORT | "nlp", "coqa", "soda", "sca" |
71
+ | LONG | "natural language processing", "conversational question answering", "symposium on discrete algorithms", "successive convex approximation" |
72
 
73
  ## Usage
74
 
 
84
  from span_marker import SpanMarkerModel
85
 
86
  # Download from the 🤗 Hub
87
+ model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-uncased-acronyms")
88
  # Run inference
89
+ entities = model.predict("compression algorithms like principal component analysis (pca) can reduce noise and complexity.")
90
  ```
91
 
92
  See the [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) repository for documentation and additional information on this library.
93
+
94
+ ## Training procedure
95
+
96
+ ### Training hyperparameters
97
+
98
+ The following hyperparameters were used during training:
99
+ - learning_rate: 5e-05
100
+ - train_batch_size: 32
101
+ - eval_batch_size: 32
102
+ - seed: 42
103
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
104
+ - lr_scheduler_type: linear
105
+ - lr_scheduler_warmup_ratio: 0.1
106
+ - num_epochs: 2
107
+
108
+ ### Training results
109
+
110
+ | Training Loss | Epoch | Step | Validation Loss | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
111
+ |:-------------:|:-----:|:----:|:---------------:|:-----------------:|:--------------:|:----------:|:----------------:|
112
+ | 0.013 | 0.31 | 200 | 0.0101 | 0.8998 | 0.8514 | 0.8749 | 0.9696 |
113
+ | 0.0088 | 0.62 | 400 | 0.0082 | 0.8997 | 0.9142 | 0.9069 | 0.9764 |
114
+ | 0.0082 | 0.94 | 600 | 0.0071 | 0.9173 | 0.8955 | 0.9063 | 0.9765 |
115
+ | 0.0063 | 1.25 | 800 | 0.0066 | 0.9210 | 0.9187 | 0.9198 | 0.9802 |
116
+ | 0.0066 | 1.56 | 1000 | 0.0066 | 0.9302 | 0.8941 | 0.9118 | 0.9783 |
117
+ | 0.0064 | 1.87 | 1200 | 0.0063 | 0.9304 | 0.9042 | 0.9171 | 0.9792 |
118
+ | 0.0063 | 2.00 | 1290 | 0.0063 | 0.9252 | 0.9145 | 0.9198 | 0.9797 |
119
+
120
+ ### Framework versions
121
+
122
+ - SpanMarker 1.2.4
123
+ - Transformers 4.31.0
124
+ - Pytorch 1.13.1+cu117
125
+ - Datasets 2.14.3
126
+ - Tokenizers 0.13.2