Question: Can someone help me figure this problem out in python? How do we make computers seem intelligent? One approach is to use term extraction. Term

Can someone help me figure this problem out in python?
How do we make computers seem intelligent? One approach is to use term extraction. Term extration is a type of information extration where we attempt to find relevant terms in text. The relevant terms come from a corpus, or set of plausible terms we want to extract. For example, suppose we have the text: one day I would like to visit Syracuse We has smart humans can be fairly confident that Syracuse is a place, more specifically a city. A rudimentary method to make the computer interpret Syracuse as a place is to provide a corpus of cities and have the computer look up Syracuse in that corpus. In this code exercise we will do just that. Let's first write a function to read cities from the file NYC2-cities.txt into a corpus of cities, which will be represented in Python as a list. Then write a main program loop to input some text, split the text into a list of words and if any of the words match a city in the corpus list we will output the word is a city. The program should handle upper/lower case matching. A good approach is to title case the input. IMPORTANT: Please note our that program will ONLY work for one word cities. Later we will provide an approach for multiple-word cities, such as New York or San Diego. Don't worry about that now SAMPLE RUN Enter some text (or ENTER to quit): one day I would like to visit syracuse and Rochester Syracuse is a city Rochester is a city Enter some text (or ENTER to quit): austin is in texas Austin is a city Enter some text (or ENTER to quit): Quitting... As usual begin your program with your plan as a to-do list. I suggest writing the loading of the corpus as a function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
