| ---
|
| language: en
|
| license: mit
|
| tags:
|
| - seo
|
| - local-seo
|
| - nap
|
| - consistency
|
| ---
|
|
|
| # NAP-Consistency-Checker: Local SEO NAP and Entity Validation
|
|
|
| **Type:** Commercial | **Domain:** SEO, Local SEO
|
| **Hugging Face:** [syeedalireza/nap-consistency-checker](https://huggingface.co/syeedalireza/nap-consistency-checker)
|
|
|
| Validate NAP (Name, Address, Phone) consistency and entity alignment across pages and citation sources.
|
|
|
| ## Author
|
|
|
| **Alireza Aminzadeh**
|
| - Hugging Face: [syeedalireza](https://huggingface.co/syeedalireza)
|
| - LinkedIn: [alirezaaminzadeh](https://www.linkedin.com/in/alirezaaminzadeh)
|
| - Email: alireza.aminzadeh@hotmail.com
|
|
|
| ## Problem
|
|
|
| Local SEO depends on consistent NAP across site and citations. Detecting variations and normalizing entities reduces confusion for users and search engines.
|
|
|
| ## Approach
|
|
|
| - **Input:** Text snippets or structured NAP fields (name, address, phone) from multiple sources.
|
| - **Output:** Consistency flags (match/mismatch), normalized canonical form, optional entity resolution (same business or not).
|
| - **Models:** Rule-based normalization (address/phone parsing) + optional transformer/NER for extracting NAP from raw text; embedding similarity for entity matching.
|
|
|
| ## Tech Stack
|
|
|
| | Category | Tools |
|
| |----------|------|
|
| | NLP | Hugging Face Transformers, sentence-transformers (optional) |
|
| | Rules | regex, standard phone/address parsing |
|
| | Data | pandas, NumPy |
|
|
|
| ## Setup
|
|
|
| ```bash
|
| pip install -r requirements.txt
|
| ```
|
|
|
| ## Usage
|
|
|
| ```bash
|
| python inference.py --input data/citations.csv --reference data/reference_nap.csv --output output/consistency_report.csv
|
| ```
|
|
|
| - `normalize.py` provides NAP normalization helpers (used by inference). No separate βbuild canonicalβ step; the reference is read from the reference CSV.
|
|
|
| ## Project structure
|
|
|
| ```
|
| 09_nap-consistency-checker/
|
| βββ config.py
|
| βββ normalize.py # NAP normalization helpers
|
| βββ inference.py # Compare citations to reference NAP
|
| βββ requirements.txt
|
| βββ .env.example
|
| βββ data/
|
| β βββ reference_nap.csv # Canonical NAP (one row: name, address, phone)
|
| β βββ citations.csv # Source, name, address, phone per citation
|
| βββ output/ # consistency_report.csv
|
| ```
|
|
|
| ## Data
|
|
|
| - **Sample data (included):** `data/reference_nap.csv` (one row: `name`, `address`, `phone`), `data/citations.csv` (columns: `source`, `name`, `address`, `phone`). Output: `name_match`, `address_match`, `phone_match`, `nap_consistent`.
|
|
|
| ## License
|
|
|
| MIT.
|
|
|