teknology commited on
Commit
0e909a3
·
verified ·
1 Parent(s): b13f2c8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -3
README.md CHANGED
@@ -1,3 +1,49 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ base_model:
5
+ - microsoft/deberta-v3-base
6
+ pipeline_tag: text-classification
7
+ license: mit
8
+ ---
9
+ Binary classification model for ad-detection on QA Systems.
10
+
11
+ ## Sample usage
12
+
13
+ ```python
14
+ import torch
15
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
16
+
17
+ classifier_model_path = "teknology/ad-classifier-v0.3"
18
+ tokenizer = AutoTokenizer.from_pretrained(classifier_model_path)
19
+ model = AutoModelForSequenceClassification.from_pretrained(classifier_model_path)
20
+ model.eval()
21
+
22
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
+ model.to(device)
24
+
25
+ def classify(passages):
26
+ inputs = tokenizer(
27
+ passages, padding=True, truncation=True, max_length=512, return_tensors="pt"
28
+ )
29
+ inputs = {k: v.to(device) for k, v in inputs.items()}
30
+ with torch.no_grad():
31
+ outputs = model(**inputs)
32
+ logits = outputs.logits
33
+ predictions = torch.argmax(logits, dim=-1)
34
+ return predictions.cpu().tolist()
35
+
36
+ preds = classify(["sample_text_1", "sample_text_2"])
37
+ ```
38
+
39
+
40
+ ## Version
41
+
42
+ Previous versions can be found at:
43
+ - v0.0: https://huggingface.co/jmvcoelho/ad-classifier-v0.0
44
+ Trained with the official data from Webis Generated Native Ads 2024
45
+ - v0.1: https://huggingface.co/jmvcoelho/ad-classifier-v0.1
46
+ Trained with v0.0 data + new synthetic data
47
+ - v0.2: https://huggingface.co/jmvcoelho/ad-classifier-v0.2
48
+ Similar to v0.1, but include more diversity in ad placement startegies through prompting.
49
+ - **v0.3**: Continued from v0.2, added a new synthetic dataset generated based on Wikipedia articles.