This workshop aims to teach participants Python coding and its fundamentals, using Python programming language. Which includes Python External Libraries for AI and Machine Learning, how to, install them, access their documentation for better understanding, check their functions and how/where to use them. In addition participants will have an “Open-Eye” on many different aspects of Python coding, and most of the area where Python excels.
Projector/Screen, Laptop, Internet Access
Lesson Materials:
This session depends a lot on discussion and student input and work.
A quick introduction about us and a way to break the Ice with the participant in order to engage with them in indirect way just to make a conversation and then a question to start the session.
Introduction & Icebreaking
Introduce yourself and Studio5.
Ask about AI (Ice breaking).
Introduction to AI in Python
What is AI?
Artificial Intelligence (AI) is the ability of computer systems to perform tasks that usually require human intelligence, such as learning, problem-solving, understanding language, and making decisions, by processing data and recognizing patterns to adapt and improve performance without constant human intervention
ما هو الذكاء الاصطناعي؟
الذكاء الاصطناعي هو قدرة أنظمة الحاسوب على أداء مهام تتطلب عادةً ذكاءً بشريًا، مثل التعلم وحل المشكلات وفهم اللغة واتخاذ القرارات، وذلك من خلال معالجة البيانات والتعرف على الأنماط للتكيف وتحسين الأداء دون تدخل بشري مستمر.
Key aspects of AI:
الجوانب الرئيسية للذكاء الاصطناعي:
Introduction to Modern AI in Python
What is Modern AI?
Modern AI refers to advanced computer systems, powered largely by Machine Learning (ML) and Deep Learning, that simulate human intelligence to learn from vast data, recognize patterns, solve problems, and perform tasks like understanding language (NLP), seeing (Computer Vision), and generating new content (Generative AI)
ما هو الذكاء الاصطناعي الحديث؟
يشير الذكاء الاصطناعي الحديث إلى أنظمة الكمبيوتر المتقدمة، التي تعمل بشكل كبير بواسطة التعلم الآلي والتعلم العميق، والتي تحاكي الذكاء البشري للتعلم من البيانات الضخمة، والتعرف على الأنماط، وحل المشكلات، وأداء مهام مثل فهم اللغة (معالجة اللغة الطبيعية)، والرؤية (رؤية الكمبيوتر)، وإنشاء محتوى جديد (الذكاء الاصطناعي التوليدي).
Key Aspects of Modern AI:
أهم جوانب الذكاء الاصطناعي الحديث:
Step 1: Get Libraries and Lexicons
Step 2: User Data Process
Step 3: Display Results
الخطوة 1: احصل على المكتبات والمعاجم
الخطوة 2: معالجة بيانات المستخدم
الخطوة 3: عرض النتائج
NLTK Lexicon Download/Use – Python
تنزيل/استخدام معجم NLTK – بايثون
تثبيت المكتبات المطلوبة
Install the Required Libraries
استيراد المكتبات المطلوبة
Import the Required Libraries
تحميل ملف المعجم
Download the Lexicon File
استخدم وظائف محددة من ملف المعجم
Use Specific Functions and Functionalities from the Lexicon File
#install libraries
!pip install nltk scikit-learn
import nltk
nltk.download(‘vader_lexicon’)
from nltk.sentiment import SentimentIntensityAnalyzer
What is NLTK
The Natural Language Toolkit (NLTK) is a widely used, free, and open-source Python library for Natural Language Processing (NLP).
It provides a comprehensive suite of libraries, programs, and data sets for tasks such as text analysis, classification, tokenization, stemming, and tagging.
مجموعة أدوات اللغة الطبيعية (NLTK) هي مكتبة Python مجانية ومفتوحة المصدر ومستخدمة على نطاق واسع لمعالجة اللغات الطبيعية (NLP).
يوفر مجموعة شاملة من المكتبات والبرامج ومجموعات البيانات لمهام مثل تحليل النص والتصنيف والترميز والقطع ووضع العلامات.
NLTK Module Index
www.nltk.org/py-modindex.html
NLTK Module Index shows you the list of Functionalities and SUb-Functionalities of NLTK
يعرض لك فهرس وحدات NLTK قائمة الوظائف والوظائف الفرعية لـ NLTK
Nltk.sentiment.sentiment_analyzer
Is the one we need and will be using
Nltk.sentiment.sentiment_analyzer
هو ما نحتاجه وسنستخدمه
Now, this code makes sense!
#install libraries
!pip install nltk scikit-learn
import nltk
nltk.download(‘vader_lexicon’)
from nltk.sentiment import SentimentIntensityAnalyzer
# Initialize the SentimentIntensityAnalyzer
sia = SentimentIntensityAnalyzer()
# Define a sentence for analysis
sentence = “I absolutely love learning AI with Python!”
Initialize the Analyzer
Create a New Object named “SIA” to use Functions and Sub-Functions of the Analyzer
Create a variable that holds the text we will be analyzing
تهيئة المحلل
أنشئ كائنًا جديدًا باسم “SIA” لاستخدام وظائف ووظائف فرعية للمحلل
أنشئ متغيرًا يحتوي على النص الذي سنقوم بتحليله.
# Get the sentiment polarity scores
scores = sia.polarity_scores(sentence)
# Print the results
print(f”Sentence: {sentence}“)
print(f”Sentiment Scores: {scores}“)
Store the List of Scores in a variable named “scores”
قم بتخزين قائمة الدرجات في متغير باسم “scores”.
Using “SIA” object created before, we will call the “polarity_scores()” function, giving it the Sentence we wrote, to get the Sentiment Score
باستخدام كائن “SIA” الذي تم إنشاؤه مسبقًا، سنستدعي الدالة “polarity_scores()”، ونمرر لها الجملة التي كتبناها، للحصول على درجة المشاعر.
Sentiment Scores: {‘neg’: 0.0, ‘neu’: 0.295, ‘pos’: 0.705, ‘compound’: 0.6989}
Sentiment Scores: {‘neg’: 0.0, ‘neu’: 1.0, ‘pos’: 0.0, ‘compound’: 0.0}
Sentiment Scores: {‘neg’: 0.682, ‘neu’: 0.318, ‘pos’: 0.0, ‘compound’: -0.6468}
Score is divided into 4 parts:
We can take any of those values and do our further research and analysis.
In our case, we will take the COMPOUND value as an OVERALL result.
تنقسم النتيجة إلى 4 أجزاء
سلبي
محايد
إيجابي
مركب
يمكننا اختيار أيٍّ من هذه القيم وإجراء المزيد من البحث والتحليل
في حالتنا، سنعتمد القيمة المركبة كنتيجة إجمالية
# Determine if the sentiment is positive, negative, or neutral
if scores[‘compound’] >= 0.05:
print(“Overall Sentiment: Positive”)
elif scores[‘compound’] <= –0.05:
print(“Overall Sentiment: Negative”)
else:
print(“Overall Sentiment: Neutral”)
This is where you can do whatever you want to do, according to business rules
هنا يمكنك أن تفعل ما تشاء، وفقًا لقواعد العمل.

All in All – Python
القراءة، المعالجة، الكتابة – بايثون
!pip install nltk scikit-learn
import nltk
nltk.download(‘vader_lexicon’)
from nltk.sentiment import SentimentIntensityAnalyzer
sia = SentimentIntensityAnalyzer()
sentence = “I absolutely love Running!”
scores = sia.polarity_scores(sentence)
print(scores)
if scores[‘compound’] >= 0.05:
print(“Overall Sentiment: Positive”)
elif scores[‘compound’] <= –0.05:
print(“Overall Sentiment: Negative”)
else:
print(“Overall Sentiment: Neutral”)
Having trouble? Let us know by completing the form below. We'll do our best to get your issues resolved quickly.
"*" indicates required fields