Product Attribute Extractor
Use cases
Uses any OpenAI-compatible LLM to extract structured attributes (brand, colour, voltage, material, size, etc.) from product titles and descriptions.
Attributes are discovered iteratively across the catalogue: the model is given the list of known attributes found so far and instructed to reuse them before creating new ones, ensuring consistent naming.
Few-shot examples guide extraction quality.
Output is an enriched CSV with one column per discovered attribute, sorted by population frequency (most commonly filled attributes first).
Platform
Python script (requires Python 3.x)
Input
CSV containing product titles or descriptions
API key (OpenAI or compatible provider)
Model name (default: gpt-4o-mini)
Base URL (changeable for local LLMs)
Output
Enriched CSV with original product text plus one column per discovered attribute (brand, colour, voltage, material, size, product_type, etc.), sorted so the most populated attributes appear first.
Features
- Iterative attribute discovery (known set grows with each product)
- Few-shot examples for consistent extraction quality
- Enforces lowercase_with_underscores for attribute keys
- Always infers product_type even when not explicit
- JSON response format for reliable parsing
- Columns sorted by population frequency in output
- Supports OpenAI, Azure OpenAI, or any local LLM with compatible API
- Default model: gpt-4o-mini
How to use
- 1 Enter your API key in the sidebar
- 2 Optionally set a custom base URL for local LLMs
- 3 Upload a CSV and select the product text column
- 4 Click Extract Attributes and monitor progress
- 5 Review discovered attribute count as it grows
- 6 Download the enriched CSV with one column per attribute
Frequently asked questions
- How does the iterative attribute discovery work?
- The tool maintains a set of attribute names discovered so far. For each product, the system prompt includes the sorted known attribute list and instructs the model to reuse those names where applicable before inventing new ones. After each response, any new attribute keys are added to the known set and appear in subsequent prompts. This means attribute consistency improves as processing progresses.
- What format are the attribute keys in the output?
- All attribute keys are normalised to lowercase_with_underscores. The validate_and_clean_attributes function strips whitespace, lowercases, and replaces spaces with underscores. Duplicate keys after normalisation keep only the first non-empty value.
- What happens when the model cannot extract any attributes?
- If the API call fails entirely (network error, timeout, rate limit), an empty dict is returned for that row and an error is logged. If the model returns JSON but omits product_type, the code forces product_type to 'unknown' before returning. The row will have empty cells for all other attribute columns in the final CSV.
- Can I use a local LLM instead of OpenAI?
- Yes. Change the Base URL in the sidebar to your local server (e.g. http://localhost:1234/v1 for LM Studio or Ollama). The tool uses the OpenAI client library and JSON response format, so the local model must support the /v1/chat/completions endpoint with response_format json_object.
- Why are output columns sorted by frequency?
- The sort_columns_by_frequency function counts non-null values per column and reorders so the most populated attributes appear first. This means universally applicable attributes like brand and product_type appear on the left, while rare attributes (specific to a few products) move to the right, making the CSV easier to scan.
- How many products can it handle in one run?
- There is no hard limit in the code. Products are processed one at a time sequentially with no batching, so runtime scales linearly. A progress bar shows position and the number of discovered attributes. For large catalogues, cost is one API call per product row at gpt-4o-mini rates.
Want me to run this for you?
I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.
Related Tools
Generate XML sitemaps from GA landing page exports filtered by top transactions or revenue.
Suggest new category pages based on product H1 n-grams and search demand.
Center product images using OpenCV multi-method contour detection with threshold fallbacks.
Find higher resolution images using Google Vision API with Playwright fallback and human-like delays.
Map site search queries to existing pages and discover content gaps from user behaviour.
Calculate Return on Ad Spend from revenue and ad costs.
Need something built for your business?
This tool started as bespoke client work. I build custom scripts, data pipelines, and full apps for SEO and product data problems that off-the-shelf tools don't solve.
Tell Me What You Need