Vibing the Bot
Ever considered that you're really talking at your chatbot, not with it? Given, if the AI's doing it's job well, it shouldn't feel that way - but the fact remains.
That's because comprehending the nuances of human language is a monumental task. At its heart, semantic analysis tackles this challenge head-on, aiming to understand how words relate to each other – from simple synonyms to complex contextual meanings. It also digs deeper, extracting meaning from sentences and paragraphs, moving past simple word recognition to capture the relationships between subject, verb, and object. The end goal? To understand the overall theme, the author's intent, and even the subtle sentiment being expressed. This is inherently complicated, after all it's not like we can just hard-code a chatbot to regurgitate canned responses - it must be able to legitimately render understanding. Without thorough semantic analysis, chatbots misinterpret user needs wildly, and are even rendered useless - it's integral to the LLM's functionality. Let us explore this complex process, and reveal the true way in which AI "gets" what you mean.
The Benihana Effect
The jump from 0s and 1s to linguistic prose is a daunting gymnastic task, but the first crucial step on our way is the tokenization process. The boss affectionately refers to this as The Benihana Effect - and even behind the humor, it is an unironically excellent analogy:
So, just like the talented chefs at Benihana artfully slice and dice ingredients before they hit the grill, our AI chefs need to chop up your language into usable bits too. At the most fundamental level, it's the process of taking in a raw string of input text and returning small, meaningful units: tokens. Much like holding the knife at the hibachi - there are many ways to cut them up!
The multiple techniques available to us in this preparatory phase each have their own unique use cases. However, the holistic goal of tokenization is always to retain as much of the original context as possible, by the time the qualitative is quantified. Word tokenization, the most straight-forward approach, splits inputs apart using spaces as the delimiter. Simple enough,... and simply terrible in application. The limitations are nearly wholly insufficient, and that's because meaning so often lies within words - not just in the sum of the parts. Consider a word like "unpredictability" - feeding it to the machine, claiming this is its most fundamental form, erases the significance of the prefix "un-" and the suffix "-ability."
For reference - even if only subconsciously, the only reason you understand the word "unpredictability" is because you are mentally identifying and applying those grammatical function. Therefore the machine renders what is, in essence, an invalid square root, and will not be able to dissect meaning. Words do not arbitrarily spawn meaning upon their completion, the meaning gradually manifests as the word completes, and for that reason they make thoroughly unfit tokens. The limitations of the space-delimited chop-shop are clear - it isn't flexible enough to suitably capture context. So, we take the next logical approach, Subword Tokenization - which looks for those smaller, often recurring units within the words. As previously illustrated, "unpredictability" becomes something like "un" + "predict" + "ability," preserving vital information far more effectively. With that, nuances such as tone, voice and sub-text finally start emerging as distinct measurable factors that the system can process and use. The major LLM's of today utilize Subword Tokenizers, such as Byte Pair Encoding (BPE) and WordPiece.
Now, all those nuances such as tone, voice, and sub-text finally begin to emerge from the Subword level as distinct measurable factors that the system can finally process and use! As we progress, we zoom out, so that the AI has the opportunity to capture more of the broader thematic elements present in entire strings of prose. When we talk about a sentence such as: "He saw her, while walking to the store," to fully comprehend that is to understand all individual contributing factors. This is where proceeding sentence tokenization proves its purpose: with a methodology of splitting input text into structured, coherent sentences, the model gains more awareness on all parts of that structure - thus improving both clarity and accuracy as a whole! In other words, the true nature of the specimen's context is emerging. Tokenization structures our text in ways that computers can understand, it's the qualitative's and quantitative's only phone line to each other. Now, that our dishes have been sufficiently cut up - time to cook!
The Grammar Gauntlet
Hopping onto the grill, we now shift our focus to the assembly of the dishes - taking us straight into the realm of syntactic analysis! Unlike tokenization which primarily looks at the “what” of words, here we are focused on the relationships of a sentence. By emphasizing “who did what” (or “what does what,... to what”), our next key challenge is extracting real and tangible semantic understanding of how every element interplays with the overall structure! It is not sufficient enough to see our tokens merely as isolated components of understanding. Instead, we begin stacking the Legos and it starts unveiling new layers of conversational truth - this step begins at the Part-of-Speech (POS) level!
POS-Tagging is a technique which labels the different pieces of your recipe with its proper grammatical role: labeling nouns, verbs, adjectives, adverbs, prepositions, and the rest! “Running” for instance, could be an adjective in a sentence like “He saw her at the running track," or a verb in a sentence like “He is running a marathon." How can our machine truly comprehend intent when it is so easily prone to such fundamental miscommunications? Well, much like chefs identifying each unique and special role of their ingredients, POS taggers provide similar information, and allow computers to dissect complex grammatical patterns with great speed and efficiency! Thus, the proper application of these core functions becomes the fundamental stepping stone, that sets up a framework for real meaningful conversational understanding! Whereas the tokenizer's approach is atomic, the POS-tagger is only interested in the functional relationships the tokens manifest when combined. With this, our robot chef begins learning that recipes aren't just a haphazard collection of ingredients - but instead, a carefully structured combination of components..
But - knowing the grammatical role of each token only sets the stage for understanding how they relate. Much like simply knowing the flavor of an ingredient isn't enough to comprehend a full meal - you must understand the context! That is precisely why we use dependency parsing, to uncover and define the structure of each unique structure! Which modifiers are acting upon the subjects, and which prepositions relate the predicates to each other? How do all those pieces connect? All questions which an AI system must also answer if it has any hopes to parse out semantic truth from simple pieces of text! This approach helps us to dissect our recipes into structured combinations, rather than a mere collection of disparate parts. It allows the system to then finally achieve true structural understanding. This brings us directly into Named Entity Recognition (NER). For all our grammatical understanding, the system is still prone to miss the nuances of even simple homographs. For example, in a simple search: is that "apple," referring to the technology corporation and you were just too lazy to capitalize it, or does you mean the simple fruit? NER allows for a system to detect and identify entities, such as: places, times, companies, and people, all from the contextual nuances of the whole sentence! Thus, our bot begins learning far more than just the relationships of words but, rather, what they actually mean in their real world contexts!
Graphed Among the Stars
Now that we've meticulously analyzed each component of a sentence through tokenization and structural analysis, we finally arrive at our last stage: rendering the actual sentiment. Much like a master chef assessing the taste and texture of each completed dish, we now explore not just how the words are used, but what each part of the meal actually means. This journey takes us beyond simple definitions, into the multidimensional world of embeddings. At the most basic level, we take words that the system is learning about, and associate them as unique points in meaning-space, where each word is plotted out as a vector. The coordinates of each vector are calculated based on how frequently different terms appear near to one another. Thus, these vectors begin, almost intuitively via this derivation system, to capture actual semantic properties of the words they represent! Think about it: if "king" and "queen" have highly related locations, with "man" having a vector position very near to that of “woman,” then a clear and direct semantic relationship between them is captured, all with vector positions! Therefore our robot chef can now identify the full scope and flavor profile of our many recipes by analyzing these spatial positions, mapping not only the what of an ingredient, but the “taste” and relationship between each part and the whole itself.
Furthermore, as vectors exist in this “meaning-space”, the machine begins to see all possible nuances that you might expect. The distance between “walked”, and “running”, can be quantitatively measured! How often does “joy”, relate to the concept of “love”, in the data we provided it? Thus, by calculating these distances, we create a quantifiable level of semantic understanding. Now, it begins to really “see” a vast network of semantic relations that you may intuitively understand without realizing it! This isn't just limited to the "flavors", either, as it allows an understanding for everything from the texture to even the consistency of a given data point! The system can understand when a product is simply "good" and can also recognize that when something is "fantastic" it has a slightly stronger implied value! This powerful and versatile “meaning-space” can even see the implied emotional tenor behind even the simplest sentences.
And this is where the power of embeddings truly shines - in sentiment analysis. The same spatial mapping that reveals semantic meaning also naturally expresses emotions! Our robot-chef doesn't just see words, it also now quantifies and processes the feelings behind them. Access to a dataset that is marked for emotional intensity allows for a direct quantification, making feelings just as easily measurable as semantics are! Thus combining semantic relationship with these ‘emotional vectors’ makes that intuitive grasp on feelings, just another byproduct of that system. So, you gain both the meaning, the feeling, all at the same time. Just imagine if brands could automatically taste and understand every feeling expressed by their consumers... well, that is the power of this system. With this, the machine evolves past identifying, structuring and even analyzing all of the individual pieces. It has become the "robot taster." Now, it doesn't just "cook" - it expresses and captures human feeling with all of its powerful vector-based capabilities!
Cobi Tadros is a Business Analyst & Azure Certified Administrator with The Training Boss. Cobi possesses his Masters in Business Administration from the University of Central Florida, and his Bachelors in Music from the New England Conservatory of Music. Cobi is certified on Microsoft Power BI and Microsoft SQL Server, with ongoing training on Python and cloud database tools. Cobi is also a passionate, professionally-trained opera singer, and occasionally engages in musical events with the local Orlando community. His passion for writing and the humanities brings an artistic flair with him to all his work! |
Tags:
- AI (3)
- ASP.NET Core (3)
- Azure (13)
- Conference (2)
- Consulting (2)
- cookies (1)
- CreateStudio (5)
- creative (1)
- CRMs (4)
- Data Analytics (3)
- Databricks (1)
- Event (1)
- Fun (1)
- GenerativeAI (4)
- Github (1)
- Markup (1)
- Microsoft (13)
- Microsoft Fabric (2)
- NextJS (1)
- Proven Alliance (1)
- Python (6)
- Sales (5)
- Sitefinity (12)
- Snowflake (1)
- Social Networking (1)
- SQL (2)
- Teams (1)
- Training (2)
- Word Press (1)
- Znode (1)
Playlist for Sitefinity on YouTube
Playlist for Microsoft Fabric on YouTube
Playlist for AI on YouTube
Copyright © 2024 The Training Boss LLC
Developed with Sitefinity 15.1.8321 on ASP.NET 8