DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to categorize product descriptions in batches with Outlines

Pass a list of descriptions through a template and get a typed category, sub category and attributes for each.

Short answer: Install the library with pip install outlines; then connect a model with Outlines.from_transformers as in the quickstart; Define ProductCategory with main_category, sub_category, attributes and an optional brand_match. All steps.

Who it is forAn e-commerce or catalog engineer cleaning inventory data.

The problemManual categorization of product feeds does not scale.

The outcomeA list of ProductCategory objects ready to update your inventory system.

What you need first

  • Python with pip; install with `pip install outlines`
  • A model backend, such as a Hugging Face transformers model, as in the README quickstart
  • Pydantic for typed schemas

Steps

  1. Install the library with pip install outlines
  2. Connect a model with Outlines.from_transformers as in the quickstart
  3. Define ProductCategory with main_category, sub_category, attributes and an optional brand_match
  4. Build an Outlines.Template and call the model on the whole list of prompts, then validate each result with model_validate_json

Prompt for your agent

With dottxt-ai/outlines, categorize every row of <my product CSV> using a ProductCategory schema and outlines.Template, and write the results to a new CSV.

Caveat. Structure is guaranteed, but the category values themselves can still be wrong, so spot check a sample.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for dottxt-ai/outlines and "Categorize product descriptions in batches"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer