𝐈𝐧𝐟𝐢𝐧𝐢𝐭𝐲 𝐂𝐒
Photo
Natural Language Processing (NLP)
Natural Language Processing is a field of Artificial Intelligence (AI). It allows computers to understand, interpret, and generate human language. NLP combines computer science, linguistics, and machine learning. It helps machines work with text, speech, and other forms of natural language. NLP is a technology. It enables computers to read, understand, and respond to human language. For example, when you use a voice assistant like Siri or Google Assistant, NLP works behind the scenes. It processes your words and gives a meaningful response.
• Text translation (e.g., Google Translate)
• Speech recognition (e.g., voice typing)
• Sentiment analysis (e.g., detecting feelings in reviews)
• Chatbots and virtual assistants
• Text preprocessing
• Tokenization
• Part-of-Speech (POS) tagging
• Named Entity Recognition (NER)
• Parsing
• Semantic Analysis
• Bag of Words (BoW)
• Word Embeddings
• Deep Learning Models
• Machine Translation
• Speech Recognition
• Sentiment Analysis
• Text Summarization
#NLP #NaturalLanguageProcessing #AI #MachineLearning #DeepLearning #LanguageAI #NLPBasics #AIEducation #TechLearning #ArtificialIntelligence #MLCommunity #NLPApplications #FutureOfAI #TextProcessing #InfinityAI
✍️ @TheInfinityAI
Natural Language Processing is a field of Artificial Intelligence (AI). It allows computers to understand, interpret, and generate human language. NLP combines computer science, linguistics, and machine learning. It helps machines work with text, speech, and other forms of natural language. NLP is a technology. It enables computers to read, understand, and respond to human language. For example, when you use a voice assistant like Siri or Google Assistant, NLP works behind the scenes. It processes your words and gives a meaningful response.
Importance of NLP
• Text translation (e.g., Google Translate)
• Speech recognition (e.g., voice typing)
• Sentiment analysis (e.g., detecting feelings in reviews)
• Chatbots and virtual assistants
How NLP Works
• Text preprocessing
• Tokenization
• Part-of-Speech (POS) tagging
• Named Entity Recognition (NER)
• Parsing
• Semantic Analysis
NLP Techniques
• Bag of Words (BoW)
• Word Embeddings
• Deep Learning Models
Applications of NLP
• Machine Translation
• Speech Recognition
• Sentiment Analysis
• Text Summarization
#NLP #NaturalLanguageProcessing #AI #MachineLearning #DeepLearning #LanguageAI #NLPBasics #AIEducation #TechLearning #ArtificialIntelligence #MLCommunity #NLPApplications #FutureOfAI #TextProcessing #InfinityAI
✍️ @TheInfinityAI
🔥2❤🔥1⚡1❤1🎉1
𝐈𝐧𝐟𝐢𝐧𝐢𝐭𝐲 𝐂𝐒
Photo
1) Large Language Model එකක්, එහෙමත් නැත්තන් LLM කියන්නෙ මොකද්ද?
Large Language Model එකක් කියන්නෙ මිනිස් භාෂාව predict කරන්න සහ generate කරන්න පුහුණු කරන machine learning model එකකට. යම් text එකක් අපි input එකක් විදියට ලබා දීලා තියෙන වෙලාවට LLM එකකට පුලුවන් එයා පුහුණුව අතරතුර ඉගෙන ගත්ත දේවල් මත පදනම් වෙලා ඊළඟ වචනය හෝ ඊලග character එක (මේකට අපි Computer science වලදී කියන්නෙ Token එකක් කියලා ) අනුමාන කරන්න. එතකොට ඇයි අපි මේකට Large Language Model එකක් කියලා කියන්නේ, අපිට පුලුවන්නෙ නිකන්ම Language Model එකක් කියලා අර්ථ දක්වන්න? 😂 LLM එයාගේ training process එක සම්පූර්න කරන්නෙ එකිනෙකට වෙනස් patterns, characters, emotions වගේ දේවල් තියෙන data set එකක් එක්ක වගේම parameters මිලියන ගණනක් හෝ බිලියන ගණනක් පදනම් කරගෙන. මේ හින්දා LLM එකකට පුළුල් භාෂා රටා, කරුණු සහ තර්ක කිරීමේ හැකියාව ලැබෙනවා
2) The building blocks of LLM ( LLM වල තැනුම් ඒකක )
Token - ටෝකන් එකක් ( it can be වචනක්, උප වචනක් හෝ අක්ෂරක් ).
Embedding - Token එකක් සංඛ්යාත්මක අගයකට පරිවර්තනය කිරීම (මොකද මිනිස්සුන්ට වගේ වචන හසුරවන්න computer program එකකට බෑ, ඒවා එයාට තේරුම් ගන්න පුලුවන් විදියෙ සංඛ්යා බවට පරිවර්තනය කරනවා).
Transformer - බොහෝ නවීන LLM විසින් භාවිතා කරන ආකෘති ගෘහ නිර්මාණ ශිල්පය ( model architecture ) තමා මේක.
Attention - ඊළඟ token එක අනුමාන කරද්දි මොන token එකද වැදගත් කියලා බලන්න ඉඩ සලසන යාන්ත්රණය. ( weight check).
Context window - LLM එකකට එකවර බලාගන්න පුලුවන් token ගණන.
Pretraining - data set එකක් මත පදනම් වෙලා සාමාන්ය භාෂා රටා පිලිබදව ඉගන ගන්න එක.
Fine-tuning - නිශ්චිත කාර්යයක් හෝ ශෛලියක් සඳහා ආකෘතිය සකස් කිරීම.
3) LLM එකක් text processes කරන ආකාරය
Input text → Tokenization 🔜අපි දෙන text එක පොඩි පොඩි කෑලි වලට බෙදනවා ( Example: “I love cats” → ["I", " love", " cats"] )
Tokens → Embeddings 🔜ඒ හැම token එකක්ම සංඛ්යාත්මක අගයකට convert කරනවා
Add positional information 🔜Transformer වලට Recurrence එකක් නෑ. මේක තේරුම් ගන්න කලින් තව පොඩි දෙයක් දැනගෙන ඉන්න වෙනවා. Recurrence කියන්නේ මොනවාද? සාම්ප්රදායික RNNs (Recurrent Neural Networks) වල token process කරද්දී පෙර වචන වල තොරතුරු මතම ඒක update වෙනවා. මේක “memory” එකක් වගේ. අතීතය මත පදනම්ව වෙලා අනාගත output නිර්මාණය කරන ක්රමයක්. Transformers වල recurrence නැහැ. ඒ කියන්නේ ඒකට RNN වගේ අතීත state එකක් sequentially maintain කරන්න අවශ්ය නැහැ කියන එක, එකවර සියලු tokens එකම layer එකට feed කරනවා.
Transformer layers with attention 🔜 Transformer architecture එකක layers ගොඩක් තියෙනවා. Attention mechanism එක මඟින් එක එක token එක වෙනත් tokens එක්ක direct connection හදනවා. මේ නිසා long-range dependencies පහසුවෙන් handle කරලා, parallel processing කරන්න පුළුවන්.
Output layer → Probability distribution 🔜 LLM එක ඊලග token එක සඳහා සම්භාවිතාව ගණනය කරනවා. ඉහළම සම්භාවිතාව සහිත token එක තෝරාගෙන විකල්ප වශයෙන් ඊළඟ පුරෝකථන පියවර සඳහා ආදානයට එකතු කරනවා
Decoding 🔜 Probability distribution එක ස්වාභාවික ප්රතිදානයක් බවට පත් කරන්න ගොඩක් ක්රම පාවිච්චි කරනවා. ( greedy, beam search, sampling ). කලින් ස්ටෙප් එකේදි කියන්න බැරි උනා, Probability distribution කියන්නේ Statistic පාඩමක්. මේකෙදී කරන්නේ ඉස්සරහට වෙන්න තියෙන random event එකක හැම අවස්ථාවකටම probability එකක් assign කරන එක. උදාහරණයක් විදියට, දාදු කැටයක් උඩ දැම්මාම අපිට එන්න පුලුවන් අවස්ථා ගනන 6ක්. [ P(X) = {1, 2, 3, 4, 5, 6} ]. LLM එකක මේ අවස්ථා ගනන මිලියන ගානක්. තවත් සරල කරන්නම්, ඔයා ලොකු පොතක් කියවනවා, ඒ පොත පුරාවටම "he" කියන වචනෙට පස්සේ "is" කියන වචනේ සෑහෙන වතාවක් රිපීට් වෙලා තියෙනවා. LLM එකක් predict කරන්න පාවිච්චි කරන්නේ මෙන්න මේ concept එක.
4) Key idea: how attention gives contextual understanding
ඔයා වාක්යයක් කියවද්දී තේරුම් ගන්න උත්සාහ කරන දේ අනුව ස්වභාවිකවම විවිධ වචන වලට අවධානය යොමු කරනවා. attention කියලා අපි මේකෙදි කියන්නේ Text එකක වැදගත් කොටස් දෙස බලන්න LLM එක පාවිච්චි කරන ක්රමයට.
Mechanics (high level) ⤵️
එක් එක් Token එක සඳහා LLM එක අනික් Token එක්ක තියෙන attention එක මනිනවා (weights determine)
මෙම weight එක මගින් Token එකක නිරුපනය යාවත්කාලීන කිරීමේදී අනෙකුත් ටෝකනවලට කොපමණ බලපෑමක් ඇති කරයිද කියන එක තීරණය කරනවා.
අන්තිමෙදි, Token එකක නිරූපණය context-aware summary එකක් බවට පත්වෙනවා. 📩
❤2
Result - Token දෙකක් දුරින් තිබුණත් attention Mechanism එකට ඒවා සෘජුවම එකිනෙක සම්බන්ධ කරන්න පුලුවන්. නිසා Transformer architecture එක long-range dependencies හොඳින් හසුරුවනවා. මේක තමා කලින් Transformer layers with attention එකේදී පැහැදිලි කරේ.
Pretraining objective ⛈ - ප්රධානවම Tokenization & Next word prediction. LLM එක බිලියන ගණනක් Text කියවලා ඒවා අතර තියෙන statistical pattern ඉගෙන ගන්නවා.
Why it seems like “understanding” 🧠 - LLM එක දත්ත අතර ඇති සහසම්බන්ධතා (correlations) ඉගෙන ගන්නවා ( වාක්ය ඛණ්ඩ, කරුණු, තර්කන රටා වගේ හැම දෙයක්ම). ඊට පස්සේ මේ ඉගන ගත්ත රටා පුහුණු දත්තවල පුනරාවර්තනය වෙනවා. (knowledge reasoning)
Limitations of that understanding ⏱️ - මේ statistical pattern හඳුනාගැනීම සවිඥානික හෝ පදනම් වූ තර්කනයක් වෙන්නේ නෑ. මේක නිසා මේවත් එක්ක ගනුදෙනු කරද්දි නිවැරදිව සන්නිවේදනය නොකරද්දී අපිට ව්යාජ හෝ විකාර තොරතුරු ලැබෙනවා. IT terminology වලින් කියනවා නම්, අපි ඒකට කියන්නේ “hallucination” කියලා. 😅 "Give respect, get respect." වගේ තමයි.
Example for LLMs - OpenAI ChatGPT, Google Gemini, Anthropic Claude, Meta LLaMA (Large Language Model Meta AI), Google T5.
#LLM #LargeLanguageModels #AIExplained #NLP #DeepLearning #MachineLearning #Transformers #NeuralNetworks #AICommunity #TechEducation #ArtificialIntelligence #MLBasics #LanguageModels #FutureOfAI #InfinityAI
✍️ @TheInfinityAI
5) Training & Understanding: where “understanding” comes from
Pretraining objective ⛈ - ප්රධානවම Tokenization & Next word prediction. LLM එක බිලියන ගණනක් Text කියවලා ඒවා අතර තියෙන statistical pattern ඉගෙන ගන්නවා.
Why it seems like “understanding” 🧠 - LLM එක දත්ත අතර ඇති සහසම්බන්ධතා (correlations) ඉගෙන ගන්නවා ( වාක්ය ඛණ්ඩ, කරුණු, තර්කන රටා වගේ හැම දෙයක්ම). ඊට පස්සේ මේ ඉගන ගත්ත රටා පුහුණු දත්තවල පුනරාවර්තනය වෙනවා. (knowledge reasoning)
Limitations of that understanding ⏱️ - මේ statistical pattern හඳුනාගැනීම සවිඥානික හෝ පදනම් වූ තර්කනයක් වෙන්නේ නෑ. මේක නිසා මේවත් එක්ක ගනුදෙනු කරද්දි නිවැරදිව සන්නිවේදනය නොකරද්දී අපිට ව්යාජ හෝ විකාර තොරතුරු ලැබෙනවා. IT terminology වලින් කියනවා නම්, අපි ඒකට කියන්නේ “hallucination” කියලා. 😅 "Give respect, get respect." වගේ තමයි.
Example for LLMs - OpenAI ChatGPT, Google Gemini, Anthropic Claude, Meta LLaMA (Large Language Model Meta AI), Google T5.
#LLM #LargeLanguageModels #AIExplained #NLP #DeepLearning #MachineLearning #Transformers #NeuralNetworks #AICommunity #TechEducation #ArtificialIntelligence #MLBasics #LanguageModels #FutureOfAI #InfinityAI
✍️ @TheInfinityAI
❤5❤🔥1🔥1🎉1😍1
𝐈𝐧𝐟𝐢𝐧𝐢𝐭𝐲 𝐂𝐒
Photo
අපි AI සහ data ගැන කතා කරද්දි, ගොඩක් වෙලාවට අපේ ඔළුවට එන්නේ tables, text, images වගේ දේවල් නේද? හැබැයි ඇත්තටම ලෝකේ තියෙන ගොඩක් වටින information තියෙන්නේ data points අතර තියෙන සම්බන්ධතා (relationships) වල ex විදියට ගත්තොත් Social networks, meterial science and chemistry, scientific research වගේ දේවල් තනිකරම relationships මත තමයි දුවන්න ඉතින් මේ වගේ සම්බන්ධතා මත පදනම් වූ data තේරුම් ගන්න අපිට Graphs කියන concept එක නැතුවම බැරි දෙයක් වෙලා තියෙනවා ඉතින් අපි අද කතාකරන්නේ.
ඉතින් ඇයි අපිට Graphs අවශ්ය වෙන්නේ? මේක තේරුම් ගන්න, අපි මුලින්ම data වර්ග දෙකක් ගැන කතා කරලා ඉන්න ඔනී ඒ තමයි "Euclidean data" සහ "Non-Euclidean data" අද අපි use කරන ගොඩක් traditional machine learning models හදලා තියෙන්නේ Euclidean data වලට. මේ කියන්නේ grid එකක් වගේ, පිළිවෙලකට හදන්න පුළුවන් data ගැන. උදාහරණයක් විදිහට image එකක් ගන්න Image එකක pixels ටික පිළිවෙලකට grid එකක නේද තියෙන්නේ ඒ හැම pixel එකකටම නියමිත අසල්වැසියන් ගාණක් ඉන්නවා ඉතින් මේ වගේ data flat space එකක tensors විදිහට represent කරන්න හරිම ලේසියි. හැබැයි social network එකක් වගේ දෙයක් ගැන හිතන්න එතන ඉන්න user කෙනෙක්ට නියමිත friendsලා ගාණක් නැහැ, සමහරුන්ට දහස් ගාණක් ඉන්නවා, සමහරුන්ට කිහිප දෙනයි. ඒ වගේම එතන කිසිම පිළිවෙලක්වත්, coordinate system එකක්වත් නැහැ. මේ වගේ data තමයි අපි Non-Euclidean data කියන්නේ. මේ data වල ඇත්තම වටිනාකම තියෙන්නේ ඒ data points අතර තියෙන connections වල ඉතින් මේ වගේ complex, සම්බන්ධතා මත පදනම් වූ data represent කරන්න තියෙන හොඳම ක්රමය තමයි Graph එකක් use කරන එක. Graph එකක් ගත්තම මූලිකවම තියෙන්නේ කොටස් දෙකයි ඒ කියන්නේ "Nodes" (entities හෝ objects) සහා ඒවා යා කරන "Edges" (relationships).
මේකට හොඳම උදාහරණයක් තමයි "Facebook Graph" එක Facebook එකේ ඔයා, ඔයාගේ friendsලා, ඔයා like කරන posts, join වෙන groups, මේ හැමදේම Nodes විදිහට තමයි represent වෙන්නේ. ඒ අතර තියෙන "friendship" එක, "like" එක, "comment" එක වගේ සම්බන්ධතා Edges වලින් represent වෙනවා. ඉතින් ඇයි Facebook එකට මේ වගේ Graph එකක් ඕන වෙන්නේ? ඒවා use වෙන්නේ ඔයාගේ News Feed එකට එන posts, friend suggestions, ඔයාට පෙන්වන ads වගේ හැමදේම personalize කරන්න. ඔයාගේ connections සහ interests මත පදනම්ව තමයි මේ හැම දෙයක්ම තීරණය වෙන්නේ. මේක real-time වලදී query කරලා, හැම user කෙනෙක්ටම unique experience එකක් දෙන්න facebook එක Facebook Graph එක යොදාගන්න මේ ගැන ඉස්සරහට අපි තව කතා කරමු දැනට මේකෙන් basic idea එක ඔළුවට දාගන්න.
දැන් අපි අද කතාකරන ප්රධාන මාතෘකාවට එමු ඒ තමා "Knowledge Graphs" මේක ගත්ත්ම අර උඩ කතා කරපු සාමාන්ය Graph එකකට වඩා ටිකක් advanced දෙයක්. Knowledge Graph එකක් කියන්නේ real-world එකේ තියෙන entities (උදාහරණයක් විදිහට, මිනිස්සු, ස්ථාන, සිදුවීම්, සංකල්ප) සහ ඒවා අතර තියෙන සම්බන්ධතා structure කරලා තියාගන්නා graph-based knowledge base එකක්. මේකේ විශේෂත්වය තමයි, මේක data points connect කරනවා විතරක් නෙවෙයි, ඒ data වල තේරුම (semantics) පවා තේරුම් ගන්නවා. Google Search එකේදී ඔයා කෙනෙක් ගැන search කරාම පැත්තකින් එන info box එක power වෙන්නේ මේ වගේ Knowledge Graph එකකින්. Knowledge Graph එකක තියෙන ලොකුම power එකක් තමයි, ඒකට විවිධ මූලාශ්ර (multiple sources) වලින් data එකතු කරලා, ඒ අතර සම්බන්ධතා ගොඩනගන්න පුළුවන් වීම. උදාහරණයක් විදිහට, Wikipedia, structured databases, සහ සාමාන්ය web pages වගේ ගොඩක් තැන්වලින් data අරගෙන, ඒ ඔක්කොම එකට integrate කරලා, එක තැනකින් comprehensive view එකක් දෙන්න Knowledge Graph එකකට පුළුවන්. ඊටත් වඩා වැදගත් දේ තමයි, Knowledge Graph එකකට data points අතර විතරක් නෙවෙයි, ඒ data එන sources අතරත් "interconnectivity" එකක්, ඒ කියන්නේ අන්තර් සබඳතාවක් ගොඩනගන්න පුළුවන් වීම. මේ නිසා එකිනෙකට සම්බන්ධයක් නැතිව තිබුණු data sources ගොඩක් එකට link කරලා, කලින් හිතාගන්නවත් බැරිවුණු අලුත් insights සහා knowledge එකක් generate කරන්න මේකට පුළුවන් වෙනවා.
ඉතින් ඇයි අපිට Graphs අවශ්ය වෙන්නේ? මේක තේරුම් ගන්න, අපි මුලින්ම data වර්ග දෙකක් ගැන කතා කරලා ඉන්න ඔනී ඒ තමයි "Euclidean data" සහ "Non-Euclidean data" අද අපි use කරන ගොඩක් traditional machine learning models හදලා තියෙන්නේ Euclidean data වලට. මේ කියන්නේ grid එකක් වගේ, පිළිවෙලකට හදන්න පුළුවන් data ගැන. උදාහරණයක් විදිහට image එකක් ගන්න Image එකක pixels ටික පිළිවෙලකට grid එකක නේද තියෙන්නේ ඒ හැම pixel එකකටම නියමිත අසල්වැසියන් ගාණක් ඉන්නවා ඉතින් මේ වගේ data flat space එකක tensors විදිහට represent කරන්න හරිම ලේසියි. හැබැයි social network එකක් වගේ දෙයක් ගැන හිතන්න එතන ඉන්න user කෙනෙක්ට නියමිත friendsලා ගාණක් නැහැ, සමහරුන්ට දහස් ගාණක් ඉන්නවා, සමහරුන්ට කිහිප දෙනයි. ඒ වගේම එතන කිසිම පිළිවෙලක්වත්, coordinate system එකක්වත් නැහැ. මේ වගේ data තමයි අපි Non-Euclidean data කියන්නේ. මේ data වල ඇත්තම වටිනාකම තියෙන්නේ ඒ data points අතර තියෙන connections වල ඉතින් මේ වගේ complex, සම්බන්ධතා මත පදනම් වූ data represent කරන්න තියෙන හොඳම ක්රමය තමයි Graph එකක් use කරන එක. Graph එකක් ගත්තම මූලිකවම තියෙන්නේ කොටස් දෙකයි ඒ කියන්නේ "Nodes" (entities හෝ objects) සහා ඒවා යා කරන "Edges" (relationships).
මේකට හොඳම උදාහරණයක් තමයි "Facebook Graph" එක Facebook එකේ ඔයා, ඔයාගේ friendsලා, ඔයා like කරන posts, join වෙන groups, මේ හැමදේම Nodes විදිහට තමයි represent වෙන්නේ. ඒ අතර තියෙන "friendship" එක, "like" එක, "comment" එක වගේ සම්බන්ධතා Edges වලින් represent වෙනවා. ඉතින් ඇයි Facebook එකට මේ වගේ Graph එකක් ඕන වෙන්නේ? ඒවා use වෙන්නේ ඔයාගේ News Feed එකට එන posts, friend suggestions, ඔයාට පෙන්වන ads වගේ හැමදේම personalize කරන්න. ඔයාගේ connections සහ interests මත පදනම්ව තමයි මේ හැම දෙයක්ම තීරණය වෙන්නේ. මේක real-time වලදී query කරලා, හැම user කෙනෙක්ටම unique experience එකක් දෙන්න facebook එක Facebook Graph එක යොදාගන්න මේ ගැන ඉස්සරහට අපි තව කතා කරමු දැනට මේකෙන් basic idea එක ඔළුවට දාගන්න.
දැන් අපි අද කතාකරන ප්රධාන මාතෘකාවට එමු ඒ තමා "Knowledge Graphs" මේක ගත්ත්ම අර උඩ කතා කරපු සාමාන්ය Graph එකකට වඩා ටිකක් advanced දෙයක්. Knowledge Graph එකක් කියන්නේ real-world එකේ තියෙන entities (උදාහරණයක් විදිහට, මිනිස්සු, ස්ථාන, සිදුවීම්, සංකල්ප) සහ ඒවා අතර තියෙන සම්බන්ධතා structure කරලා තියාගන්නා graph-based knowledge base එකක්. මේකේ විශේෂත්වය තමයි, මේක data points connect කරනවා විතරක් නෙවෙයි, ඒ data වල තේරුම (semantics) පවා තේරුම් ගන්නවා. Google Search එකේදී ඔයා කෙනෙක් ගැන search කරාම පැත්තකින් එන info box එක power වෙන්නේ මේ වගේ Knowledge Graph එකකින්. Knowledge Graph එකක තියෙන ලොකුම power එකක් තමයි, ඒකට විවිධ මූලාශ්ර (multiple sources) වලින් data එකතු කරලා, ඒ අතර සම්බන්ධතා ගොඩනගන්න පුළුවන් වීම. උදාහරණයක් විදිහට, Wikipedia, structured databases, සහ සාමාන්ය web pages වගේ ගොඩක් තැන්වලින් data අරගෙන, ඒ ඔක්කොම එකට integrate කරලා, එක තැනකින් comprehensive view එකක් දෙන්න Knowledge Graph එකකට පුළුවන්. ඊටත් වඩා වැදගත් දේ තමයි, Knowledge Graph එකකට data points අතර විතරක් නෙවෙයි, ඒ data එන sources අතරත් "interconnectivity" එකක්, ඒ කියන්නේ අන්තර් සබඳතාවක් ගොඩනගන්න පුළුවන් වීම. මේ නිසා එකිනෙකට සම්බන්ධයක් නැතිව තිබුණු data sources ගොඩක් එකට link කරලා, කලින් හිතාගන්නවත් බැරිවුණු අලුත් insights සහා knowledge එකක් generate කරන්න මේකට පුළුවන් වෙනවා.
ඉතින් මේ Knowledge Graphs කියන concept එක අද කාලේ AI වල, විශේෂයෙන්ම "Retrieval-Augmented Generation" හෙවත් "RAG" systems වලදී නැතුවම බැරි දෙයක් වෙලා. RAG කියන්නේ ChatGPT වගේ Large Language Models (LLMs) වලට පිටතින්, up-to-date information දීලා, ඒවා "hallucinate" කරන එක (ඒ කියන්නේ බොරු දේවල් හදලා කියන එක) නවත්තන technique එකක් මේ ගැන අපි දීර්ඝ විදියට කතා කරා ඔයාලට මතක ඇතිනේ ඉතින් මේ සාමාන්ය RAG system එකක් කරන්නේ user ගේ ප්රශ්නයට අදාළව documents වලින් කොටස් (chunks) හොයලා LLM එකට දෙන එක. හැබැයි මේ chunks අතර සම්බන්ධයක් නැහැ. Knowledge Graph එකක් RAG වලට එකතු කරාම, මේ process එක ගොඩක් smart වෙනවා මොකද KG එකෙන් දෙන්නේ නිකම්ම text chunks නෙවෙයි structured කරපු, එකිනෙකට සම්බන්ධ වුණු facts. මේ නිසා LLM එකට ප්රශ්නයට අදාළ context එක සහා entities අතර තියෙන relationships හරියටම තේරුම් ගන්න පුළුවන් වෙනවා. මේක හරියට LLM එකට පොත් ගොඩක් දෙනවා වෙනුවට, හොඳට පිළිවෙලට හදපු විශ්වකෝෂයක් දෙනවා වගේ වැඩක්. මේ නිසා දෙන උත්තර ගොඩක් නිවැරදි වෙනවා, විශ්වාසවන්ත වෙනවා, සහ fact-based වෙනවා.
Knowledge Graph එකකින් කොච්චර complex දෙයක් වුණත් structure කරන්න පුළුවන් කියන එකට, අපි මේ image එකේ තියෙන example එක අරං බලමු. මේකෙ තියෙන්නේ පහුගිය දවස්වල social media එකේ වෙච්ච සිදුවීමක් වටා ගොඩනැගුණු Knowledge Graph එකක් සිද්ධිය දන්නවනේ 🤣. මෙතන "Watawala", "Dilmah", "Lipton" වගේ brands, "Advertisement", "LGBTQ+", "Straight Community" වගේ concepts ඔක්කොම "Nodes" විදිහට represent කරලා තියෙනවා. ඒ අතර තියෙන "supports", "created", "targeted", "triggered" වගේ සම්බන්ධතා "Edges" වලින් පෙන්නනවා. මේ Graph එක හැදිලා තියෙන්නේ social media posts එක එක sources වලින් "scrap" කරලා, ඒ කියන්නේ unstructured data අරගෙන.
ඉතින් මේ Graph එක දිහා බැලුවම අපිට එකපාරින්ම පේනවා "Watawala" brand එක "created" කරපු "Advertisement" එකක් "LGBTQ+" community එක "promotes" කරන අතරේ, "Straight Community" එක "triggered" කරලා තියෙනවා කියලා. ඒ වගේම, මේකට ප්රතිචාර විදිහට "Watawala" එකෙන් "Apology" එකක් නිකුත් කරලා තියෙනවා. මේ වගේ සංකීර්ණ, මතභේදාත්මක මාතෘකාවක් ගැන පැහැදිලි, structured view එකක් AI එකකට දෙන්න Knowledge Graph එකකට පුළුවන් නිකම්ම text එකක් කියවනවාට වඩා, මේ වගේ graph එකක් හරහා AI එකකට සිද්ධියේ සම්පූර්ණ context එක, ඒකට සම්බන්ධ පාර්ශ්ව, සහා ඔවුන් අතර ඇති සම්බන්ධතා හරියටම තේරුම් ගන්න පුළුවන් වෙනවා. මේක තමයි Knowledge Graph එකක ඇත්තම power එක.
#ZuuCrew #Ai
✍️ @Zuu Crew (LinkedIn)
Knowledge Graph එකකින් කොච්චර complex දෙයක් වුණත් structure කරන්න පුළුවන් කියන එකට, අපි මේ image එකේ තියෙන example එක අරං බලමු. මේකෙ තියෙන්නේ පහුගිය දවස්වල social media එකේ වෙච්ච සිදුවීමක් වටා ගොඩනැගුණු Knowledge Graph එකක් සිද්ධිය දන්නවනේ 🤣. මෙතන "Watawala", "Dilmah", "Lipton" වගේ brands, "Advertisement", "LGBTQ+", "Straight Community" වගේ concepts ඔක්කොම "Nodes" විදිහට represent කරලා තියෙනවා. ඒ අතර තියෙන "supports", "created", "targeted", "triggered" වගේ සම්බන්ධතා "Edges" වලින් පෙන්නනවා. මේ Graph එක හැදිලා තියෙන්නේ social media posts එක එක sources වලින් "scrap" කරලා, ඒ කියන්නේ unstructured data අරගෙන.
ඉතින් මේ Graph එක දිහා බැලුවම අපිට එකපාරින්ම පේනවා "Watawala" brand එක "created" කරපු "Advertisement" එකක් "LGBTQ+" community එක "promotes" කරන අතරේ, "Straight Community" එක "triggered" කරලා තියෙනවා කියලා. ඒ වගේම, මේකට ප්රතිචාර විදිහට "Watawala" එකෙන් "Apology" එකක් නිකුත් කරලා තියෙනවා. මේ වගේ සංකීර්ණ, මතභේදාත්මක මාතෘකාවක් ගැන පැහැදිලි, structured view එකක් AI එකකට දෙන්න Knowledge Graph එකකට පුළුවන් නිකම්ම text එකක් කියවනවාට වඩා, මේ වගේ graph එකක් හරහා AI එකකට සිද්ධියේ සම්පූර්ණ context එක, ඒකට සම්බන්ධ පාර්ශ්ව, සහා ඔවුන් අතර ඇති සම්බන්ධතා හරියටම තේරුම් ගන්න පුළුවන් වෙනවා. මේක තමයි Knowledge Graph එකක ඇත්තම power එක.
#ZuuCrew #Ai
✍️ @Zuu Crew (LinkedIn)
❤3🔥1🎉1
📊 Model Evaluation — Image Understanding Leaderboard (2025)
AI models are ranking based on how they interpret and understand images from distribution applications across two key tasks like generating detailed captions and assessing image quality.
OpenAI is still leading the AI landscape. 🚀
#ImageAI #VisionModels #AIEvaluation #ModelBenchmark #ImageUnderstanding #ComputerVision #AIResearch #DeepLearning #TechNews #OpenAI #FutureOfAI #AILeaderboard #InfinityAI
✍️ @TheInfinityAI
AI models are ranking based on how they interpret and understand images from distribution applications across two key tasks like generating detailed captions and assessing image quality.
OpenAI is still leading the AI landscape. 🚀
#ImageAI #VisionModels #AIEvaluation #ModelBenchmark #ImageUnderstanding #ComputerVision #AIResearch #DeepLearning #TechNews #OpenAI #FutureOfAI #AILeaderboard #InfinityAI
✍️ @TheInfinityAI
❤4
𝐈𝐧𝐟𝐢𝐧𝐢𝐭𝐲 𝐂𝐒
Photo
🧠 Understanding State Management in React.js
when we are building modern web apps with React.js, the state management is one oof the most important concept. it is the foundation that allows apps to update and react to user interactions and data changes.
🌱 What Is "State" in React?
No need to go deep. in simple words, State is data that is changing over time with time and it affects the content of the screen that user sees.
⚛️ The Two Types of Data in React
Props - data passed in to a component from its parent.
State - data managed inside a components
Props are like inputs and State is like the memory of a component.
🪄 How to Manage State
useState() hook in React used to create and mange local state inside a functional component.
import React, { useState } from "react";
function Counter() {
const [count, setCount] = useState(0); // Initial state = 0
return (
<div>
<h2>Counter: {count}</h2>
<button onClick={() => setCount(count + 1)}>Increase</button>
</div>
);
}
export default Counter;When the user clicks Increase, React updates the state and automatically re-renders the component and showing the new count to the user.
🔁 Why State Management Matters
When your app is growing, also growing the complexity of managing states
● Data may need to shared between multiple components.
● Some data might come from API or a database.
● When need to keep the UI synchronized with real-time updates.
Thats where state management becomes important, keeping your app’s data organized, predictable and easy to control.
🧩 Types of State in React
React applications deal with four main types of state
1. Local State - State that belongs to one component only.
2. Global State - Data that multiple components need to access.
3. Server State - Data fetched from a backend server or API.
4. URL State - Information stored in the browser’s URL
🛠 Common Tools for Managing State
● React Context API
● Redux Toolkit
● React Query (TanStack Query)
#ReactJS #StateManagement #ReactHooks #WebDevelopment #FrontendDev #JavaScript #useState #ReactTutorial #CodeNewbie #WebDevCommunity #LearnReact #ProgrammingTips #TechEducation #InfinityAI
✍️ @TheInfinityAI
❤6🐳1
MMBERT - A Modern Multilingual Encoder.pdf
299.4 KB
🔥 Big news for multilingual NLP! Check out this new paper on MMBERT
🌐🤖 Summary: The PDF describes how a modern encoder model (MMBERT) was trained using massive multilingual data. It shows how it achieves better results in language understanding and translation tasks across many languages.
#MMBERT #MultilingualNLP #NLPResearch #AIModels #DeepLearning #BERT #LanguageAI #MachineLearning #ArtificialIntelligence #NLPCommunity #MultilingualAI #TechNews #InfinityAI
🌐🤖 Summary: The PDF describes how a modern encoder model (MMBERT) was trained using massive multilingual data. It shows how it achieves better results in language understanding and translation tasks across many languages.
#MMBERT #MultilingualNLP #NLPResearch #AIModels #DeepLearning #BERT #LanguageAI #MachineLearning #ArtificialIntelligence #NLPCommunity #MultilingualAI #TechNews #InfinityAI
❤5🔥2🎉1🤣1
🚀 Free Python Full Course (සිංහල Medium)
🔹 Valid Until: November 06
🎓 Beginner Friendly | No Prior Experience Required
මේ Course එකෙන් ZERO to Advanced Python Programming පියවරෙන් පියවර ඉගෙනගන්න පුලුවන්. Variables, Data Types, Operators, Loops, Functions, OOP, Databases, GUI Development වැනි මුලික + ප්රායෝගික දේවල් හොදින් explain කරලා තියෙනවා.
💡 Ideal For:
• Programming beginners
• AI / Data Science / Automation learners
• Daily task automation with Python
📚 Course Duration: 15+ Hours
📝 Language: Sinhala
🧠 Simple Examples + Clear Explanations
🔗 Course Link:
https://www.udemy.com/course/python-for-everyone-sinhala-medium
🎁 FREE Access Coupon Code: CODEPROLKPYTHON
⏳ Use Before: November 06
——————————————————————
🔥 Grab It Fast & Save to Your Udemy Library
👨💻 Python is Must-Learn Today — Start Now!
🎉 Special Thanks to CodePRO LK for providing this amazing free learning opportunity!
👉 @codeprolk (YouTube)
✍️ @TheInfinityAI
🔹 Valid Until: November 06
🎓 Beginner Friendly | No Prior Experience Required
මේ Course එකෙන් ZERO to Advanced Python Programming පියවරෙන් පියවර ඉගෙනගන්න පුලුවන්. Variables, Data Types, Operators, Loops, Functions, OOP, Databases, GUI Development වැනි මුලික + ප්රායෝගික දේවල් හොදින් explain කරලා තියෙනවා.
💡 Ideal For:
• Programming beginners
• AI / Data Science / Automation learners
• Daily task automation with Python
📚 Course Duration: 15+ Hours
📝 Language: Sinhala
🧠 Simple Examples + Clear Explanations
🔗 Course Link:
https://www.udemy.com/course/python-for-everyone-sinhala-medium
🎁 FREE Access Coupon Code: CODEPROLKPYTHON
⏳ Use Before: November 06
——————————————————————
🔥 Grab It Fast & Save to Your Udemy Library
👨💻 Python is Must-Learn Today — Start Now!
🎉 Special Thanks to CodePRO LK for providing this amazing free learning opportunity!
👉 @codeprolk (YouTube)
✍️ @TheInfinityAI
❤5🔥2🤣2🎉1
𝐈𝐧𝐟𝐢𝐧𝐢𝐭𝐲 𝐂𝐒
Photo
Understanding the Transformer Model in LLMs
When you are using ChatGPT, Google Gemini, Claude or any other modern AI Language Model, you are interacting with a transformer. The transformer architecture introduced in 2017 by Google researchers revolutionized the ability of computers to understand and generate human language. This article will walk you through what transformers are and how they work step-by-step. Before transformers, language models looked at one word at a time. It was like reading a book with a flashlight that only shows one word. This made it hard for the model to understand long sentences. As an Example, In the sentence "The bank was steep," the word "bank" could mean a financial bank or a riverbank. To choose the right meaning, the model needs to see the word "steep". Transformers fix this by looking at all words in a sentence at once. This helps the model see how each word connects to the others
Before the transformer reads the text, it splits it into smaller units called tokens. Each token becomes a number (a vector) that the model understands. This is called tokenization and embedding.
- Input - "I love artificial intelligence"
- Tokens - ["I", "love", "art", "ificial", "intell", "igence"]
Transformers look at all words at once, so they need to know the order. For example, "dog bites man" is very different from "man bites dog." Positional encoding adds order to the tokens. It's like giving page numbers to mixed-up book pages.
This is the key part of transformers. Attention helps the model focus on important words when reading a sentence. Let's try to understand how Attention Works. Let's assume we need to translate "Le chat noir" (the black cat) into English. For this, the model needs to focus on "Le" and "noir" when working on "chat." The model uses three parts for this
01. Query - What word are we looking at now?
02. Key - What other words are there?
03. Value - What meaning do they give?
The model gives attention scores to all words to decide which ones are more important. Transformers use many attention heads at the same time (Multi-Head Attention). Each head looks at different things like grammar, meaning or logic. This helps the model understand better.
After attention, the model sends each word's information through a feed-forward neural network. This helps the model learn more and improve its guesses. It’s like asking, “Now that I understand the sentence better, now what else can I figure out about this word?”
Transformers use many layers, not just one. Each layer improves the output of the one before it.
Layer 1 - Finds simple word links
Layer 5 - Understands grammar better
Layer 10 - Handles deep meaning
Layer 20+ - Deals with complex ideas and reasoning
It’s like editing a paper many times to make it a better and clearer output.
Transformers learn by reading lots of text. During training:
- The model reads billions of sentences
- It guesses the next word
- If wrong, it makes small changes to improve
- It repeats this many times
This helps the model learn grammar, facts, patterns, and some logic.
When you ask a question:
- Your text becomes tokens
- Tokens go through all the layers
- Attention helps the model find meaning
- It guesses the next word
- Adds it to the answer
This will repeat until the answer is complete
Transformers are more powerful because they can read all words at once, understand long texts well, work better with more data and can be used for many tasks. Transformers changed how AI understands language by focusing on what matters and using many layers of learning. It became the core of most modern language models. They are not magic, but they are clever tools that learn from huge amounts of text and help computers understand and create human language better than ever before.
✍️ @TheInfinityAI
Introduction
When you are using ChatGPT, Google Gemini, Claude or any other modern AI Language Model, you are interacting with a transformer. The transformer architecture introduced in 2017 by Google researchers revolutionized the ability of computers to understand and generate human language. This article will walk you through what transformers are and how they work step-by-step. Before transformers, language models looked at one word at a time. It was like reading a book with a flashlight that only shows one word. This made it hard for the model to understand long sentences. As an Example, In the sentence "The bank was steep," the word "bank" could mean a financial bank or a riverbank. To choose the right meaning, the model needs to see the word "steep". Transformers fix this by looking at all words in a sentence at once. This helps the model see how each word connects to the others
Step 01 - Breaking Text Into Tokens
Before the transformer reads the text, it splits it into smaller units called tokens. Each token becomes a number (a vector) that the model understands. This is called tokenization and embedding.
- Input - "I love artificial intelligence"
- Tokens - ["I", "love", "art", "ificial", "intell", "igence"]
Step 02 - Adding Positional Information
Transformers look at all words at once, so they need to know the order. For example, "dog bites man" is very different from "man bites dog." Positional encoding adds order to the tokens. It's like giving page numbers to mixed-up book pages.
Step 03 - Attention Mechanism
This is the key part of transformers. Attention helps the model focus on important words when reading a sentence. Let's try to understand how Attention Works. Let's assume we need to translate "Le chat noir" (the black cat) into English. For this, the model needs to focus on "Le" and "noir" when working on "chat." The model uses three parts for this
01. Query - What word are we looking at now?
02. Key - What other words are there?
03. Value - What meaning do they give?
The model gives attention scores to all words to decide which ones are more important. Transformers use many attention heads at the same time (Multi-Head Attention). Each head looks at different things like grammar, meaning or logic. This helps the model understand better.
Step 04 - Feed-Forward Neural Networks
After attention, the model sends each word's information through a feed-forward neural network. This helps the model learn more and improve its guesses. It’s like asking, “Now that I understand the sentence better, now what else can I figure out about this word?”
Step 05 - Stacking Layers
Transformers use many layers, not just one. Each layer improves the output of the one before it.
Layer 1 - Finds simple word links
Layer 5 - Understands grammar better
Layer 10 - Handles deep meaning
Layer 20+ - Deals with complex ideas and reasoning
It’s like editing a paper many times to make it a better and clearer output.
Step 07 - Training the Model
Transformers learn by reading lots of text. During training:
- The model reads billions of sentences
- It guesses the next word
- If wrong, it makes small changes to improve
- It repeats this many times
This helps the model learn grammar, facts, patterns, and some logic.
Step 8 - How It Writes Text
When you ask a question:
- Your text becomes tokens
- Tokens go through all the layers
- Attention helps the model find meaning
- It guesses the next word
- Adds it to the answer
This will repeat until the answer is complete
Conclusion
Transformers are more powerful because they can read all words at once, understand long texts well, work better with more data and can be used for many tasks. Transformers changed how AI understands language by focusing on what matters and using many layers of learning. It became the core of most modern language models. They are not magic, but they are clever tools that learn from huge amounts of text and help computers understand and create human language better than ever before.
✍️ @TheInfinityAI
❤4🎉2🤣1
🎉 ChatGPT Go Plan – Now Free for 12 Months in India! 🇮🇳
OpenAI is offering the Go plan free for one year to users in India. This plan unlocks faster image generation, expanded file uploads, better memory, and longer context — all powered by GPT-5!
🌍 Live outside India? No problem!
You can still access this amazing offer using an Indian VPN. Just connect, refresh your browser, and upgrade to Go at ₹0/month for the first 12 months.
✨ Don't miss this limited-time opportunity to explore advanced AI features without paying a single rupee!
👉 Yeh, Try it now and supercharge your ChatGPT experience.
#ChatGPTGo #ChatGPTUpdate #OpenAI #AIIndia #GPT5 #TechNews #AIOffers #VPN #AICommunity #ArtificialIntelligence #AIFeatures #InfinityAI
@TheInfinityAI
❤3🎉1
OpenAI has officially rolled out GPT 5.1 worldwide. Paid users receive access first, with free users expected to join soon.
This release introduces two upgraded models. GPT 5.1 Instant delivers a warmer, more natural tone and follows instructions more smoothly. GPT 5.1 Thinking focuses on deeper reasoning, handling simple questions faster while dedicating more time to complex tasks.
What’s new:
▪️Adaptive reasoning that automatically adjusts thinking time
▪️Tone and personality presets such as Friendly, Professional, and Quirky
▪️Improved performance in math, coding, and logic evaluations
▪️Smoother conversation flow and better contextual memory
#OpenAI #GPT5 #ChatGPTUpdate #AIFeatures #TechNews #ArtificialIntelligence@TheInfinityAI
This release introduces two upgraded models. GPT 5.1 Instant delivers a warmer, more natural tone and follows instructions more smoothly. GPT 5.1 Thinking focuses on deeper reasoning, handling simple questions faster while dedicating more time to complex tasks.
What’s new:
▪️Adaptive reasoning that automatically adjusts thinking time
▪️Tone and personality presets such as Friendly, Professional, and Quirky
▪️Improved performance in math, coding, and logic evaluations
▪️Smoother conversation flow and better contextual memory
#OpenAI #GPT5 #ChatGPTUpdate #AIFeatures #TechNews #ArtificialIntelligence@TheInfinityAI
❤7🤣4
