Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Multi-purposed Question Answer

Generator with Natural Language


Processing

Hiral Desai, Mohammed Firdos Alam Sheikh


and Satyendra K. Sharma

Abstract Artificial Intelligence is a way of making a computer that works in a


similar manner that the smart human think. Machine language, which is a type of
artificial intelligence that provides computers to learn without being explicitly
programmed or ruled. A Multi-Purposed Question Answer Generator which is
based on AI in which machine automatically generates the question from contests
and also give their answers. So, it is very useful for teachers for giving an
assignment and their solution to students. It is also useful for giving one mark
question as well its answer to students after every chapter. So, it eliminates the
tedious job of teachers and gives an easy solution.

Keywords Artificial intelligent  Human brain  Machine language



Train data NLP

1 Introduction

Machine learning emphasizes on the generation of computer programs that can


teach themselves to fatten and alter when disclosure to new data. Machine learning
is a way of teaching computers to accomplish and enhance prediction based on
some data [1].

H. Desai  M. F. A. Sheikh (&)


Pacific School of Engineering, Surat, India
e-mail: firdos.sheikh@gmail.com
H. Desai
e-mail: hiral8.desai@yahoo.com
S. K. Sharma
MITRC, Alwar, India
e-mail: skpacific323@gmail.com

© Springer Nature Singapore Pte Ltd. 2019 139


V. S. Rathore et al. (eds.), Emerging Trends in Expert Applications and Security,
Advances in Intelligent Systems and Computing 841,
https://doi.org/10.1007/978-981-13-2285-3_18
140 H. Desai et al.

Machine learning tasks are analyzed in three categories


(1) Supervised Learning
(2) Unsupervised Learning
(3) Reinforcement Learning.
(1) Supervised Learning
In supervised learning, we will give some example inputs and pretended output to
computer and the intention is mapping input to pretended output with general rule.
Examples of supervised learning are as follows.
You are a kid, you see different types of vehicles on roads, your guardian tells
you that this particular vehicle is a car…after him/her giving you tips a few times,
you see a new type of car that you never saw before—you identify it as a car and
not as an auto or a truck or a bike. You identify because you have a teacher to guide
you and learn concepts, such that when a new sample comes your way that you
have not seen before, you may still be able to identify it.
Assume we are on a road and our task is to arrange the same types of vehicles at
one area. Suppose the vehicles are bike, car, auto.
Suppose the vehicles are bike, car, auto. So we know from our previous work
that the shape and features of every vehicles so it is easy to manage the same type of
vehicles at one area. Here, your previous work is called as train data in data mining.
So we learn the things from our train data. This is because of we have a response
variable which says you that if some vehicles have so and so features it is auto, like
that for every vehicles.
• This type of data you will get from the train data.
• This concept of learning is called as supervised learning.
• This problem solving come under classification [5].
(2) Unsupervised Learning
In this learning algorithm, no label is given to find a structure, leaving it in its input.
The structure can be derived by grouping of the data that are based on the rela-
tionship between the variables in the data. There is no feedback in unsupervised
learning on prediction results.
Suppose you are on a road and your task is to manage the same types of vehicles
at one area. This time you do not know anything about that vehicles, you are first
time seeing this vehicle so how can you manage the same type of vehicles. What
will be the first step? you can choose one vehicle and you will choose any physical
character of that particular vehicle. Assume you taken the number of wheels. Then
you will arrange them base on the number of wheels, then the groups will be
something like this.
TWO WHEELS GROUP: Cycle and Bike.
THREE WHEELS GROUP: Auto.
FOUR WHEELS GROUP: Car and Truck.
Multi-purposed Question Answer Generator … 141

So now you will take another physical character as size, so now the groups will
be something like this.
TWO WHEELS AND BIG SIZE: Bike.
TWO WHEELS AND SMALL SIZE: Cycle.
FOUR WHEELS AND BIG SIZE: Truck and Tempo.
GREEN COLOR AND SMALL SIZE: Car.
Here, you did not know learn anything before means no train data and no
response variable. This type of learning is known as unsupervised learning [5].
(3) Reinforcement Learning
A program which interacts with a changing environment and it should perform a
specific goal, without any teacher explicitly telling it whether it has come near to its
goal.

• Game playing. The player knows whether it won or lost, but not how it should
have moved.
• Control: A traffic system can measure the delay of cars, but not know how to
decrease it.
• Robot path planning: Can measure the actual distance traveled.

2 Application of Machine Learning

Example of Machine language is Microsoft cognitive services (Emotion Detection).


In Microsoft, cognitive services machine takes input as image and detects the
person’s behavior—whether she or he is happy, sad, surprise, and so on (Fig. 1).
There are many applications are available which are based on Machine Learning
like NLP Sentiment Analysis (Fig. 2).
In NLP sentiment analysis, machine takes input from user and output as whether
the statement is positive or negative [3].

Fig. 1 Emotion detection


142 H. Desai et al.

Fig. 2 Sentiment analysis

3 Proposed Multi-purposed Automated Question


and Answer Generator Based on Machine Learning

Multi-purposed automated question answer generator is based on supervision or


supervised learning. In this concept, we provide contents (input) to machine and
machine will automatically generate questions from contents and machine also give
the answer to that question automatically. For that, we defined or learn some rules
to the machine so, the machine can generate question automatically and give an
answer to that question automatically.
An Automatic Question Generator in which machine automatically generates the
question from contests so, it is useful for teachers to prepare a assignment or
exercise for students. But in this approach of learning to get an answer of particular
question, teachers have to refer the whole content so, it is a big task for teachers to
prepare a solution of that assignments or exercises and its a time-consuming process
[2].
So, to avoid such a problem we design a—“Multi-purposed Automated question
and answer generator”. In which we design some rules and through rules, we learn
machines. Machines take inputs from the user and based on that contents, machine
will automatically generate the question from input content and also give the
answer of that question at same time. Machine can also find data if we search for
particular questions. So, it reduces the time of teachers to make question bank for
students and make solution of the same. Through this, teachers can also set a
question paper of exams. Through this, one can also get a quiz questions and
answer as well. So, with the uses of multi-purposed automated question and answer
Multi-purposed Question Answer Generator … 143

generator peoples can save their time, without reading anything, they are able to get
questions and answers as well.
We Solve problems by following levels:
(1) First We work with Statements
(2) Next, we work with Multiple statements
(3) Next, we work with Paragraphs
(4) And so on.

4 Sample Data Given to Machine and Its Desired Output

4.1 Sample Design

Consider the following contents and based on this content, machine automatically
generates questions and gives the answer to that question automatically.

Input
There are basically three types of programming languages. (1) machine level lan-
guage, (2) assembly level language and (3) High level language.
(1) Machine level language
Machine level programs only understand binary codes. Programs are in form of
0’s and 1’s. programs are not portable. Not required translator to translate the
program because computer directly understand this language.
(2) Assembly level language
Assembly level programs are not in the forms of 0’s and 1’s so computer cannot
understand this language directly. Assembler tool is used for translation.
Programs are not portable.
(3) High level language
High level programs are not in forms of 0’s and 1’s so computer cannot
understand this language directly. Compiler tool is used for translation.
Programs are portable.
Output

Q-1 How many programming languages are there? Ans. There are three pro-
gramming languages.
Q-2 In which languages programs are not portable?
Ans. Machine level and Assembly level programs are not portable.
Above is the sample question answer. The machine will generate as possible
questions from contents and also give the answers.
144 H. Desai et al.

4.2 Research Design

Figure shows the Research Design of the current study problem (Fig. 3).
There are basically two main steps of design
(1) We train a machine learning model using our existing labeled data. Labeled
data is a data which has been labeled with the outcome which in the case of
types of vehicles example whether the vehicle is an auto or car. This is called—
model training because the model is learning the relationship between the
attributes of the data and the outcome. These attributes might include the
number of wheels, shape, weight, etc.
(2) We make predictions on new data for which we do not know the true outcomes.
In other words, when a new fruit arrives, we want our train model to accurately
predict whether the fruit is an apple or orange without a human examine it.
We want to build machine learning model that accurately predict the labels of
our future vehicles, rather than accurately predicting the labels of vehicles we have
already received [4].

4.3 Tool to Be Used

(1) SciKit tool


(2) Tensor Flow tool
(3) Natural language toolkit (NLTK).

Fig. 3 Design flow


Multi-purposed Question Answer Generator … 145

5 Conclusion

Computers should not be limited to be executing a specific set of instruction to


derive a result. It should evolve and discover new ways to solve problems. Using
multi-purposed question answer generator, one can save their own time and also
save their efforts. They should just give the data to machine and machine auto-
matically generate question and its answer from that data. So, it is very useful to
everyone.

6 Future Scope

Currently, we are working on statements and paragraphs. In future, the proposed


technique can be improved by we can also work on comprehension, articles,
chapters, and also applied on search engine.

References

1. Furnkranz J, Gamberger D, Lavrac N (2012) Machine learning and data mining. In:
Foundation of rule learning. Springer (2012)
2. Ikeda M, Ashley K, ArikIturri T-W (2006) An automatic question generator based on Corpora
and NLP techniques. Springer, Berlin, Heidelberg
3. Collins M (2002) Machine learning methods in natural language processing. MIT CSAIL
4. Sammons M, Srikumar V (2016) An introduction to machine learning and natural language
processing tools. MIAS
5. Donalek C (2011) Supervised and unsupervised learning Ay/Bi 199, Apr 2011

You might also like