Update README.md
Browse files
README.md
CHANGED
|
@@ -56,29 +56,28 @@ This modelcard aims to be a base template for new models. It has been generated
|
|
| 56 |
|
| 57 |
[More Information Needed]
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 62 |
-
|
| 63 |
-
[More Information Needed]
|
| 64 |
-
|
| 65 |
-
## Bias, Risks, and Limitations
|
| 66 |
-
|
| 67 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 68 |
-
|
| 69 |
-
[More Information Needed]
|
| 70 |
-
|
| 71 |
-
### Recommendations
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
-
|
|
|
|
|
|
|
| 82 |
|
| 83 |
## Training Details
|
| 84 |
|
|
@@ -90,7 +89,6 @@ Use the code below to get started with the model.
|
|
| 90 |
|
| 91 |
### Training Procedure
|
| 92 |
|
| 93 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 94 |
|
| 95 |
#### Preprocessing [optional]
|
| 96 |
|
|
@@ -99,7 +97,13 @@ Use the code below to get started with the model.
|
|
| 99 |
|
| 100 |
#### Training Hyperparameters
|
| 101 |
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
#### Speeds, Sizes, Times [optional]
|
| 105 |
|
|
@@ -133,7 +137,9 @@ Use the code below to get started with the model.
|
|
| 133 |
|
| 134 |
### Results
|
| 135 |
|
| 136 |
-
|
|
|
|
|
|
|
| 137 |
|
| 138 |
#### Summary
|
| 139 |
|
|
@@ -145,18 +151,6 @@ Use the code below to get started with the model.
|
|
| 145 |
|
| 146 |
[More Information Needed]
|
| 147 |
|
| 148 |
-
## Environmental Impact
|
| 149 |
-
|
| 150 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 151 |
-
|
| 152 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 153 |
-
|
| 154 |
-
- **Hardware Type:** [More Information Needed]
|
| 155 |
-
- **Hours used:** [More Information Needed]
|
| 156 |
-
- **Cloud Provider:** [More Information Needed]
|
| 157 |
-
- **Compute Region:** [More Information Needed]
|
| 158 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 159 |
-
|
| 160 |
## Technical Specifications [optional]
|
| 161 |
|
| 162 |
### Model Architecture and Objective
|
|
@@ -175,24 +169,6 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
|
|
| 175 |
|
| 176 |
[More Information Needed]
|
| 177 |
|
| 178 |
-
## Citation [optional]
|
| 179 |
-
|
| 180 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 181 |
-
|
| 182 |
-
**BibTeX:**
|
| 183 |
-
|
| 184 |
-
[More Information Needed]
|
| 185 |
-
|
| 186 |
-
**APA:**
|
| 187 |
-
|
| 188 |
-
[More Information Needed]
|
| 189 |
-
|
| 190 |
-
## Glossary [optional]
|
| 191 |
-
|
| 192 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 193 |
-
|
| 194 |
-
[More Information Needed]
|
| 195 |
-
|
| 196 |
## More Information [optional]
|
| 197 |
|
| 198 |
[More Information Needed]
|
|
|
|
| 56 |
|
| 57 |
[More Information Needed]
|
| 58 |
|
| 59 |
+
## How to Get Started with the Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
```python
|
| 62 |
+
import torch
|
| 63 |
+
from transformers import BertForSequenceClassification, BertTokenizer
|
| 64 |
|
| 65 |
+
# Load model and tokenizer
|
| 66 |
+
model = BertForSequenceClassification.from_pretrained("scfengv/TVL_GeneralLayerClassifier")
|
| 67 |
+
tokenizer = BertTokenizer.from_pretrained("scfengv/TVL_GeneralLayerClassifier")
|
| 68 |
|
| 69 |
+
# Prepare your text
|
| 70 |
+
text = "Your text here"
|
| 71 |
+
inputs = tokenizer(text, return_tensors = "pt", padding = True, truncation = True, max_length = 512)
|
| 72 |
|
| 73 |
+
# Make prediction
|
| 74 |
+
with torch.no_grad():
|
| 75 |
+
outputs = model(**inputs)
|
| 76 |
+
predictions = torch.sigmoid(outputs.logits)
|
| 77 |
|
| 78 |
+
# Print predictions
|
| 79 |
+
print(predictions)
|
| 80 |
+
```
|
| 81 |
|
| 82 |
## Training Details
|
| 83 |
|
|
|
|
| 89 |
|
| 90 |
### Training Procedure
|
| 91 |
|
|
|
|
| 92 |
|
| 93 |
#### Preprocessing [optional]
|
| 94 |
|
|
|
|
| 97 |
|
| 98 |
#### Training Hyperparameters
|
| 99 |
|
| 100 |
+
|
| 101 |
+
The model was trained using the following hyperparameters:
|
| 102 |
+
|
| 103 |
+
Learning rate: 1e-05
|
| 104 |
+
Batch size: 32
|
| 105 |
+
Number of epochs: 10
|
| 106 |
+
Optimizer: Adam
|
| 107 |
|
| 108 |
#### Speeds, Sizes, Times [optional]
|
| 109 |
|
|
|
|
| 137 |
|
| 138 |
### Results
|
| 139 |
|
| 140 |
+
- Accuracy: 0.9592504607823059
|
| 141 |
+
- F1 Score (Micro): 0.9740588950133884
|
| 142 |
+
- F1 Score (Macro): 0.9757074189160264
|
| 143 |
|
| 144 |
#### Summary
|
| 145 |
|
|
|
|
| 151 |
|
| 152 |
[More Information Needed]
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
## Technical Specifications [optional]
|
| 155 |
|
| 156 |
### Model Architecture and Objective
|
|
|
|
| 169 |
|
| 170 |
[More Information Needed]
|
| 171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
## More Information [optional]
|
| 173 |
|
| 174 |
[More Information Needed]
|