Ai & ML Week-12
Ai & ML Week-12
With advancements in technology and fields like deep learning, sentiment analysis is
becoming more and more common for companies that want to gauge their customers’
sentiments.
Today, businesses use natural language processing, statistical analysis, and text analysis
to identify the sentiment and classify words into positive, negative, and neutral
categories.
Depending on how you interpret customer feedback, you can classify them and meet your
sentiment analysis. However, below are some of the popular sentiment analysis
classifications:
2.Emotion Detection
This type of sentiment analysis helps to detect customer emotions like happiness,
disappointment, anger, sadness, etc. Here, you can use sentiment lexicons or
complex machine learning algorithms to identify the customer’s feelings.
One of the disadvantages of using sentiment lexicons is that people tend to express
emotions in different ways. So, it may be confusing to understand human emotion
clearly while using it.
Real-Time Analysis
Is your angry customer about to churn? Is a PR crisis on social media escalating?
Sentiment analysis will help you handle these situations by identifying critical real-time
situations and taking necessary action right away.
Consistent Criteria
According to research, customers only agree for 60-65% while determining the sentiment
of the particular text. Tagging text is highly subjective, influenced by thoughts and
beliefs, and also includes personal experience. Therefore, you can apply criteria and
filters to all your data, improve their accuracy, and gain better insights using sentiment
analysis.
Rule-based Approaches
Usually, a rule-based system uses a set of human-crafted rules to help identify
subjectivity, polarity, or the subject of an opinion.
These rules may include various NLP techniques developed in computational
linguistics, such as:
Stemming, tokenization, part-of-speech tagging and parsing.
Lexicons (i.e. lists of words and expressions).
Rule-based systems are very naive since they don't take into account how words
are combined in a sequence. Of course, more advanced processing techniques
can
be used, and new rules added to support new expressions and vocabulary.
However, adding new rules may affect previous results, and the whole system
can
get very complex. Since rule-based systems often require fine-tuning
and maintenance, they’ll also need regular investments.
Automatic Approaches
Automatic methods, contrary to rule-based systems, don't rely on manually crafted rules,
but on machine learning techniques. A sentiment analysis task is usually modeled as a
classification problem, whereby a classifier is fed a text and returns a category,
e.g. positive, negative, or neutral.
Classification Algorithms
Various classification algorithms involve statistical modelings like naive Bayes,
support vector machines, deep learning, or logistic regression. Let us discuss them
in detail below:
Naive Bayes: It is a family of probabilistic algorithms that predict the category of a
text by using the Bayes theorem.
Support Vector Machines: It is a non-probabilistic model that uses a representation
of the input text as a point in multi-dimensional space. Different text categories
map to distinct regions within the space because the new texts are categorized
based on the similarity with the existing text and the region they are mapping.
Deep Learning: A family of algorithms that attempts to mimic the human brain
with the help of artificial neural networks to process the data.
Linear Regression: A family of algorithms in statistics that helps to predict some
value (y) for a given set of features (x).
Hybrid Sentiment Analysis Algorithms:The hybrid model is the combination of
elements of the rule-based approach and automatic approach into one system. A
massive advantage of this approach is that the results are often more accurate and
precise than the rule-based and automated approaches.
ETHICS IN AI
What is AI Ethics ?
AI ethics is a set of guidelines that advise on the design and outcomes of artificial
intelligence
The ethics of AI is important to engineers and scientists who have become enthusiastic
about using this technology to solve engineering-related problems.
Ethics in AI ensures that the AI initiatives of the organization or entity maintain human
dignity and do not in any way cause harm to people.
Importance of AI ethics
Some ethical frameworks can minimize AI risks and ensure a safe, fair, and human-
centered AI. We will discuss some feature of Ethical AI that would tell us better than how
they make AI systems more safe and fair:
Social Well-being:
Ethical AI makes the system available for the individual, society, and the
environment’s sake. It will work for the benefit of mankind.
Governable:
We are designing a system that works on intended tasks. It detects and avoids
unintended consequences.
Value Alignment:
Humans are making decisions by considering universal values. Ethical frameworks
help to consider those universal values.
Human-Centered:
Ethical AI system values human diversity, freedom, autonomy, and rights. It serves
humans by respecting human values. The system is not performing any unfair and
unjustified actions. It respects individual freedom and autonomy. Our systems are
fair and protected. Our system respects the rights of individuals.
Ethical challenges of AI
Biases
We need data to train our artificial intelligence algorithms, and we need to do
everything we can to eliminate bias in that data.
We know that Bias is possible when you favour one side and for that you need to
think. This means that to be biased we need to have thinking ability and Machines
do not have that.
The same is true for autonomous cars. They need to react immediately if a child
runs out on the road, so it’s important that the AI is in control of the situation. This
creates interesting ethical challenges around AI and control.
Privacy
Privacy (and consent) for using data has long been an ethical dilemma of AI. We
need data to train AIs, but where does this data come from, and how do we use it?
For example, Barbie now has an AI-enabled doll that children can speak to.
What does this mean in terms of ethics? There is an algorithm that is collecting
data from child’s conversations with this toy. Where is this data going, and how is
it being used?
As we have seen a lot in the news recently, there are also many companies that
collect data and sell it to other companies. What are the rules around this kind of
data collection, and what legislation might need to be put in place to protect users’
private information?
Power Balance
Huge companies like Amazon, Facebook, Google, are using artificial intelligence
to squash their competitors and become virtually unstoppable in the marketplace.
Balancing that power is a serious challenge in the world of AI.
Ownership
Who is responsible for some of the things that AIs are creating?
We can now use artificial intelligence to create text, bots, or even deep fake videos
that can be misleading. Who owns that material, and what do we do with this kind
of fake news if it spreads across the internet?
We also have AIs that can create art and music. When an AI writes a new piece of
music, who owns it? Who has the intellectual property rights for it, and should
potentially get paid for it?
Humanity
Artificial intelligence has now gotten so fast, powerful, and efficient that it can
leave humans feeling inferior. This issue may challenge us to think about what it
actually means to be human.
These are some of the key ethical challenges that we all need to think about very
carefully when it comes to AI.
AI code of ethics
The Code of Ethics in the Field of Artificial Intelligence establishes the general
ethical principles and standards of conduct that should be followed by participants
in relation to the field of artificial intelligence in their activities, as well as the
mechanisms for the implementation of the provisions of this Code.
1. AI Actors should take all necessary measures to preserve the autonomy and free
will of a human‘s decision-making ability, the right to choose, and, in general, the
intellectual abilities of a human as an intrinsic value and a system-forming factor of
modern civilization.
1.AI developers must know and comply with the provisions of the legislation in all
areas of their activities and at all stages of the creation, development and use of AI
technologies, including in matters of the legal responsibility of AI Actors.
Non-discrimination
1.AI developers are encouraged to assess the potential risks of using an AIS, including
the social consequences for individuals, society and the state, as well as the
humanitarian impact of the AIS on human rights and freedoms at different stages,
including during the formation and use of datasets.
Risk-based approach.
The level of attention to ethical issues in AI and the nature of the relevant actions
of AI developers should be proportional to the assessment of the level of risk posed
by specific technologies and AISs and the interests of individuals and society.
Risk-level assessment must take into account both the known and possible risks; in
this case, the level of probability of threats should be taken into account as well as
their possible scale in the short and long term.
Responsible attitude.
AI Actors should have a responsible approach to the aspects of AIS that influence
society and citizens at every stage of the AIS life cycle.
These include privacy; the ethical, safe and responsible use of personal data; the
nature, degree and amount of damage that may follow as a result of the use of the
AI; and the selection and use of companion hardware and software.
DOCKER INSTALLATION
Docker is an OS-level virtualization software platform that helps users in building and
managing applications in the Docker environment with all its library dependencies.
When the whale in the status bar stays steady, Docker is up-and-running, and accessible
from any terminal window.
Dockerfile:
Dockerfile is a simple text file that consists of instructions to build Docker images.
Dockerfile consists of specific commands that guide you on how to build a specific
Docker image.
let’s go through some of the most common Docker commands used while creating
dockerfiles.
ENV provides default values for variables that can be accessed within the container
Syntax:
ENV key value
Example:
ENV value_1
How to Build a Docker Image and Docker Container Using Dockerfile? First of all,
you should create a directory in order to store all the Docker images you build.
•Now, we will create a directory named ‘simplidocker’ with the command:
mkdir simplidocker
•Move Docker image into that directory and create a new empty file (Dockerfile) in it:
cd simplidocker touch Dockerfile
•Open the file with the editor. In this example, we opened the file using vi:
vi Dockerfile
•Then, add the following content:
FROM ubuntu MAINTAINER simpli RUN apt-get update
CMD ["echo", "Welcome to Simplilearn"]
•Save and exit the file.
Let’s first declare the path where we will be storing the dockerfile simplidocker
docker build [OPTIONS] PATH | URL | -
Now, by adding -t flag, the new image can be tagged with a name:
docker build -t simpli_image
Once the Docker image is created, you can verify by executing the command:
docker images
Let’s name the container “simplilearn” and create it with the command:
docker run --name simplilearn simpli_docker