File size: 2,778 Bytes
5147a82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1f43cef
 
 
5147a82
1f43cef
 
 
 
5147a82
1f43cef
5147a82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
language: en
license: other
library_name: transformers
tags:
  - text-classification
  - distilbert
  - podcast
  - ad-detection
  - skipr
datasets:
  - custom
base_model: distilbert-base-uncased
pipeline_tag: text-classification
---

# Skipr Ad Classifier

Fine-tuned DistilBERT model that detects sponsor/ad segments in YouTube podcast transcript text.

**Also available:** [dkayaaaa/ad-classifier-quantised](https://huggingface.co/dkayaaaa/ad-classifier-quantised) — INT8 ONNX version (~64 MB) for faster, lighter inference with ONNX Runtime.

## Model description

This model classifies a short transcript window as either an ad/sponsor segment or normal podcast content. It was trained as part of the [Skipr](https://github.com/YOUR_ORG/skippy-model-training) pipeline for skipping sponsor segments in YouTube podcasts.

- **Architecture:** `distilbert-base-uncased`
- **Task:** Binary sequence classification
- **Labels:**
  - `0` — not an ad segment
  - `1` — ad/sponsor segment
- **Max sequence length:** 512 tokens
- **Training:** 3 epochs, fine-tuned from `distilbert-base-uncased`

## Intended use

Use this model to classify transcript windows (typically ~20 caption snippets) as ad vs non-ad content. It is designed for use in the Skipr browser extension and related inference services.

**Out of scope:**
- General sentiment or topic classification
- Non-English text (trained on English podcast transcripts)
- Full-video classification without segmentation

## Training data

## Training data

The model was trained on a mix of real and synthetic transcript windows:

- **Base set (~800 samples):** weak-labeled YouTube podcast segments
  - Positive: segments matching sponsor keywords/brands
  - Negative: normal podcast content
- **Augmented set (~1,200 samples):** synthetic variants generated with Llama 8B via Ollama, preserving the original label. Synthetic data generated through strategies; paraphrase, new scenario, style shift, fragment, vocabulary shift

Original labels are heuristic — the model learns from keyword-labeled examples. Synthetic data increases linguistic diversity but inherits the same label assumptions.

## Usage

### Transformers (Python)

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

repo = "dkayaaaa/ad-classifier"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo)

text = "this episode is brought to you by our friends at..."
inputs = tokenizer(
    text,
    return_tensors="pt",
    padding="max_length",
    truncation=True,
    max_length=512,
)

with torch.no_grad():
    logits = model(**inputs).logits
    prediction = logits.argmax(dim=-1).item()

print("ad" if prediction == 1 else "not ad")