Binary classification model for ad-detection on QA Systems.

Sample usage

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

classifier_model_path = "jmvcoelho/ad-classifier-v0.0"
tokenizer = AutoTokenizer.from_pretrained(classifier_model_path)
model = AutoModelForSequenceClassification.from_pretrained(classifier_model_path)
model.eval()

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

def classify(passages):
    inputs = tokenizer(
        passages, padding=True, truncation=True, max_length=512, return_tensors="pt"
    )
    inputs = {k: v.to(device) for k, v in inputs.items()}
    with torch.no_grad():
        outputs = model(**inputs)
        logits = outputs.logits
        predictions = torch.argmax(logits, dim=-1)
    return predictions.cpu().tolist()

preds = classify(["sample_text_1", "sample_text_2"])

Version

  • v0.0: Trained with the official data from Webis Generated Native Ads 2024
  • v0.1: Trained with v0.0 data + new synthetic data

Webis Generated Native Ads 2024

Paper: Detecting Generated Native Ads in Conversational Search

Data summary:

  • YouChat and Microsoft Copilot were used to generate answers for competitve keywork queries;
  • GPT-4 turbo was used to insert one advertisment into the answer;
  • This creates triples (query, answer_with_ad, answer_without_ad)
  • The classifier in this repo was trained to assign 0 to answer_without_ad, and 1 to answer_with_ad.
Downloads last month
45
Safetensors
Model size
184M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for jmvcoelho/ad-classifier-v0.0

Finetuned
(345)
this model