تصوير الكيانات باستخدام displaCy
اعرض إبرازات الكيانات داخل النص
تصوير الكيانات باستخدام displaCy درس مجاني في NLP Academy على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في NLP Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة NLP Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
See, Don't Just Print
Reading raw tuples gets tiring fast. displaCy paints entities right onto your sentence with colored highlights. 🎨
It Comes Built In
displaCy ships inside spaCy, so there is nothing extra to install. Import it straight from the spacy package.
from spacy import displacyThe ent Style
displaCy has two modes. For named entities you pick style="ent", which boxes and labels each detected span.
Render in a Notebook
Inside Jupyter, call displacy.render to draw the highlighted text right below your cell, no browser needed.
displacy.render(doc, style="ent")Serve in a Browser
Outside a notebook, displacy.serve starts a tiny local web server so you can view the visualization in your browser.
displacy.serve(doc, style="ent")Get the Raw HTML
Need to embed the result in a report? Pass jupyter=False to get back an HTML string you can save or paste.
html = displacy.render(doc, style="ent", jupyter=False)Color by Label
Each entity type gets its own color, so PERSON, ORG, and DATE stand apart at a glance. Color makes patterns obvious.
Customize the Palette
Pass an options dict to recolor labels or limit which types show. Great for branded or focused visualizations.
options = {"colors": {"ORG": "#1565C0"}}Filter the Types
Only care about people? The options dict accepts an ents list so displaCy renders just those labels and hides the rest.
options = {"ents": ["PERSON", "GPE"]}Visualize Many Docs
Pass a list of Docs to render them all at once, perfect for eyeballing entities across a whole batch of sentences.
displacy.render([doc1, doc2], style="ent")A Debugging Superpower
Visualizing entities quickly reveals what the model missed or mislabeled, far faster than scrolling through printed output. 🔍
Quick Check
Which style draws named-entity highlights?
Recap
displaCy with style="ent" highlights entities by color. Render in notebooks, serve in browsers, and tweak with options. ✅
الأسئلة الشائعة
هل درس «تصوير الكيانات باستخدام displaCy» مجاني؟
نعم — نص درس «تصوير الكيانات باستخدام displaCy» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة NLP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة NLP Academy 4 دروس في المجموع.
ماذا ستتعلم في «تصوير الكيانات باستخدام displaCy»؟
اعرض إبرازات الكيانات داخل النص تتمرن على NLP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ NLP Academy؟
لا تُشترط خبرة سابقة. NLP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.
كم من الوقت يستغرق درس «تصوير الكيانات باستخدام displaCy»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس NLP Academy هذا؟
نعم. كل درس في NLP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- ما الذي يُعد كيانًا؟
- استخراج الكيانات باستخدام spaCy
- تصوير الكيانات باستخدام displaCy
- إضافة قواعد مخصّصة للكيانات