Download as pdf
Download as pdf
You are on page 1of 29
PERCEPTION AND ACTION Perception in Artificial Intell and touch. Perception helps to bui 'gence is the process of interpreting vision, sounds, smell, Sapo eee 4 ild machines or robots that react like humans. Perception fhetphysica watid us t Acquire, select, and then organize the sensory information from ea make actions like humans. The main difference between Al and re ‘at the robot makes actions in the real world. We Perceive our environment through many channels: sight, sound, touch, smell, taste. Many animals possess these same perceptual capabilities, and others are able to monitor entirely different channels. Robots, too, can process visual and auditory information, and they can also be equipped with more exotic sensors, such as laser range finders, speedometers, and radar. Two extremely importantsensory channels for humans are vision and spoken language. It is through these two faculties that we gather almost all of the knowledge that drives our problem-solving behaviors. We now turn to heuristic search, as exemplified in Al by the A* algorithm, While A* al state to the goal state, the algorithm is guaranteed to find an optimal path from the ae : st aFrAE has a number of limitations in the real world. For one, the exponential complexity o! limits the size of problems it can realistically solve, and forces us to consider a cae search hori ‘Also, having incomplete information about the world can further limit that Search hori from one room to another inan unfamiliar a i task of navigating 3 en buj on ede ; mited to how far one can (literally) see at any given eo uilding, ‘horizon is limite ical world in order to see beyond the horizon, fi i imal ones. Finally, real-time tasks like driving Because heuristic search is time-cong . ; . is .d reacting: of time. in ire continuous monitoriNB iutions ahead ' require continu out optim’ jssues. It is called Real-Time.,s Se Ae addresses these ction every k seconds «(thy isa variation of A* tel real-world action eons, Where)! ai gorithm commits 1° 7 the search horizon. Each time RTA+ on ki is algo’ eI ‘ [Korf, 1988]. ee ee ddson the depth of I us. RTA is able Co make propre, Voy istant thal int. ! : : " aa itrestarts the search from that p' quence of solution steps in advan, et an action, ites : a lan a complete 5 Be ; He a goal state without having (0 ies n computer games: As we mentioned in Chap o inspi work cause of ti QR was inspired to a degree by ¥ cio ievocable moves be Re consti game- playing programs must com BCA that: Algorithm: Real-Time-A* rt state. 1. Set NODE to be the start sta : , 2. Generate the successors of NODE. If any of the successors is a goal state, then Quit 3, Estimate the value of each successor by performing a Bxed:depth search Starting a acme depth-first search, Evaluate all leaf nodes using the A* h cui function f= g +I’, where g is the distance to the leaf node and h’ is the Predicteg distance to the goal. Pass heuristic estimates up the search tree in such a way thay the/value of each internal node is set to the minimum of the values of its children! 4. Set NODE to the successor with the lowest score, and take the corresponding action in the world. Store the old NODE in a table along with the heuristic score of the second-best successor. (With this strategy, we can never enter into a fixed loop, because we never make the same decision at the same node twice.) If this node is ever generated again in step 2, simply look up the heuristic estimate in the table instead of redoing the fixed-depth search of step 3. 5. Go to step 2. We can adjust the depth to which we search in step 3, depending on how much time we want to spend planning versus executing actions in the world. Provided that every part of the search space is accessible from every other part, RTA* is guaranteed to find a path 9 a solution state if one exists, ‘The path may not be an optimal one, however. The deeper ¥° ea Seb fe shortalBE average soltion pathe wil be OF Ce te wat to may impose limits on how deep we can Search, as a result of incomplete ‘information. RTA‘ is just one exam due to Hansson and Mayer arelated notion, the anytime, * limited-horizon search algorithm. Another algomth™ ARTIFICIAL INTELLIGENCE feried at any point during its computation. The longer the algorithm runs, the more - Sats more specific techniques aimed at various perceptual and motor problems. Later, we investigate architectures fer integrating peer eon, action, and cognition. It should be noted that this is only a brief survey of avery large and active fed of research, Those interested in investigating these issues more deeply should consult robotics texts such as Brad 1982] and Craig [1985]. Accurate machine vision opens up a new realm of computer applications These applications include mobile robot navigation, complex manufacturing tasks, analysis of we investigate how we can the world, satellite images, and medical image processing. In this section, transform raw camera images into useful information about Avideo camera provides a computer with an image Tepresented as a two-dimensional grid of intensity levels, Each gtid element, or pixel, may store a single bit of information (that is, black/white) or many bits (perhaps a real-valued intensity measure and color information). A visual image is composed of thousands of Pixels. What kinds of things might we want to do with such an image? Here are four Operations, in order of increasing complexity: 1. Signal Processing ‘Enhancing the image, either for human consumption or as input to another program. 2 Measurement Analysis: For images containing a single object, determining the tyro- dimensional extent of the object depicted. Pattern Recognition ; For single-object images, classifying the object into a category drawn from a finite set of possibilities, Image Understanding : For images containing many objects, locating the objects in the image, classifying them, and building a three-dimensional model of the scene. [1986] for algorithms that perform the first two operations. The third | Tecognition, varies in its difficulty. It is possible to classify ie bjects, such as machine parts coming down a conveyor Lae : ts is harder because of the large number of possible orientations - inderstanding is the most difficult visual task, and it has been a ——_ ‘ject of the most study in Al. While some aspects of image understending redluce sul pila analysis and pattern recognition, the entire problem remains UMSoIye4 measui ana nes I because of difficulties that include the following: Jee * _ Animage is two-dimensional, while the world is three-cimensional. Some information BCA is necessarily lost when an image is created. a * Oneimage may contain several objects, and some objects may partially Orelde othe, as we saw earlier. * The value of a single pixel is affected by many different phenomena, including the color of the object, the source of the light, the angle and distance of the camera, the Pollution in the air, etc. It is hard to disentangle these effects, Asa result, 2-D images are highly ambiguous, Given a single image, we could Construct any number of 3-D worlds that would give rise to the image. For example, consider the ambiguous image of Fig. below. 0 2 disk ome ? sphere © ?dome Fig. An Ambiguous Image Itis impossible to decide what 3-D solid it Portrays. In order to determine the most likely interpretation of a scene, we have ‘o apply several types of knowledge. Speech recognition is an Al analog form to digital form. Advanced further processing. Speech Tecognition j enhanced technology Converting human speech from an computer programs then use the digital speech for is @ computer receiving dictation and is different from NLP. Types of Speech Recognition Speech recognition systems can be separated in several different Classes by describing what types of utterances they have the ab; lity to recognize, ‘These classes are classified as the following : 1. Isolated Wor quiet (lack of an each utterance to have Jbolated word recognizers usually requ le window, It accepts single audio signal) on both sides of the sample ARTIFICIAL INTELLIGERICE Words or where single utterance at a time. These systems have “Listen/ NotListen” states, they require the speaker to wait between utterances (usually doing proce: ‘ssing, uring the pauses), Isolated Utterance might be a better name for this class, Connected Words: Connected word systems (or more Correctly ‘connected ‘llerances') are similar to isolated words, but allows separate utterances to be loge! Continuous Spee! naturally, while the dict run. ther’ with a minimal pause between them ‘ontinuows speech recognizers allow users to speak almos it's computer me of the most mine utterance ompuler determines the content, (Basically, ation). Recognizers with continuous speech capabilities are soi difficult to create because they utilize special methods to deter boundaries, 4. Spontaneous Speech: Ata basic level, it can be thought of as Speech that is natural sounding and not rehearsed. An ASR system with spontaneous speech ability should be able to handle a variety of natural speech features such as words being run together, “ums” and “ahs”, and even slight stutters, Natural language understanding systems usually accept typed input, butforanmumber of applications this is not acceptable. Spoken language is a more natural form of communication in many human-computer interfaces. Speech recognition systems have been available for some time, but their limitations have prevented widespread use. Below are five major design issues in speech systems. These issues also provide dimensions along which systems can be compared with one another. * Speaker Dependence versus Speaker Independence :A speaker-independentsystem can listen to any speaker and translate the sounds into written text. Speaker independence is hard to achieve because of the wide variations in pitch and accent Itis easier to build a speaker-dependent system, which canbe trained onthe voise patterns of a single speaker. The system will only work for that one i - can be retrained on another voice, but then it will no longer work for the original speaker. ing i in us Isolated-Word Speech : Interpreting isolated-word speech, is easier than interpreting continuous uses between each word, is easier eae a ds to be pronounced differently because boundary effects cause wo and despite the ct ech wave. fal ajsound, en them in the spe’ ken phrase “could you" one d e rds, there is no empty space bel os BCA ‘he ability to recognize continuous speech is very important, however, sincg aman, eae speaking in isolated words. oe Real Time versus Offline Processing : Highly ane = ce mie bay sentence be translated into text as it is being spoken, ae ia ns, it permissible to spend minutes in computation. Real-time spe: fo Achieve especially when higher-level knowledge is involved. * Large versus Small Vocabulary : Recognizing utterances that are confined to smay vocabularies (e.g.. 20 words) is easier than working with large vocabularies ep, 20,000 words). A small vocabulary helps to limit the number of word candidates fae a given speech segment. Mobility and intelligence seem to have evolved together. Immobile creatures have little use for intelligence, while it is intelligence that Puts mobility to effective use. In this Section, we investigate the nature of mobility in terms of Many classic AT planning problems involve navigation. The STRIPS system, for Sxample, gave high-level instructions to 4 robot moving through a set of rooms, carrying objects from one to another. Plans to solve Boals like “move box A into room x” orenel Operator: like MOVECY, XM meaning “more ftom room ¥ to room x” Cem itself with how this ovement was to be realized in the manner of movement wag somethin, der the low-level details ARTIFICIAL INTELLIGENCE start obstacle goal Fig. A Path planning problem 1 the robot is so small as to be considered a point, the problem straightforwardly py constructing Let S be the set co all obstacles. To form gh visible from one anotho using the A* ‘an be solved a visibility graph. nsisting of the initial and final positions as well as the vettices of Points in 5 that are the graph (perhaps 'e visibility graph, we connect every pair of , as shown in Fig. below. We can then search algorithm) to find an optimal path for the robot, ed | | star PSS obstacle ae ‘goal Fig, Constructing a Visibility Graph start) ote) \goal> Fig. Another Path Planning Problem Fortunately, The. algorithm is as the size of the obsi Physical size and We can reduce this problem to the previous path- follows: First choose a point P on the surface of the robot, then increase tacles so that they cover all points that P cannot enter, because of the shape of the robot. Now, simply construct and search a visibility graph. Sed on P and the ertices of the new obstacles, as in Fig. below. The basic idea is to "ce the robot to a own as consi ; Ty Puaucang planning problem. int P and do path planning in an artificially constructed space, Space, or c-space [Lozano-Perez et al, 1984]. 113, Fig. Constructing Configuration Space Obstacles If we want to allow rotations, we can represent the robot as a combinati P and some angle of rotation 0. The robot can now be considered as a po through three-dimensional space ( dimensional c space objects, On Of poing int movin, % Y, 0). Obstacles can be transformed into three. and a visibility graph can again be created and searched, An alternative approach to obstacle avoidance is the use of potential fields [Khati, 1986], With this technique, the direction of a moving robot is continually Tecomputed as 4 function of its current Position relative to obstacles and its destination. The robot is essentially repelled by obstacles and attracted to the destination point. This approach is ting positioning errors that accumulate during a robot's journey ‘pected obstacles. It can be combined with conf; figuration space Path planning to enable robust navigation [ktogh and Thorpe, 1986]. Robots have found numerous applications in are able to perform simple Tepetitive tasks, such a: highly task-specific. Itisa grammed to carry out a wi industrial settings. Robot manipulators 's bolting and fitting automobile parts, long-standing goal in robotics to build ide variety of tasks, ARTIFICIAL INTELLIGENCE Vip. A Pleleand- Hace Tosk ‘There are two main sublasks here. The first is to design a robot motion that ends with the object stably grasped between the two fingers of the robot. Clearly some form of path planning, as discussed above, can be used to move the arm toward the object, but we need lo modify the technique when it comes to the fine motion involved in the grasp itself. Here, uncertainty is a critical problem. Even with the vision techniques. A robot can never be sure of the precise location of the peg or the arm. Therefore it would be a mistake to plan a grasp motion in which the gripper is spread only wide enough {0 permit the peg, to pass, as in below Fig,(a). A better strategy is to open the gripper wide, then close gradually as the gripper gets near the peg, as in below Fig.(b). That way, if the peg turns out to be located some small distance away from where we thought it was, the grasp will still succeed. @) (b) /depends: Jess on precise vision, itrequires some tactile sensitivity Unless we take special care in designing grasping motions, hE ~~ BCA ipper touch the peg one second For example, should the left side of the gripper ae ae before the - a (aso1 Fight side does, the peg may fall, thus foiling the grasp. Bro Petal oie) : , jects. give robust algorithms for grasping a wide variety of object it in the hole. Thi After the peg is stably grasped, the robot must place it in the hole, This supa Tesembles the path- planning problem, although it is complicated by the fact that moving the peg through 3-D space requires careful orchestration of the arm’s joints. Also, we must Seriously consider the problems introduced by uncertainty. Figure below (a) shows a naive strategy for placing the peg. Failure will result from even a slight positioning error, because the peg will jam flatly on the outer surface, A better strategy is shown in below Fig.(b). We slide the peg along the surface, applying downward pressure so that the peg enters the hole at an angle. After this happens, we straighten the peg gradually and push it down into the hole. fi i @), (o) Fig. Native and Clever Strategies for Placement This type of motion, which reacts to forces generated by the world, is called compliant motion. Compliant motion is very robust in the face to uncertainty. Humans employ compliant motion in a wide variety of activities, such as writing on chalkboards. erate a sequence of compliant motions? On chaining. Our initial anc in configuration space, as =— TATA PusLicaTions ARTIFICIAL INTELLIGENCE initial state strong pre-image of goal state goal state Fig, Planning with Uncertainty {in Configuration Space al state in a single compliant motion, assuming a certain degree of uncertainty in al position and direction of movement and certain facts about relative friction. This set ts is called the goal state's strong pre-image. In Fig.above, the strong pie-image of the goal state is shown in gray. Now we use ard chaining to design a set of motions that is guaranteed to get us from the initial te to some point in the goal states strong pre-image. Recursively applying this procedure eventually yield a set of motions that, while individually uncertain, combine to forma Robotics is an integrated study of mechanical engineering, electronic engineering, computer engineering, and science. Robot is a mechanical device designed with electronic circuitry and programmed to perform a specific task. These automated machines are highiy significant in this robotic era. They can take up the role of humans in certain dangerous environments that are hazardous to people like defusing bombs, finding survivors in unstable ruins, and exploring mines and shipwrecks. In 1954, George Devol invented the first digitally operated programmable robot called Unimate. George Devol and Joseph Engelberger, the father of the modern robotics industry formed the world’s first robot company in 1956. In 1961, Unimate, was operated ina General Motors automobile factory for moving car parts around in New Jersey. BCA, XN iecaceaperce mnie Ig ae Most robots are composed of 3 main parts: 1. The Controller - also known as the “brain” which is run by a computer program, t gives commands for the moving parts to perform the job. 2. Mechanical parts - motors, pistons, grippers, wheels, and gears that make the robot move, grab, turn, and lift. 3. Sensors - to tell the robot about its surroundings. It helps to determine the sizes and shapes of the objects around, distance between the objects, and directions as well, Types of Robot Architectures The types of Robot Architectures are as follows : 1. Sense-Plan-Act Architecture This architecture is one of the first developed, and consists of three main subsystems: sensing, planning, and execution. These components were organized in a sequential fashion, with sensor data being passed to the planner, who then Passes information to the controller, 2. Subsumption Architecture An alternative to the sense-plan-act architecture that em u s architecture decomposes the o re the higher-level igh-level behaviors can outsource smal Pe viours. Ought of as layers of ine was often referred Vial _ ARTIFICIAL INTELLIGENCE “1988. behaviour. Actuators, and where multiple behaviours are evaluated in Parallel, An arbitration mechanism is also included to choose which of the behavi activated. For example an explore behaviour may sit on top of (sub: avoidance behaviour, and the ours is currently sume) a collision arbitration mechanism would decide when the exploration behaviour should be overridden by the collision avoidance behaviour, While this architecture is much more reactive than the sense-plan-act there are also disadvantages. The primary disadvantage of this approach is no good way to do long-term planning or behaviour optim ation. This challenging to design the system to accomplish long-term objectives, 3. Three-tiered Architecture architecture, that there is can make it The three-tiered architecture is one of the most com: This architecture contains a planning, an executive, are hierarchically linked. monly used architectural designs and a behavioural control level that 1. Planning: This layer is at the hij ighest-level, and focuses on task-planning for long-term goals. behavioural layer to accomplish a specific task. from the planning layer, the executive c tasks. 3. Behavioural control: At the lowest-level, the the implementation of low-level behaviours actuators and sensors. 4. CODGER Architecture behavioural control layer handles and is the interface to the robot's CODGER is an architecture for controlling vehicles in outdoor road-following tasks. CODGER uses a blackboard structure to organize incoming perceptual data. The system's {ontol is centralized and hierarchical—all numerical data from sensors are fused in order ¥ build up a consistent model of the world. This model is represented symbolically. CODGER has been used to build a system for ; driving the experimental NAVLAB [Shafer ‘nd Whittaker, 1989] vehicle, a commercial van that has been altered for computer control Via electric and hydraulic servos. The NAVLAB is completely self-contained, with room °t several on-board. Computers and researchers, 5, : TCA Architecture ri TCA is an architecture that combines the idea of reactive systems yon pe "08 TCA is Ec ted system with centralized control, designed to co ~ autonomous robots for long periods in unstructured environments, sich as the surfag g Mars. TCA particularly addresses issues that arive in the context of multiple goals ayy limited resources. BCA The architecture provides mech-aniisms for hierarchical task managementand alloy, action based on incomplete plans. Because robols gather new information by moving through the tworld, TCA permits plans to be terminated early should higher priority goals arise, Some situations require highly reactive behavior. TCA achieves high-speed response by Parallelizing planning and execution whenever possible. For example, in designing walking motions over rough terrain. TCA plans one step, initiates it, and then begins to plan the next step before the leg motion has been completed. PRS is a symbolic robot planning system that interleaves planning and execution, In PRS, goals represent robot behaviors, not world states. PRS contains procedures for turning goals into subgoals or iterations thereof. A procedure can be invoked by either the presence of a goal or the presence of some sensory input. Thus, the robot is capable of goal-directed behavior but canalso react when the world changes or when plans fail. Goals and procedures are represented symbolically, and a central reasoner uses a stack to oversee the invocation of procedures. (s3 | NATURAL LANGUAGE PROCESSING Introduction Natural Language Processing (NLP) is a branch of Artificial Intelligence (Al) that enables machines to understand the human language. Its goal is to build systems that can make sense of text and automatically perform tasks like translation, spell check, or topic classification. Components of NLP There are the following two components of NLP. 1. Natural Language Natural Languagi aralyce buna entities, keywore NLU mainly both spoken a — ARTIFICIAL INTELLIGENCE NLU involves the following tasks - P= 1Lis used to map the given input into useful representation = ILis used to analyze different aspects of the language, 2. Natural Language Generation (NLG) Natural Language Generation (NLG) acts as a translator th computerized data into natural language representation. It mainl planning, Sentence planning, and ‘Text Realization. at converts the ly involves Text Difference between NLU and NLG [- NLU NLG NLU is the process of reading and | NLG is the process of writing or interpreting language, generating language, It produces non-linguistic outputs from | It produces constructing — natural natural language inputs. language outputs from non-linguistic inputs, NLP Terminology 1. Phonology : Itis study of organizing sound systematically. 2, Morphology : It is a study of construction of words from Primitive meaningful units, 3. Morpheme : It is primitive unit of meaning in a language. 4. Syntax : Itrefers to arranging words to make a sentence. It also involves determining the structural role of words in the sentence and in phrases. 5. Semantics : It is concerned with the meaning of words and how to combine words into meaningful phrases and sentences, Pragmatics : It deals with using and understanding sentences in different situations and how the interpretation of the sentence is affected. BCA Pragmatic Analysis Lexical Analysis and Morphological The first phase of NLP is the Lexical Analysis. This phase scans the source code asa stream of characters and converts it into meaningful lexemes. It divides the whole text into paragraphs, sentences, and words. Syntactic Analysis (Parsing) Syntactic Analysis is used to check grammar, word arrangements, and shows the relationship among the words. Example: Agra goes to the Poonam In the real world, Agra goes to the Poonam, does not make any sense, so this sentence is rejected by the Syntactic analyzer. Semantic Analysis Semantic analysis is concerned with the meaning representation. It mainly focuses on the literal meaning of words, phrases, and sentences, Discourse Integrat ds upon the sentences that proceeds it and also invokes es that follow it. Discourse Integra the meaning of th ase of NLP. It helps you to discover the intended that characterize cooperative dialc gues. ARTIFICIAL INTELLIGENCE plications of NLP There i are the following applications of NLP Question Answering Question A; nswering focu: questions § focuses on building sys! i ace yee oe that automatically answer the language. Spam Detection ees Spam detection is used to detect toa user's unwanted e-mails getting 's inbo: inbox. Sentiment Analysis Analysis is also known as opinion mining. Itis used on the web to analyse and emotional state of the sender. This application is nation of NLP (Natural Language Processing) and negative, or natural), identify Sentiment the attitude, behaviour, implemented through a combi statistics by assigning the values to the text (positive, the mood of the context (happy, sad, angry, etc.) Machine Translation cone natural language d to translate text or speech from Machine translation is use another natural language. Example: Google Translator Spelling, correction ord, PowerPoint + software like MSW Microsoft Corporation provides word proceso! words into text It is used in itating to Meroe Pe oxen mate i. BCA 7. Chatbot f ications of NLP. Iti Implementing the Chatbot is one of the important applic Misused, Many companies to provide the customer's chat se . 8. Information extraction Information extraction is one of the most important applications of NLP. It is ysoq for extracting structured information from unstructured or semi-structured Machine. readable documents, 9. Natural Language Understanding (NLU) Tt converts a large set of text into more formal representations such as first-order logic structures that are easier for the computer programs to manipulate Notations of the natural language processing. Advantages of NLP 1. NLP helps users to ask questions about any subject and get a direct response within seconds, 2. NIP offers exact answers to the question means it does not offer unnecessary and unwanted information. 3. NLP helps computers to communicate with humans in their languages. 4. It is very time efficient, 5. Most of the companies use NLP to improve the efficiency of documentation processes, accuracy of documentation, and identify the information from large databases. Disadvantages of NLP A list of disadvantages of NLP is given below: NLP may not show context, NLP is unpredictable NLP may require more keystrokes, te EIN he NLP is unable to adapt to the new domain, and ithas a limited function that’s why NLP is built for a single and specific task only. : NLP Techniques Natural Lai help computers Tata PuBLicaTions ARTIFICIAL INTELLIGENCE yentonce analyzen toxt us sic ral text using basic grammar rules to identify organize i «l, and how words relate to each other. SUuCtItE, how yy, how wos r Q Some of ity 8 mMaN BUbtake includ tee elude: okenization consiat can be 6 of breaking, Sentences or up a text i 7 lenees or words) to mak ito sinaller parts called tokens (which oan ¢ text casier to handle. Speceh tagging (PoS tagging) labo ete. T alps Is tokens as tc. This helps infer the meaning tokens as verb, adverb, adjective, noun, = of a word (for different things if used! as a verb or a a (for example, the word “book” means 3. Lemmatizati ion & stemming consist of reducing inflected words to their base form ir base for to make them easier to analyze. 4, Stop-word removal removes frequently occuring words that don’t add any semantic value, such as I, they, have, like, yours, etc. ysis is understanding and analyzing the antic analysis is used in AL twitter sentiment ords, In Artificial Intelligence, Semantic ana meaning and context like humans. Sem: answer customer queries, aunched products. In simple ding to the languages based on the for making NLP applica analysis to understand semantic analysis is use tions like a chatbot to the feedback of the newly I d to understand the meaning of the sentence acco! context. Parts of Semantic Analysis es sceipe . Analysis of Natural Language can be classified into a E alysis involves understanding ic Ani : al Semantié fers to fetching Lexic text individually. It basically re! tic Analysis: 1 each word of the x .d to carry: he di ing that a word in the text is depute "apie the dic! 7 ‘Although knowing themeanié He maine 2, antics Analy! ¥i3 ompletelY understand t sufficien ae jal, it is NO @ of the f BCA et i i i Semantic Grammers c information into a syntactic grammar, The nal semantic constituents. Generally asemary F erly communicated. Seman, error occurs when the meaning of the knowledge is ney ee eas aan errors occur if the human expert misinterprets the Kn na answers inappropriately. . anti Semantic grammars encode seman! use context free rewrite rules with non term The proper constituents of semantic grammar are noun prue (0) s phrase (VP), Noun (N), Verb (V), Preposition phrase (PP), Adverb (ADV) ani _ eee successful applications of semantic grammaris the LIFER system (A ai seed ey voter, In the LIFER system, there are several rules to handle the wh-queries such as: What is the name of your country? Which department of your country is must efficient? Who guide them? Where they are being guided? These sentences are analyzed and words matched to the symbols contained in the Jexicon entries. Semantic grammars are suitable for use in systems with restricted grammars since its power of computation is limited. Long sentences most often give rise to ambiguities when conventional grammars are used to process the same. The processing of such sentences may yield a Jarge number of analyses. It is here that the statistical information extracted from a large corpus of the concerned Janguage can aid in disambiguation, Since a complete study of how statistics can aid natural language processing cannot be discussed, we try to highlight some issues that will kindle the reader's interest in the same. ae 1. Corpora The term “corpus” is derived from the Latin word meaning “body”. The term could be lection of written text or spoken words ed as a large collection of segments of ered based on some explicit linguistic that language. Corpora may be availab] (0 that they may be used form of a collection of ARTIFICIAL INTELLIGENCE PW text 6 © AbOUE the went MF Sophisticated annotated or marked: °rdS is also included to ease the process of lan, up form wherein information lage processing. Several ki ee Rrocesing language, now ea oF corpora exist, These include ones "Mew of could mean ge = i ‘eXts, texts from either One or different languages. Textual content joumals spear a of a Complete book or books, Newspapers, magazines, web pages, cllectonorameeae The British National Corpus (BNO), for instance is sad to have 5 may contain texts on . and spoken language samples, Some corpora Siagunge Copa Pa domain nidy oF a dialect. Such corpora are called Others a one re may focus specifi *areas ike medicine, law, literature, 2 million writte ically to select Counting the elements, in a Corpus Counting the number Of Words in a Corpus as also the distinct valuable information *earding the probability of the Occurrence of a word given an incomplete string in the Tanguage under “onsideration. These probabilities can be used to predict a word that will follow. How should counting be done d scenario. Should the punctuation marks like, (comma), treated as a word or not has to be decided. words in it can yield lepends on the application i (Semicolon) and the period (,) be stands for the total number of words in the Corpus. In the last sentence, (the one earlier to thi, for example, we have 14 types and 24 tokens. 3. N-Grams N-grams are basically sequences of N words or strings, where N could assume the Value 1,23, and so on. When N=1, we call it a unigram (just one word). N=2 makes a bigtam (a sequence of to words). Similarly we have trigrams, tetragrams and so on, Different words “) ina given corp e words have a high frequency like the article "the" As S “ample let us take the of occurrences of words in the novel - The Scarlet Pimpernel ’ Batoness Or i has around 87163 words and 8822 ir probabilities of ae BCA Probability = (Word Frequency Word Frequency : Total number of words e a 4508 0.051 ots 2474 0.028 a 2353 0.027 ‘ 2261 0.026 1559 0.018 h is 137 0.013 tn 1077 0.012 ‘ 935 0.0107 4 0.005 sid 399 0.0046 es 174 0.002 Scarlet 38 oon woman 66 beautiful ed on fool 18 0.00002 However 2 om e words ina corpus Table ; Frequencies and probabilities of som Here we look at the probability of just one word in the corpus. 4. Smoothing While N-grams may be a fairly good way of predicting the next word, it does suffer it banks heavily on the corpus which forms the basic training Ne-grams missing within it to be many which should have had non-zero probability b gt if we could assign some non Zer0 Pio known as smoothing. TWO known from a major drawback data. Any corpus is fini There are numerous N-grams e instead. It is thus be ‘ome extent. This process is tare assigned te and there are bound bability t© a zero valu circumvent the problem to $ methods are described herein. Add-one smoothing ram (single word) probahility without smoothing i) Let P(w;) be the normal unig (ansmoothed) sand N be the total ‘aumber of words in the conpus thers uns) n P(wi) ctw) /Lem =m) /N ies, Before calculating the Note + way of assigning ‘non-zero probabiliti ‘corpus is incremente! ord within the ie the simples! This is the 50" : i count of each distinct W probabilities, Ne Tata pusuicario"® a ARTIFICIAL INTELLIGENCE f lof the counts of all words has now increased by D the number of distinct types of is in the language (vocabulary). fae o new probability of a word after add one smoothing can now be compu ted as Pyaai (Wi) = {e(wy) + )/(N +D) ii) Witten-Bell Discounting i alee ie ee could be looked upon as things we saw once (for ' i ; pus we do encounter new N-grams and finally are jna position to ascertain the number of unique N-grams. The event of encountering anew be looked upon as a case of an (so far) unseen N-gram. This calls for computing the probability of an N-gram which has just been sighted. One may observe que N-grams seen in the data is the same as the count, H,, of the N- that the number of unic erved (50 far) for the first time. Thus (N+H) would mean the sum of the words vr so far and the unique N-grams types inthe compas. bility mass of all such N-grams (occurring for the first time i.e. having ted by computing H/(N+H). This value stands for the detected. H/(N+H) is also the probability of ‘of N-grams thathave never occurred Negrams by I would distribute # could be written as Negram could grams obs or tokens see! ‘The total proba zero probability) could be estima probability of anew type of N-gram being unseen N-grams taken together. If is the total number robability of unseen unt), dividing the p ability of an unseen N-gram so far (zero CO Thus the prob: equally among them. p" =H/I(N+H) has to be 1, this extra probability distributed amongst unseen N-grams has to be scooped or discounted from other regions in the probability distribution. The probability of the seen Negrams is therefore discounted to aid the generation of the extra probability req" the unseen ones as: P§=q,/(N+H) where ¢, is the (non-zero positive) count of k* N-gram. Since the total probability irement for is used in Is required for Janguage processing: Tt ts including word processing, character OF text d_ generation. Spell checking is on® of the 2 Studies on computer aided Spell Checker is one of the basic too rgnites -omputing environmen systems, speech recognition ant ies for-most natural language processors: EE '_ ~~ BCA spell checking date back to the early 1960’s and with the see ee pane sli to new languages, continue to be one of the challenging areas B - for ee Pro ng Spet checking involves identifying words and non words and also suggesting the Possible altematives for its correction. Most available spell checkers focus on processing isola, words and do not take into account the context. For instance if you try typing - “Henry sar on the box” in Microsoft Word 2003 and find what suggestions it serves, you will find that the correct word sat is missing! Now try typing this - “Henry at on the box” Here you will find that the error remains undetected as the word at is spelt correctly as an isolated word. Observe that context plays a vital role in spell checking. Spelling Errors Damerau (1964) conducted a survey on misspelled words and found that most of the non words were a result of single error misspellings. Based on this survey it was found that the three causes of error are: 1. Insertion: Insertion of an extra letter while typing. E.g. maximum typed as. maxiimum. The extra / has been inserted within the word. 2. Deletion: A case of a letter missing or not typed in a word. E.g. netwrk instead of network. 5. Substitution: Typing of a letter in place of the correct one as in intellugence wherein the letter i has been wrongly substituted by 1. Types of Spelling Errors Spelling errors may be classified into the following types, 1. Typographic errors: As the name suggests, these errors are those that are caused due to mistakes committed while typing. A typical example is netwrk instead of network. 2. Orthographic errors: These, on the other hand, result due to a lack of comprehension of the concerned language on part of the user. Example of such spelling errors are arithmetic, Wellcome and accomodation. 3. Phonetic errors: These result due to Poor cognition on part of the listner. The Ould be spelt as ruffand listen as lisen. Note that both the misspelled d ier have the same phonetic pronunciation as their actual spellings i Sspelled words more than typographicediting actions ARTIFICIAL INTELUGENGg that cause a misspelling (viz. insertion, deletion, transposition, “1T0r) as in case of ruff. Words like piece, peace and pens, quiet may all be spelt correctly but can lead to conf context, + OF Subs reed and read ang sion depending titution ite ant © the I Checking Techniques One could imagine a naive spell checker as a large corpus of correct y ord in the text being corrected does not match wi spelling error. An exhaustive corpus would of co words. Thus ig en it results in ‘quirement, assified into three categories - Wolves or non-words, For example - The word soper is a super. The most commonly used techniques to detect such errors are the N. analysis and Dictionary look-up. As discussed earlier, N-gram techniques mal of the probabilities of occurrence of N-grams in a lar the error in the word. Those strings that contain hi treated as cases of spelling errors, Note that in the c N-grams to be a sequence of letters (alphabet) ra Predict the next leter (alphabet) rather than the next word. These techniques have often been used in text (handwritten or printed) recognition systems which are Processed by an Optical Character Recognition (OCR) system, ith one in the corpus th uurse be a mandatory re Spell checking techniques can be broadly el a) Non-Word Error Detection : This process in the detection of misspelled words Ron-word; its correct form being gram ke use ‘BE Corpus of text to decide on hly infrequent sequences are ‘ontext of spell checkers we take ther than words. Here we ty to The OCR uses features of each character such as the cu them to identify the character. Quite often these OCR number 0, the alphabet O and D are quite often source This calls for a spell checker that can post-process the ves and the loops made by methods lead to errors, The s of errors as they look alike OCR output. One common N- Bram approach uses tables to predict whether a sequence of characters docs exist within a corpora and then flags an error. Dictionary look-up involves the use of an efficient dictionary lookup coupled with pattern-matching algorithms (suchas hashing techniques, finite state automata, etc), dictionary partitioning schemes and morphological processing methods. 'solated-Word Error Correction : This process focuses on the correction ofanisolated ! k t to non-word by finding its nearest and meaningful word and makes an oe ; i ans bul ‘eclify the error. It thus transforms the word soper into super by some means Without looking into the context. ; 131 “AP UsucaTions AMM ic BCA than the previ independent suggestio This correction is usually performed I oe ie pir odie nt ; ; sd herein ine it di exercise. The techniques employed ods, N-gram, probabiliy, techniques, similarity key techniques, rule-based ca Bram Probabils neural network based techniques. taney ang looked upon as a combination of thre. sub, (Correct word) generation and Ranking already mentioned could use either of. ble correct carididates are founy Isolated-word error correction may be problems - Error detection. Candidate the correct candidates. Error detection as dictionary or the N-gram approaches. The possil using a dictionary or by looking-up a pre-processed database of correct N-gram, Ranking of these candidates is done by measuring the lexical or similarity distance between the misspelled word and the candidate. Minimum Edit Distance Technique Wagner [1974] defined the minimum edit distance between the misspelled word and the possible correct candidate as the minimum number of edit operations needed to transform the misspelled word to the correct candidate. By edit operations we mean - insertions, deletions and substitutions of a single character (alphabet) to transform one word to the other. The minimum number of such operations required to effect the transform is commonly known as the Levenshtein distance named after Vladimir Levenshtein who first used this metric as a distance. As an example inspect the way in which you could transform the word drive (below) to the word time and arrive at the distance 3 between them. D R T v E 1, Subs(0,1)_2, Delete(R) ‘3, SubsVM) T T M E A variant of the Levenshtein distance is the Damerau-Levenshtein distance which also takes into account the transposition of two characters in addition to insertion, deletion and substitution. Context dependent Error detection and correction : These processes try, it addition to detect errors, try to find whether the corrected word fits into the context of sentence. These are naturally more complex toimplement and require more resources method. How would you correct the wise words of Lord Ball “Peace comes from within” seas PugLtcarion® ARTIFICIAL INTELLIGENCE ,d a5 yin I hin’ i apiece comes from within"? word in both these statements is a correct word. a of rea-vord erors or those that result in anther ali hat have more than one potential correction also fallin i re . . * ly used find their basis on traditional and statistical te at ae ist 0 ” eS correct inv ni8 I geword erTO word qhe strategies common! ota ute processing techniques. pat : yak augortl™ : oA gue a rithm can be effectively used as a simple phonetic based spell i" snakes Us? of rules found using the phonetics of the language in question. We ; am with reference {0 English. t Odell Russell and Margaret to check forthe closest word. The code was used to index fora word consists of its first letter followed by three numbers at generate the same sound ‘Those consonants th ‘and V imply the same number vz. 1- inthe early 20° century, the Soundex red by Robert names in , census ing consonants. the labials B, F, P rei the algorithm. + Remove all punctual pitalize the letters in the word. Retain the first letter of the word. yy occurrence of the Tete tion marks and caj 1g - Ay EL 0, UH, W, ¥ apat from the + Remove al very first letter. + Replace the letters (other than the first) by the numbers shown in Table. etter, not separated by vowels have the same numeric Iftwo or more adjacent. value, retain only one of them. + Retum the first four characters; pad with zeroes if there are less than four. Tenens) Subst with Tateger “ible: Subst abe: Substitutions for generating the Soundex code 133, oa ac BCA. Nominally the soundex code contains. First character of word, Code_1, Code_2, Code_3. Table : shows the Soundex code, for a few words. [ Word Soundex Code Grate, great 6630 Network. network _N362 Henry. Henary H560 Torn 7650 Worn W650 Horn 650 Table : Soundex codes for some words Note that the last three words are differentonly in the starting alphabet. This algorithm can thus be used to measure the similarity of two words. This measure can then be used to find possible good candidates for correction to be effected for a misspelled word such as rorn (viz. tom, worn, horn). ARTIFICIAL INTELLIGENCE IMPORTANT QUESTIONS Whot is Perception? Explain about Real Time Search, Vision and Speech Recognition. Write about Navigation, Manipulation and Robot architectures. What is Netural Language Processing? Explain about Syntactic Processing and Semantic Analysis Write about Statistical NLP and Spell Checking,

You might also like