OCR ذكي مجاني — عربي، إنجليزي، مختلط
اضغط لرفع صورة أو اسحبها هنا
PNG · JPG · JPEG · WEBP
قبل أول استخدام، يجب إنشاء الجدول في Supabase مرة واحدة فقط.
انسخ الـ SQL أدناه وشغّله في SQL Editor في مشروعك.
-- ─── إنشاء جدول نتائج OCR ───────────────────────────────────────────
create table if not exists ocr_results (
id bigserial primary key,
created_at timestamptz not null default now(),
agent_type text not null default 'general',
agent_label text not null default 'عام',
language text not null default 'Unknown',
confidence smallint not null default 0 check (confidence between 0 and 100),
raw_text text not null default '',
cleaned_text text not null default '',
-- يقبل حقولاً تفصيلية أو {"note":"النص"} كـ fallback — لا يكون فارغاً أبداً
domain_fields jsonb not null default '{}',
model_used text
);
-- ─── فهرسة للبحث السريع ─────────────────────────────────────────────
create index if not exists idx_ocr_agent_type on ocr_results (agent_type);
create index if not exists idx_ocr_created_at on ocr_results (created_at desc);
create index if not exists idx_ocr_domain_fields on ocr_results using gin (domain_fields);
create index if not exists idx_ocr_cleaned_text on ocr_results using gin (to_tsvector('simple', cleaned_text));
-- ─── Row Level Security ──────────────────────────────────────────────
alter table ocr_results enable row level security;
create policy "allow_all" on ocr_results for all using (true) with check (true);