SERP-Feature-Classifier: SERP Feature Type Prediction
Type: Academic | Domain: SEO, Search
Hugging Face: syeedalireza/serp-feature-classifier
Multi-label classification of SERP feature types (featured snippet, PAA, local pack, etc.) from query and context.
Author
Alireza Aminzadeh
- Hugging Face: syeedalireza
- LinkedIn: alirezaaminzadeh
- Email: alireza.aminzadeh@hotmail.com
Problem
Understanding which SERP features appear for a query helps content and technical SEO strategy (e.g. snippet optimization, local SEO).
Approach
- Input: Query text, optional context (device, locale).
- Output: Multi-label (featured_snippet, paa, local_pack, knowledge_panel, etc.).
- Models: Transformer-based text classifier (e.g. BERT mini) or sentence-transformers + linear head; optional XGBoost on query features.
Tech Stack
| Category | Tools |
|---|---|
| NLP / DL | Hugging Face Transformers, sentence-transformers |
| ML | scikit-learn, PyTorch |
| Data | pandas, NumPy |
Setup
pip install -r requirements.txt
Usage
python train.py
python inference.py --query "best coffee shops near me"
Project structure
02_serp-feature-classifier/
βββ config.py
βββ train.py # Sentence-transformers + MultiOutputClassifier
βββ inference.py # Single query or batch CSV
βββ requirements.txt
βββ .env.example
βββ data/
β βββ serp_labels.csv # Sample: query + binary labels per SERP feature
βββ models/
Data
- Sample data (included):
data/serp_labels.csvβ columns:query,featured_snippet,paa,local_pack,knowledge_panel,images(0/1). - Set
DATA_PATHin.envif using another file.
License
MIT.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support