HiLucyHelp Center

AI extraction — turn a menu PDF into orderable items

HiLucy Team·تم التحديث 2026-04-26·4 min read

Typing 40 menu items into the Menu Manager is the kind of thing nobody enjoys. The Extract panel does it for you in about 30 seconds: drop a PDF or a photo of the menu, and a vision model returns structured items you can review and publish.

What's supported

  • File types: PNG, JPG, WEBP, or PDF
  • Size limit: 12 MB
  • Languages: English and Spanish work cleanly today; other Latin scripts work too. Right-to-left languages are best-effort for v1.

The PDF path uses GPT-4o-mini's native PDF support — no OCR step, no separate Files API hop. Photos go through the same vision pipeline.

Walkthrough

  1. Pick the listing at the top of the Menu Manager.
  2. In the Extract from PDF or photo card, click Choose File and select your menu.
  3. Click Extract items. The button changes to "Extracting…" and typically settles in 20–40 seconds depending on menu length.
  4. A review table appears below with every detected item, pre-selected for publishing.

Each row is editable inline before you publish:

  • Name — what the model read from the menu
  • Description — the ingredient line if there was one
  • Price (USD) — see the currency conversion rule below
  • Category — the model's best guess (you can override)
  • Prep min — best-effort estimate, set to 0 if the model wasn't sure
  • Confidence pillAI 95% (green) or AI 60% (red)

Uncheck rows you don't want to publish, edit anything that's off, then click Publish N items. The dashboard publishes them in chunks of 3 behind the scenes (more on that below) and the menu items list fills in as each chunk lands.

Confidence — what to double-check

Confidence is reported per item. The signal is rough but useful:

  • 0.95+ (green) — name and price both crisp on the page. Almost always safe to publish without edits.
  • 0.80–0.94 (green) — minor ambiguity. Spot-check the price.
  • Below 0.80 (red) — the model wasn't sure. The price was probably smudged, the item was in a corner, or the menu had two prices (e.g., glass / bottle) and the model picked one. Read these carefully.

A pragmatic workflow: publish the high-confidence batch first, then fix and publish the low-confidence rows separately.

MXN and other currencies

If your menu is in Mexican pesos, the extractor knows: prices are auto-converted to USD using the current rate (17.5 MXN ≈ 1 USD as of this writing — overridable via the hilucy_mxn_usd_rate filter). When you see a $7.43 from a 130 MXN item, that's why.

For any other currency, prices come through as-is. The Menu Manager stores price_cents in USD, so plan to edit non-MXN, non-USD prices yourself before publishing.

Why publishes happen in chunks

Each WC product save fires a long chain of WordPress + WooCommerce hooks (term taxonomy, search index, vendor data sync, etc.). Each item takes ~5–15 seconds end-to-end. Publishing 35 items in a single HTTP request would exceed Cloudflare's 100-second edge timeout, so the dashboard splits the batch into requests of 3 items each and shows you "Publishing 18 / 34…" as it works through them. Don't close the browser tab while it's running — the in-flight chunk continues but later chunks won't fire.

What the model is told to do

In case you're curious, the system prompt asks the model to:

  • Skip section headers and descriptive text — only return orderable items.
  • Split items with multiple prices (e.g. "Mojito — glass $6 / pitcher $20") into two rows distinguished by a name suffix.
  • Lower confidence when the price is missing, illegible, or the category was a guess.
  • Return categories from a fixed list: breakfast, appetizer, main, dessert, beverage, snack, general.

When extraction fails

If the request returns "AI extraction is not configured", the OPENAI_API_KEY constant or the hilucy_openai_api_key option isn't set on this environment. Set one (define('OPENAI_API_KEY', '...') in wp-config.php is the canonical pattern) and try again.

If extraction returns 0 items, the file probably wasn't a menu — double-check it's the right PDF before re-running.

For a stuck publish (you saw "signal aborted" or HTTP 524), reload the page; partially-published items remain in the menu list. Re-extract and uncheck the items already there, then publish the rest.

هل كان هذا المقال مفيداً؟