Update README.md
Browse files
README.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
---
|
2 |
-
license:
|
3 |
language:
|
4 |
- zh
|
5 |
metrics:
|
6 |
- accuracy
|
|
|
|
|
7 |
base_model:
|
8 |
- google-bert/bert-base-chinese
|
9 |
pipeline_tag: text-classification
|
@@ -12,6 +14,24 @@ tags:
|
|
12 |
datasets:
|
13 |
- scfengv/TVL-general-layer-dataset
|
14 |
library_name: adapter-transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
---
|
16 |
# Model Card for Model ID
|
17 |
|
@@ -30,7 +50,7 @@ library_name: adapter-transformers
|
|
30 |
|
31 |
### Model Sources
|
32 |
|
33 |
-
- **Repository:** [scfengv/
|
34 |
|
35 |
## Model Inference Examples
|
36 |
|
@@ -43,16 +63,17 @@ python inference_example_3.py
|
|
43 |
|
44 |
## How to Get Started with the Model
|
45 |
|
|
|
|
|
46 |
```python
|
47 |
import torch
|
48 |
from transformers import BertForSequenceClassification, BertTokenizer
|
49 |
|
50 |
-
# Load model and tokenizer
|
51 |
model = BertForSequenceClassification.from_pretrained("scfengv/TVL_GeneralLayerClassifier")
|
52 |
tokenizer = BertTokenizer.from_pretrained("scfengv/TVL_GeneralLayerClassifier")
|
53 |
|
54 |
# Prepare your text
|
55 |
-
text = "Your text here"
|
56 |
inputs = tokenizer(text, return_tensors = "pt", padding = True, truncation = True, max_length = 512)
|
57 |
|
58 |
# Make prediction
|
@@ -66,16 +87,16 @@ print(predictions)
|
|
66 |
|
67 |
## Training Details
|
68 |
|
|
|
|
|
|
|
|
|
69 |
### Training Data
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
#### Preprocessing
|
75 |
-
|
76 |
-
|
77 |
-
#### Training Hyperparameters
|
78 |
|
|
|
79 |
|
80 |
The model was trained using the following hyperparameters:
|
81 |
|
@@ -84,29 +105,21 @@ Learning rate: 1e-05
|
|
84 |
Batch size: 32
|
85 |
Number of epochs: 10
|
86 |
Optimizer: Adam
|
|
|
87 |
```
|
88 |
|
89 |
## Evaluation
|
90 |
|
91 |
-
###
|
92 |
-
|
93 |
-
- Accuracy: 0.9592504607823059
|
94 |
-
- F1 Score (Micro): 0.9740588950133884
|
95 |
-
- F1 Score (Macro): 0.9757074189160264
|
96 |
-
|
97 |
-
## Technical Specifications
|
98 |
-
|
99 |
-
### Model Architecture and Objective
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
### Compute Infrastructure
|
104 |
-
|
105 |
-
#### Hardware
|
106 |
|
107 |
-
-
|
|
|
|
|
|
|
|
|
108 |
|
109 |
-
|
110 |
|
111 |
-
-
|
112 |
-
-
|
|
|
|
1 |
---
|
2 |
+
license: mit
|
3 |
language:
|
4 |
- zh
|
5 |
metrics:
|
6 |
- accuracy
|
7 |
+
- f1 (macro)
|
8 |
+
- f1 (micro)
|
9 |
base_model:
|
10 |
- google-bert/bert-base-chinese
|
11 |
pipeline_tag: text-classification
|
|
|
14 |
datasets:
|
15 |
- scfengv/TVL-general-layer-dataset
|
16 |
library_name: adapter-transformers
|
17 |
+
model-index:
|
18 |
+
- name: scfengv/TVL_GeneralLayerClassifier
|
19 |
+
results:
|
20 |
+
- task:
|
21 |
+
type: multi-label text-classification
|
22 |
+
dataset:
|
23 |
+
name: scfengv/TVL-general-layer-dataset
|
24 |
+
type: scfengv/TVL-general-layer-dataset
|
25 |
+
metrics:
|
26 |
+
- name: Accuracy
|
27 |
+
type: Accuracy
|
28 |
+
value: 0.952902
|
29 |
+
- name: F1 score (Micro)
|
30 |
+
type: F1 score (Micro)
|
31 |
+
value: 0.968717
|
32 |
+
- name: F1 score (Macro)
|
33 |
+
type: F1 score (Macro)
|
34 |
+
value: 0.970818
|
35 |
---
|
36 |
# Model Card for Model ID
|
37 |
|
|
|
50 |
|
51 |
### Model Sources
|
52 |
|
53 |
+
- **Repository:** [scfengv/NLP-Topic-Modeling-for-TVL-livestream-comments](https://github.com/scfengv/NLP-Topic-Modeling-for-TVL-livestream-comments)
|
54 |
|
55 |
## Model Inference Examples
|
56 |
|
|
|
63 |
|
64 |
## How to Get Started with the Model
|
65 |
|
66 |
+
Use the code below to get started with the model.
|
67 |
+
|
68 |
```python
|
69 |
import torch
|
70 |
from transformers import BertForSequenceClassification, BertTokenizer
|
71 |
|
|
|
72 |
model = BertForSequenceClassification.from_pretrained("scfengv/TVL_GeneralLayerClassifier")
|
73 |
tokenizer = BertTokenizer.from_pretrained("scfengv/TVL_GeneralLayerClassifier")
|
74 |
|
75 |
# Prepare your text
|
76 |
+
text = "Your text here" ## Please refer to Dataset
|
77 |
inputs = tokenizer(text, return_tensors = "pt", padding = True, truncation = True, max_length = 512)
|
78 |
|
79 |
# Make prediction
|
|
|
87 |
|
88 |
## Training Details
|
89 |
|
90 |
+
- **Hardware Type:** NVIDIA Quadro RTX8000
|
91 |
+
- **Library:** PyTorch
|
92 |
+
- **Hours used:** 2hr 13mins
|
93 |
+
-
|
94 |
### Training Data
|
95 |
|
96 |
+
- [scfengv/TVL-general-layer-dataset](https://huggingface.co/datasets/scfengv/TVL-general-layer-dataset)
|
97 |
+
- train
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
+
### Training Hyperparameters
|
100 |
|
101 |
The model was trained using the following hyperparameters:
|
102 |
|
|
|
105 |
Batch size: 32
|
106 |
Number of epochs: 10
|
107 |
Optimizer: Adam
|
108 |
+
Loss function: torch.nn.BCEWithLogitsLoss()
|
109 |
```
|
110 |
|
111 |
## Evaluation
|
112 |
|
113 |
+
### Testing Data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
+
- [scfengv/TVL-general-layer-dataset](https://huggingface.co/datasets/scfengv/TVL-general-layer-dataset)
|
116 |
+
- validation
|
117 |
+
- Remove Emoji
|
118 |
+
- Emoji2Desc
|
119 |
+
- Remove Punctuation
|
120 |
|
121 |
+
### Results (validation)
|
122 |
|
123 |
+
- Accuracy: 0.952902
|
124 |
+
- F1 Score (Micro): 0.968717
|
125 |
+
- F1 Score (Macro): 0.970818
|