tomaarsen HF staff commited on
Commit
87f7994
1 Parent(s): b8f37c0

Upload refined README

Browse files
Files changed (1) hide show
  1. README.md +83 -4
README.md CHANGED
@@ -8,12 +8,61 @@ 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-cased](https://huggingface.co/bert-base-cased) as the underlying encoder.
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  ## Usage
19
 
@@ -29,9 +78,39 @@ 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: "X-Linked adrenoleukodystrophy (ALD) is a genetic disease associated with demyelination of the central nervous system, adrenal insufficiency, and accumulation of very long chain fatty acids in tissue and body fluids."
13
+ example_title: "Example 1"
14
+ - text: "Canavan disease is inherited as an autosomal recessive trait that is caused by the deficiency of aspartoacylase (ASPA)."
15
+ example_title: "Example 2"
16
+ - text: "However, both models lack other frequent DM symptoms including the fibre-type dependent atrophy, myotonia, cataract and male-infertility."
17
+ example_title: "Example 3"
18
+ model-index:
19
+ - name: SpanMarker w. bert-base-cased on NCBI Disease by Tom Aarsen
20
+ results:
21
+ - task:
22
+ type: token-classification
23
+ name: Named Entity Recognition
24
+ dataset:
25
+ type: ncbi_disease
26
+ name: NCBI Disease
27
+ split: test
28
+ revision: acd0e6451198d5b615c12356ab6a05fff4610920
29
+ metrics:
30
+ - type: f1
31
+ value: 0.8813
32
+ name: F1
33
+ - type: precision
34
+ value: 0.8661
35
+ name: Precision
36
+ - type: recall
37
+ value: 0.8971
38
+ name: Recall
39
+ datasets:
40
+ - ncbi_disease
41
+ language:
42
+ - en
43
+ metrics:
44
+ - f1
45
+ - recall
46
+ - precision
47
  ---
48
 
49
+ # SpanMarker for Disease Named Entity Recognition
50
 
51
+ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model trained on the [ncbi_disease](https://huggingface.co/datasets/ncbi_disease) dataset. In particular, this SpanMarker model uses [bert-base-cased](https://huggingface.co/bert-base-cased) as the underlying encoder. See [train.py](train.py) for the training script.
52
 
53
+ ## Metrics
54
+
55
+ This model achieves the following results on the testing set:
56
+ - Overall Precision: 0.8661
57
+ - Overall Recall: 0.8971
58
+ - Overall F1: 0.8813
59
+ - Overall Accuracy: 0.9837
60
+
61
+ ## Labels
62
+
63
+ | **Label** | **Examples** |
64
+ |-----------|--------------|
65
+ | DISEASE | "ataxia-telangiectasia", "T-cell leukaemia", "C5D", "neutrophilic leukocytosis", "pyogenic infection" |
66
 
67
  ## Usage
68
 
 
78
  from span_marker import SpanMarkerModel
79
 
80
  # Download from the 🤗 Hub
81
+ model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-bert-base-ncbi-disease")
82
  # Run inference
83
+ entities = model.predict("Canavan disease is inherited as an autosomal recessive trait that is caused by the deficiency of aspartoacylase (ASPA).")
84
  ```
85
 
86
  See the [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) repository for documentation and additional information on this library.
87
+
88
+ ## Training procedure
89
+
90
+ ### Training hyperparameters
91
+
92
+ The following hyperparameters were used during training:
93
+ - learning_rate: 5e-05
94
+ - train_batch_size: 32
95
+ - eval_batch_size: 32
96
+ - seed: 42
97
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
98
+ - lr_scheduler_type: linear
99
+ - lr_scheduler_warmup_ratio: 0.1
100
+ - num_epochs: 3
101
+
102
+ ### Training results
103
+
104
+ | Training Loss | Epoch | Step | Validation Loss | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
105
+ |:-------------:|:-----:|:----:|:---------------:|:-----------------:|:--------------:|:----------:|:----------------:|
106
+ | 0.0038 | 1.41 | 300 | 0.0059 | 0.8141 | 0.8579 | 0.8354 | 0.9818 |
107
+ | 0.0018 | 2.82 | 600 | 0.0054 | 0.8315 | 0.8720 | 0.8513 | 0.9840 |
108
+
109
+
110
+ ### Framework versions
111
+
112
+ - SpanMarker 1.2.4
113
+ - Transformers 4.31.0
114
+ - Pytorch 1.13.1+cu117
115
+ - Datasets 2.14.3
116
+ - Tokenizers 0.13.2