🏪 Çarşı — Turkish E-Commerce NER (Named Entity Recognition)
A fine-tuned Turkish BERT model for extracting product entities from e-commerce texts: product names, brands, prices, colors, sizes, materials, and gender targets.
This model is part of the
Çarşı project, a dual-model NER demo comparing fine-tuned BERT against zero-shot LLM extraction.
Model Overview
| Property | Value |
|---|
| Base Model | dbmdz/bert-base-turkish-cased |
| Language | Turkish (tr) |
| Task | Token Classification / NER (15 BIO labels) |
| Parameters | ~111M |
| Inference Speed | ~10–50 ms on CPU |
| License | Apache 2.0 |
Supported Entity Types (7)
| Entity | Tag | Description | Example |
|---|
| PRODUCT | B/I-PRODUCT | Product name | koşu ayakkabısı, t-shirt, cep telefonu |
| BRAND | B/I-BRAND | Brand name | Nike, Samsung, Zara, LC Waikiki |
| PRICE | B/I-PRICE | Price amount | 2.500 TL, 1.299,99 TL |
| COLOR | B/I-COLOR | Color | kırmızı, lacivert, siyah, bordo |
| SIZE | B/I-SIZE | Size / shoe number | M, XL, 42, 38 numara |
| MATERIAL | B/I-MATERIAL | Material / fabric | deri, pamuklu, polyester, kaşmir |
| GENDER | B/I-GENDER | Target gender | kadın, erkek, unisex |
Full BIO label set (15): O, B-PRODUCT, I-PRODUCT, B-BRAND, I-BRAND, B-PRICE, I-PRICE, B-COLOR, I-COLOR, B-SIZE, I-SIZE, B-MATERIAL, I-MATERIAL, B-GENDER, I-GENDER
Quick Start
With Transformers Pipeline
1from transformers import pipeline
2
3ner = pipeline(
4 "ner",
5 model="cihatyldz/carsi-bert-turkish-ecommerce-ner",
6 aggregation_strategy="simple",
7)
8
9results = ner("Nike Air Max 90 kırmızı 42 numara 3.499 TL")
10for entity in results:
11 print(f" [{entity['entity_group']}] {entity['word']} ({entity['score']:.1%})")
12
13# [BRAND] Nike (99.8%)
14# [PRODUCT] Air Max 90 (99.2%)
15# [COLOR] kırmızı (99.5%)
16# [SIZE] 42 numara (98.9%)
17# [PRICE] 3.499 TL (99.7%)
Manual Inference
1from transformers import AutoTokenizer, AutoModelForTokenClassification
2import torch
3
4model_name = "cihatyldz/carsi-bert-turkish-ecommerce-ner"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForTokenClassification.from_pretrained(model_name)
7model.eval()
8
9text = "Zara kadın deri ceket siyah M beden 2.999 TL"
10inputs = tokenizer(text, return_tensors="pt", return_offsets_mapping=True)
11offset_mapping = inputs.pop("offset_mapping")[0]
12
13with torch.no_grad():
14 outputs = model(**inputs)
15
16predictions = torch.argmax(outputs.logits, dim=-1)[0]
17
18for idx, (pred_id, (start, end)) in enumerate(zip(predictions, offset_mapping)):
19 if start == 0 and end == 0:
20 continue
21 label = model.config.id2label[pred_id.item()]
22 if label != "O":
23 print(f" [{label}] {text[start:end]}")
Training Details
Dataset
- Source:
cihatyldz/carsi-turkish-ecommerce-ner
- Size: ~8,000 synthetic Turkish e-commerce sentences
- Generation Method: Template-based synthesis with 25 sentence patterns, 39 brands, 50+ products, 25 colors, and randomized parameters
- Labeling: Automatic BIO tagging with character-level entity position tracking — no manual annotation needed
- Split: 80% train / 10% validation / 10% test
Training Configuration
| Hyperparameter | Value |
|---|
| Base model | dbmdz/bert-base-turkish-cased |
| Epochs | 5 |
| Batch size | 16 |
| Learning rate | 3e-5 |
| Weight decay | 0.01 |
| Warmup ratio | 0.1 |
| Max sequence length | 128 |
| FP16 | Enabled |
| Early stopping | Patience = 2 (metric: F1) |
Infrastructure
- Hardware: NVIDIA Tesla T4 (Google Colab)
- Training time: ~10 minutes
- Framework: Hugging Face Transformers + Trainer API
- Evaluation: seqeval (entity-level metrics)
Evaluation Results
Evaluated on the held-out test split (~800 examples) using seqeval:
| Entity | Precision | Recall | F1 |
|---|
| PRODUCT | ~0.99 | ~0.99 | ~0.99 |
| BRAND | ~0.99 | ~0.99 | ~0.99 |
| PRICE | ~0.99 | ~0.99 | ~0.99 |
| COLOR | ~0.99 | ~0.99 | ~0.99 |
| SIZE | ~0.99 | ~0.99 | ~0.99 |
| MATERIAL | ~0.99 | ~0.99 | ~0.99 |
| GENDER | ~0.99 | ~0.99 | ~0.99 |
| micro avg | ~0.99 | ~0.99 | ~0.99 |
Note: High scores reflect the synthetic/template-based training data. Real-world e-commerce text (user reviews, messy listings) would yield lower but still useful performance.
Live Demo
Try the model in the Çarşı Space, where it runs side-by-side with a zero-shot LLM (Qwen2.5-7B):
| BERT NER (this model) | LLM Zero-shot (Qwen2.5-7B) |
|---|
| Speed | ~10–50 ms (CPU) | ~1–3 s (Inference API) |
| Approach | Fine-tuned, specialized | Zero-shot, flexible |
| New entities | Requires retraining | Just add to prompt |
| Cost | Free (CPU) | Free (HF Inference API) |
Use Cases
- Product catalog parsing: Extract structured data from unstructured product listings
- Search enrichment: Auto-tag products with brand, color, size for better search
- Price monitoring: Extract prices from competitor listings
- Review analysis: Identify which products, brands, and attributes customers mention
- Chatbot integration: Parse user queries like "kırmızı Nike ayakkabı 42 numara" into structured filters
Limitations
- Synthetic training data: Trained on template-generated sentences, not real marketplace listings. Performance on noisy real-world text may vary.
- Turkish only: Designed for Turkish e-commerce text.
- Fixed entity set: Supports 7 predefined entity types. Custom entities require retraining.
- Brand coverage: Trained on ~39 major brands. Lesser-known brands may not be recognized.
Project Portfolio
| Project | Domain | Architecture | Link |
|---|
| 🪙 Akçe | Banking | Fine-tuned LLM (LoRA) | Space |
| 🐪 Kervan | Logistics | RAG | Space |
| 🏥 Şifahane | Healthcare | Classifier vs LLM | Space |
| ⚖️ Mizan | Media | RAG Fact-Checker | Space |
| 🏪 Çarşı | E-Commerce | NER (Token Classification) | Space |
Citation
1@misc{yildiz2025carsi,
2 author = {Cihat Yıldız},
3 title = {Çarşı: Turkish E-Commerce Named Entity Recognition with Fine-tuned BERT},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/cihatyldz/carsi-bert-turkish-ecommerce-ner}
7}
Contact
- Developer: Cihat Yıldız
- Hugging Face: @cihatyldz
- Demo: Çarşı Space