Multilingual ad detector built on top of an XLM-R–based genre model and a lightweight
binary
decision layer. It combines the model’s “Promotion” probability with smart chunking, pooling, and rules (prices, phones, cues, etc.) to classify any input text as
AD
or
NOT_AD
.
Optimized for FR / DE / LB, but works on “other” languages too.
🔌 Quickstart
from transformers import pipeline
pipe = pipeline(
"text-classification",
model="impresso-project/impresso-ad-classification-xlm-one-class",
trust_remote_code=True, # required to use the bundled pipeline.py
revision="v2.0", # optional adclassification model version. Latest version is the default one.
)
pipe("Appartement 3 pièces… Fr. 2'100.–, tél. 079 ...")
# [{'label': 'AD', 'score': 0.87, 'promotion_prob': 0.83, 'threshold_used': 0.80,# 'xgenre_top_label': 'Promotion', 'xgenre_top_prob': 0.88, ...diagnostics...}]
Batch input
pipe(["texte A", "Text B"]) # → list of dicts in the same order
Dict input (with metadata)
pipe([
{"ft": "Annonce en français ...", "lg": "fr"},
{"ft": "Mietwohnung ...", "lg": "de"}
])
pipeline.py
also exposes a convenience method to mirror the CLI workflow:
from transformers import AutoPipelineForTextClassification
p = AutoPipelineForTextClassification.from_pretrained(
"impresso-project/impresso-ad-classification-xlm-one-class",
trust_remote_code=True,
)
p.predict_jsonl("input.jsonl", "results.jsonl")
Input JSONL
: one object per line, with at least
{ "ft": "<text>" }
(optionally
"lg": "fr|de|lb|..."
)
Output JSONL
: same rows plus
promotion_prob
,
promotion_prob_final
(as
score
),
is_ad_pred
, etc.
impresso-ad-classification-xlm-one-class huggingface.co is an AI model on huggingface.co that provides impresso-ad-classification-xlm-one-class's model effect (), which can be used instantly with this impresso-project impresso-ad-classification-xlm-one-class model. huggingface.co supports a free trial of the impresso-ad-classification-xlm-one-class model, and also provides paid use of the impresso-ad-classification-xlm-one-class. Support call impresso-ad-classification-xlm-one-class model through api, including Node.js, Python, http.
impresso-ad-classification-xlm-one-class huggingface.co is an online trial and call api platform, which integrates impresso-ad-classification-xlm-one-class's modeling effects, including api services, and provides a free online trial of impresso-ad-classification-xlm-one-class, you can try impresso-ad-classification-xlm-one-class online for free by clicking the link below.
impresso-project impresso-ad-classification-xlm-one-class online free url in huggingface.co:
impresso-ad-classification-xlm-one-class is an open source model from GitHub that offers a free installation service, and any user can find impresso-ad-classification-xlm-one-class on GitHub to install. At the same time, huggingface.co provides the effect of impresso-ad-classification-xlm-one-class install, users can directly use impresso-ad-classification-xlm-one-class installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
impresso-ad-classification-xlm-one-class install url in huggingface.co: