implement chatboot using python part 3 (final part)

برمجة بايثون | Python programming 

  • 2024-02-25

 

قم بتطبيق  شات بوت بلغة بايثون لتحديد درجة المشكلة والسلوك المناسب لها بناء على نوع التعليم ( العام او عبر الانترنت) 

 التوصيف باللغة العربية

المشروع هو تطبيق برمجي يستخدم لإدارة السلوكيات غير المناسبة في التعليم العام والتعليم عبر الإنترنت. يتيح التطبيق واجهة رسومية للمستخدم

تفاعلية تسمح للمستخدم بتحديد نوع التعليم (العام أو عبر الإنترنت) والتفاعل مع الشات بوت للحصول على إجابات عن استفساراتهم ومشاكلهم المتعلقة بالسلوكيات غير المناسبة.

التطبيق يتكون من عدة أقسام:

1. القسم الرئيسي:

   - يقوم بإعداد النافذة الرئيسية للتطبيق باستخدام مكتبة Tkinter.

   - يوفر أزرار اختيار بين التعليم العام والتعليم عبر الإنترنت.

   - عند اختيار المستخدم لأحد الخيارات والنقر على زر البدء، يتم فتح واجهة الشات بوت المناسبة.

2. شات بوت التعليم العام:

   - يعرض واجهة رسومية تفاعلية للمستخدم تسمح بإجراء محادثات حول المشاكل المتعلقة بالسلوكيات غير المناسبة في التعليم العام.

   - يقرأ البيانات المتعلقة بالمشاكل من ملف CSV ويقوم بتحليل استفسارات المستخدم لتوفير الردود المناسبة.

3. شات بوت التعليم عبر الإنترنت:

   - يعمل بنفس الطريقة كشات بوت التعليم العام ولكن يتعامل مع المشاكل المتعلقة بالتعليم عبر الإنترنت.

4. وظائف مشتركة:

   - تتضمن وظائف لإدارة تفاعلات المستخدم، مثل إضافة الأسئلة، بدء المحادثة، الحصول على الإجابات، تنظيف منطقة الشات، وعرض رسائل المساعدة.

5. معالجة الملفات (CSV):

   - يقرأ كل من شات بوتي التعليم العام والتعليم عبر الإنترنت بيانات المشاكل من ملفات CSV تحتوي على وصف المشكلات والردود المتعلقة مصنفة حسب الخطورة.

6. تخصيص واجهة المستخدم:

   - تم تخصيص عناصر واجهة المستخدم بألوان وخطوط وتخطيطات مناسبة لتعزيز تجربة المستخدم.

7. إدارة النوافذ:

   - تضمن وظائف إدارة النوافذ معالجة سليمة لأحداث إغلاق النوافذ، مما يتيح للمستخدم التنقل إلى القائمة الرئيسية أو إغلاق التطبيق بشكل سلس.

English Description

This Python code consists of a GUI application built using the Tkinter library for creating a chatbot interface to address behavioral violations in public education and online teaching.

 

1. **Main Section (Main Function):**

   - This section initializes the main GUI window using Tkinter.

   - It provides radio buttons for selecting between public education and online teaching.

   - When the user selects an option and clicks the start button, it launches the respective chatbot interface.

 

2. **Public Education Chatbot:**

   - The `PublicEducationWindow` class defines the GUI for the chatbot interface related to behavioral violations in public education.

   - It creates a separate window (`Toplevel` widget) for the chat interface.

   - The chat interface consists of a scrolled text widget to display conversation history, an entry widget to input questions, and buttons for sending questions and clearing the chat.

   - It reads problem data from a CSV file and processes user queries to provide appropriate responses based on the selected problem and severity.

 

3. **Online Teaching Chatbot:**

   - Similar to the public education chatbot, the `OnlineTeachingWindow` class defines the GUI for handling behavioral violations in online teaching.

   - It provides a separate chat window with similar functionalities to the public education chatbot.

   - The chatbot reads problem data from a CSV file and responds to user queries accordingly.

 

4. **Common Functions:**

   - Both chatbot classes include functions for handling user interactions, such as adding questions, starting the chat, getting answers to questions, clearing the chat area, displaying help messages, and managing window closing events.

 

5. **File Handling (CSV):**

   - Both chatbots read problem data from CSV files (`publicEducation.csv` and `onlineTeaching.csv`). These CSV files likely contain problem descriptions and corresponding responses categorized by severity.

 

6. **GUI Customization:**

   - The GUI elements are customized with appropriate colors, fonts, and layouts to enhance user experience.

   - Buttons for navigation, help, and interaction are provided with Arabic text and appropriate styling.

 

7. **Window Management:**

   - Window management functions ensure proper handling of window close events, allowing users to navigate back to the main menu or close the application gracefully.

 

code link:

 

https://drive.google.com/drive/folders/1SOnsUsjvTH-3VxZ4ZpouXdfWE8AFSXi7?usp=sharing

هل كان الشرح مفيد؟

avatar
Hesham Mohammed

  • عن بعد/اونلاين
  • شروحات مشابهة

    • برمجة بايثون | Python programming
    • برمجة | Programming
    • برمجة سي شارب | c# programming
    • برمجة جافا | Java programming
    • برمجة بي اتش بي | Php programming
    • برمجة html | Html programming
    • برمجة سي اس اس | Css programming
    محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
    ماهو التخصص الذي تبحث عنه؟
    اكتب هنا...