ipatate
commited on
Commit
·
4abc5f4
1
Parent(s):
6980472
update doc
Browse files- README.md +9 -4
- config.json +2 -2
README.md
CHANGED
|
@@ -14,18 +14,23 @@ This model is fine-tuned from `microsoft/Multilingual-MiniLM-L12-H384` to classi
|
|
| 14 |
|
| 15 |
## Usage
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
```python
|
| 18 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 19 |
|
| 20 |
model_name = "Goodmotion/spam-mail-classifier"
|
| 21 |
-
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 23 |
-
model = AutoModelForSequenceClassification.from_pretrained(
|
|
|
|
|
|
|
| 24 |
|
| 25 |
text = "Félicitations ! Vous avez gagné un iPhone."
|
| 26 |
inputs = tokenizer(text, return_tensors="pt")
|
| 27 |
outputs = model(**inputs)
|
| 28 |
-
|
| 29 |
print(outputs.logits)
|
| 30 |
```
|
| 31 |
|
|
@@ -38,7 +43,7 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
| 38 |
model_name = "Goodmotion/spam-mail-classifier"
|
| 39 |
|
| 40 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 41 |
-
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 42 |
|
| 43 |
texts = [
|
| 44 |
'Join us for a webinar on AI innovations',
|
|
|
|
| 14 |
|
| 15 |
## Usage
|
| 16 |
|
| 17 |
+
This model is fine-tuned from `microsoft/Multilingual-MiniLM-L12-H384` to classify email subjects as SPAM or NOSPAM.
|
| 18 |
+
|
| 19 |
+
### Loading the model
|
| 20 |
+
To load this model, ensure you specify `from_safetensors=True`:
|
| 21 |
+
|
| 22 |
```python
|
| 23 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 24 |
|
| 25 |
model_name = "Goodmotion/spam-mail-classifier"
|
|
|
|
| 26 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 27 |
+
model = AutoModelForSequenceClassification.from_pretrained(
|
| 28 |
+
model_name, from_safetensors=True
|
| 29 |
+
)
|
| 30 |
|
| 31 |
text = "Félicitations ! Vous avez gagné un iPhone."
|
| 32 |
inputs = tokenizer(text, return_tensors="pt")
|
| 33 |
outputs = model(**inputs)
|
|
|
|
| 34 |
print(outputs.logits)
|
| 35 |
```
|
| 36 |
|
|
|
|
| 43 |
model_name = "Goodmotion/spam-mail-classifier"
|
| 44 |
|
| 45 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 46 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name,from_safetensors=True)
|
| 47 |
|
| 48 |
texts = [
|
| 49 |
'Join us for a webinar on AI innovations',
|
config.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9dad0e77cb2fdbd8f66acdc9e26e06651be2490dfcdf6e428bb09f1aaf5df7cd
|
| 3 |
+
size 796
|