AI Prog 2023
AI Prog 2023
II. To create intelligent machines that can help us solve complex problems. AI has the
potential to revolutionize many industries and aspects of our lives, from healthcare to
transportation to customer service. By studying AI programming, we can develop the skills
and knowledge needed to build these intelligent machines.
III. To gain a better understanding of the human mind. AI research has helped us to better
understand how humans learn, reason, and make decisions. This knowledge can be used to
improve our own cognitive abilities and to develop new educational and therapeutic tools.
IV. To create new and innovative applications. AI is already being used to develop a wide
range of new applications, such as self-driving cars, facial recognition software, and
medical diagnostic tools. By studying AI programming, we can learn how to develop our
own innovative AI applications.
V. To stay ahead of the curve in the job market. AI is one of the most in-demand skills in the
current job market. By studying AI programming, we can make ourselves more marketable
to potential employers.
VI. Problem-solving: AI programming helps in solving complex problems that require logical
reasoning and decision-making.
VII. Data Analysis: AI can handle large amounts of data and extract meaningful insights from
it.
Programming without AI involves creating systems with fixed, rule-based logic. These
systems do not have the ability to learn or adapt on their own and operate based on
predefined instructions.
Natural language generation (NLG) focuses on text generation, or the construction of text in
English or other languages, by a machine and based on a given dataset.For example, an NLG system
could be used to generate a news article from a database of news stories, or to generate a product
description from a database of product information.
Lexical Ambiguity: This type of ambiguity represents words that can have multiple assertions. For
instance, in English, the word “back” can be a noun ( back stage), an adjective (back door) or an
adverb (back away).
Syntactic Ambiguity: This type of ambiguity represents sentences that can be parsed in multiple
syntactical forms. Take the following sentence: “ I heard his cell phone rin in my office”. The
prepositional phrase “in my office” can be parsed in a way that modifies the noun or in another way
that modifies the verb.
Semantic Ambiguity: This type of ambiguity is typically related to the interpretation of a sentence.
For instance, the previous sentence used in the previous point can be interpreted as if I was
physically present in the office or as if the cell phone was in the office.
c) Discuss two business tasks where Sentiment analysis can be applied [4 Marks]
Customer Feedback Analysis: Sentiment analysis can be used to analyze customer
feedback and reviews. This can help businesses understand how their products or services
are perceived by their customers. It can identify positive, negative, and neutral sentiments,
and provide insights into specific issues that customers might be facing.
Brand Monitoring: Sentiment analysis can also be used for brand monitoring on social
media platforms. It can help businesses track public opinion about their brand and their
competitors. This can provide valuable insights into market trends and can help businesses
strategize their marketing efforts.
Machine learning can help with targeted marketing in a number of ways, including:
● Segmenting customers: Machine learning algorithms can be used to segment customers into different
groups based on their demographics, behavior, and other factors. This information can then be used
to target different marketing messages to different customer segments.
● Predicting customer behavior: Machine learning algorithms can be used to predict customer behavior,
such as the likelihood of a customer making a purchase or churning. This information can be used to
target marketing messages to customers who are most likely to be interested in them.
● Personalizing marketing messages: Machine learning algorithms can be used to personalize
marketing messages to individual customers. This can be done by taking into account the customer's
past purchase history, browsing behavior, and other factors.
b) A bank manager is given a data set containing records of 1000s of applicants who have
applied for a loan. How can AI help the manager understand which loans he can approve?
Explain. [5 Marks]
AI can help a bank manager understand which loans he can approve by using machine
learning to build a credit scoring model. A credit scoring model is a statistical model that
predicts the likelihood of a borrower defaulting on a loan. The credit scoring model is
trained on a dataset of historical loan data. This data includes information about
borrowers, such as their credit history, income, and employment status. The model is also
trained on information about loan defaults. Once the model is trained, it can be used to
score new loan applicants. The model will generate a score for each applicant, which
indicates the likelihood of that applicant defaulting on the loan. The bank manager can
then use this information to make decisions about which loans to approve. For example,
the manager may decide to approve loans for borrowers with a high credit score and
reject loans for borrowers with a low credit score.
Or AI can be employed in the following ways:
● Credit Scoring Models: Machine learning models can analyze historical data to
develop credit scoring systems. These models consider various factors such as
credit history, income, debt-to-income ratio, and employment status to predict the
creditworthiness of an applicant.
● Risk Prediction: AI models can predict the risk associated with approving a loan for
a particular applicant. By analyzing patterns in past loan data, these models can
assess the likelihood of repayment and default.
● Automation: AI can automate the loan approval process by quickly analyzing and
validating large sets of applicant data. This reduces the time it takes to make
lending decisions and improves efficiency.
● Fraud Detection: AI algorithms can detect anomalies in the data that may indicate
fraudulent loan applications, adding an additional layer of security to the approval
process.
● Dynamic Decision-Making: Machine learning models can adapt and learn from
new data, allowing the bank to continuously refine its loan approval criteria based
on changing economic conditions and customer behaviors.
c) You’ve won a 2-million-dollar worth lottery’ we all get such spam messages. How can
AI be used to detect and filter out such spam messages? [5 Marks]
AI can be used to detect and filter out spam messages by using machine learning to
build a spam filter. A spam filter is a software program that analyzes emails and
identifies spam messages. The spam filter is trained on a dataset of labeled emails.
This data includes spam messages and non-spam messages. The model is trained to
identify the features that are common to spam messages, such as the words and
phrases used, the IP address of the sender, and the subject line of the email. Once the
model is trained, it can be used to filter new emails. The model will analyze each
email and generate a score, which indicates the likelihood of that email being spam.
The email client can then use this information to filter out spam messages. For
example, the email client may decide to move spam messages to a spam folder or to
delete them outright.
or
● Feature Extraction: The facial features, such as eyes, nose, and mouth, are extracted from the
detected faces. This involves mapping the key points on the face.
● Face Representation: The extracted features are transformed into a numerical representation or
embedding, creating a unique signature for each face.
● Database Comparison: The system compares the facial embeddings of the detected face with those
stored in the database. This helps in identifying individuals and verifying their identity.
● Machine Learning Training: The algorithm is trained on a large dataset of labeled faces to improve its
accuracy and generalization capabilities.
b)Describe exhaustively the components of the following code snippet. [10 Marks]
● import numpy as np: Imports the NumPy library and aliases it as np.
● import matplotlib.pyplot as plt: Imports the pyplot module from the Matplotlib library
and aliases it as plt.
● from scipy.io import wavfile: Imports the wavfile module from the SciPy library to
read WAV files.
● SciPy is an open-source library used for scientific and technical computing in Python.
The wavfile module within SciPy provides functions to read and write WAV files, a
common format for audio data.
● Reading WAV File:
● frequency_sampling, audio_signal = wavfile.read("/Users/Omol/audio_file.wav"):
Reads a WAV file located at "/Users/Omol/audio_file.wav" using the wavfile.read
function. The sampling frequency is stored in frequency_sampling, and the audio
signal is stored in audio_signal.
● Printing Signal Information:
● print('\nSignal shape:', audio_signal.shape): Prints the shape of the audio signal array.
● print('Signal Datatype:', audio_signal.dtype): Prints the data type of the audio signal
array.
● print('Signal duration:', round(audio_signal.shape[0] / float(frequency_sampling), 2),
'seconds'): Prints the duration of the audio signal in seconds.
● Normalizing Audio Signal:
● audio_signal = audio_signal / np.power(2, 15): Normalizes the audio signal by
dividing it by 2^15.
● Selecting a Subset of Audio Signal:
● audio_signal = audio_signal[:100]: Takes the first 100 samples of the audio signal.
● Creating Time Axis:
● time_axis = 1000 * np.arange(0, len(signal), 1) / float(frequency_sampling): Creates a
time axis in milliseconds based on the length of the signal and the sampling
frequency.
● Plotting the Audio Signal:
● plt.plot(time_axis, signal, color='blue'): Plots the audio signal against the time axis
with a blue line.
● plt.xlabel('Time (milliseconds)'): Sets the x-axis label.
● plt.ylabel('Amplitude'): Sets the y-axis label.
● plt.title('Input audio signal'): Sets the plot title.
● Displaying the Plot:
● plt.show(): Displays the plot.