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

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_PATH in .env if using another file.

License

MIT.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using syeedalireza/serp-feature-classifier 1