jack813liu
commited on
Commit
•
62d944c
1
Parent(s):
956e055
Update README.md
Browse files
README.md
CHANGED
@@ -98,17 +98,16 @@ predict("DVAJ-548_CH_SD")
|
|
98 |
|
99 |
## How to Get Started with the Model
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
### step 2:
|
104 |
Create a python file under this model, such as 'use_model.py'
|
105 |
```python
|
106 |
import torch
|
107 |
from transformers import BertForSequenceClassification, BertTokenizer
|
|
|
108 |
# load model
|
109 |
-
|
110 |
-
|
111 |
-
tokenizer = BertTokenizer.from_pretrained("./sexual_detection")
|
112 |
|
113 |
def predict(text):
|
114 |
encoding = tokenizer(text, return_tensors="pt")
|
@@ -126,7 +125,7 @@ def predict(text):
|
|
126 |
predict("Tiffany Doll - Wine Makes Me Anal (31.03.2018)_1080p.mp4")
|
127 |
|
128 |
```
|
129 |
-
### step
|
130 |
Run
|
131 |
```shell
|
132 |
python3 use_model.py
|
|
|
98 |
|
99 |
## How to Get Started with the Model
|
100 |
|
101 |
+
|
102 |
+
### step 1:
|
|
|
103 |
Create a python file under this model, such as 'use_model.py'
|
104 |
```python
|
105 |
import torch
|
106 |
from transformers import BertForSequenceClassification, BertTokenizer
|
107 |
+
|
108 |
# load model
|
109 |
+
tokenizer = BertTokenizer.from_pretrained("uget/sexual_content_dection")
|
110 |
+
model = BertForSequenceClassification.from_pretrained("uget/sexual_content_dection")
|
|
|
111 |
|
112 |
def predict(text):
|
113 |
encoding = tokenizer(text, return_tensors="pt")
|
|
|
125 |
predict("Tiffany Doll - Wine Makes Me Anal (31.03.2018)_1080p.mp4")
|
126 |
|
127 |
```
|
128 |
+
### step 2:
|
129 |
Run
|
130 |
```shell
|
131 |
python3 use_model.py
|