Page 282 - Ai Book - 10
P. 282

Let us understand the arrangement of expressions and their meanings with the help of Python programming
            language.
                 Different syntax, same semantics: 5+4 = 4+5
            Here, expressions are written in different way, but their meanings are the same, that is 9.

                 Different semantics, same syntax: 2/3 (Python 2.7) ≠ 2/3 (Python 3)
            Here, expressions are written in the same way but their meanings are different. In Python 2.7, we will get ‘1’ as
            a result while in Python 3, we will get ‘1.5’ as an output.

                  Knowledge Botwledge Bot
                  Kno

              Semantics is what the language expression evaluates to.

            Semantics: Understanding the Meanings of Words

            Sometimes, a word or a sentence has multiple meanings. Let’s consider these three sentences:

             u   His face turned red when he heard that he failed. (What does this mean? Is he feeling ashamed because he
                failed? Is he feeling angry because he did not work hard?)

             u   The red colour’s car is my favourite. (Here, the colour of the car ‘red’ is stressed)
             u   His face turns red after consuming the medicine. (Is he having an allergic reaction? Or is he not able to bear
                the taste of that medicine? )
            However, the context of a statement or a sentence is important. In all three sentences, the word red has been
            used in three different ways which according to the context of the statement changes its meaning completely.
            Thus, in natural language, a word can have multiple meanings and the meanings fit into the statement according
            to the context of it.

            Pragmatics: Understanding The Purpose

            Sometimes, a statement or a sentence is perfectly correct syntax but it does not mean anything. For example:

             u   Moon eats biscuits while the dog feeds tea.
            This statement is correct grammatically but makes no sense. Thus,a perfect balance of syntax and semantics is
            important in human language for understanding what the text is trying to achieve.

            Language is complex in nature because lexicon is constantly changing. Thus, these are some challenges that we
            might have to face when we teach computers how to understand and interact in human language.
            HOW DOES NLP WORK?

            As you know, human beings are able to talk in many languages such as English, Hindi, French, Spanish etc. but
            computers are not. It understands only machine language. Thus, all the processes in our computers and smart
            devices communicate via millions of zeros and ones to perform a particular function. Now, let us understand
            how Natural Language Processing makes it possible for the machines to understand and speak in the Natural
            Languages just like humans.
            Text Normalisation

            Text normalization is a technical term used for transforming text into a standard form. It reduces the complexity
            of textual data in such a way that it comes down to a level where its complexity is lower. In this section, we will
            be working on a collection of text documents, known as Corpus.





                156
                156
   277   278   279   280   281   282   283   284   285   286   287