Академический Документы
Профессиональный Документы
Культура Документы
BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE & ENGINEERING
by
N.RESHMA – 15BQ1A05D9
N.LAKSHMI TEJASWI – 15BQ1A05E5
P.GAYATHRI SOWJANYA – 15BQ1A05G4
P.CHARITHA – 15BQ1A05F2
This is to certify that this Project Report is the bonafide work of Ms. N. Reshma, Ms.
N.Lakshmi Tejaswi, Ms. P.Gayathri Sowjanya, Ms.P.Charitha bearing Reg.No.
15BQ1A05D9, 15BQ1A05E5 , 15BQ1A05G4, 15BQ1A05F2 who had carried out the project
entitled “ChatBot for movie application” under our supervision.
External Examiner
DECLARATION
DATE :
PLACE :
(N.Reshma)
(N.Lakshmi Tejaswi)
(P.Gayathri Sowjanya)
(P.Charitha)
ACKNOWLEDGEMENT
I take this opportunity to express my deepest gratitude and appreciation to all those people
who made this project work easier with words of encouragement, motivation, discipline, and faith
by offering different places to look to expand my ideas and helped me towards the successful
completion of this project work.
First and foremost, I express my deep gratitude to Mr. Vasireddy VidyaSagar, Chairman,
VasireddyVenkatadri Institute of Technology for providing necessary facilities throughout the
B.Tech programme.
I express my sincere gratitude to Dr. R. Eswarariah, Professor & HOD, Computer Science
& Engineering, Vasireddy Venkatadri Institute of Technology for his constant encouragement,
motivation and faith by offering different places to look to expand my ideas.
I would like to express my sincere gratefulness to my guide Mr. K. Vikas for his insightful
advice, motivating suggestions, invaluable guidance, help and support in successful completion
of this project.
I would like to take this opportunity to express my thanks to the teaching and non-teaching
staff in Department of Computer Science & Engineering, VVIT for their invaluable help and
support.
NALLURI RESHMA
NERELLA LAKSHMI TEJASWI
POTHINENI GAYATHRI SOWJANYA
PEDDU CHARITHA
TABLE OF CONTENTS
i
4.4 Deployment Diagram 49
i
4.5 Screenshots 51
5. Testing 56
5.1 Test Cases 56
6. Conclusion 58
BIBLIOGRAPHY 59
PUBLICATION DETAILS
ii
LIST OF FIGURES
iii
LIST OF TABLES
ChatBots are the programs that attempts to simulate the conversation of human being via
text or voice interactions using Artificial Intelligence Markup language(AIML). Artificial
Intelligence Markup Language (AIML) is a way of making a computer-controlled robot, or
a software think intelligently, in the similar manner the humans think. In this paper we
provide the design of a ChatBot for movie application where user can get complete details
for what they are looking for , which provides an efficient and accurate answer for any
query based on the dataset of FAQs using AIML. Template based and general questions like
welcome/greetings will be responded using AIML that will serve user need. Latent Semantic
Analysis(LSA) is one of the component of Natural Language Processing(NLP).LSA is the
ability of a computer program to understand human language as it is spoken. LSA allows
ChatBots to understand the messages and respond appropriately. This ChatBot is prepared to
get movie details and answer FAQs in an interactive fashion.
v
CHAPTER-1
INTRODUCTION
Now-a-days people are attracting too much for entertainment by watching movies and due to
time constraints and their busy schedule they are willing to complete all the tasks with in a short
span of time , but searching for different movies in different websites is time consuming and is of
long process .To overcome the above problem we creating an efficient Bot which interact with
the user in friendly manner. This bot for movie application is created with the help of AIML and
LSA which is a part of Natural Language Processing(NLP). AIML is an XML based mark up
language used to create Artificial intelligence applications. Latent semantic analysis is used for
processing the query given by the user and compares with the existing questions present in the
database and helps in retrieving the appropriate answer with minimal response time.
There are numerous websites available on World Wide Web which helps to host
our personalized chatbot that can respond intelligently to human queries. These services are used
by many industries, organizations or institutions to service their consumers. One of the most
widely used language for the development of bot is AIML (Artificial Intelligence Markup
Language). This proves to be a deterministic language in terms of development of chat bots.
AIML or Artificial Intelligence Markup Lanuage is an xml base Language used for creating
chatbot (AI),it is always saved with the extension(.aiml). The lack of knowledge can be solved by
providing answers to the questions of what chatbots are, what benefits they bring and how to
create them. An appropriate definition of chatbots can be given by analyzing the fundamental
meaning of the term chatbot and by exploring past and current applications. Use cases of chatbots
can be identified in existing products. Market trends and attributes of media and technology can
be analyzed to find new potential scenarios for the usage of chatbots. Development is best
explained by creating a real chatbot and by using it to present the general principles of the
development process.
Explaining what chatbots are, demystifying what to use them for and presenting how to
create them, will help more people to be able to use and create chatbots, and thereby, accelerate
the development of the chatbot ecosystem. Innovation in technology and the creation of new
solutions can help automating and simplifying more tasks, which gives people the opportunity to
1
focus on more interesting issues and accomplish more things. Chatbots have the potential to do
2
simplify and automate many existing tasks and thereby accelerate the overall technological
progress. The structure of this work follows the three main questions. To begin with, terminology
is defined and applications are explored form a definition and understanding of what chatbots are.
Afterwards use cases of chatbots are identified not only through the collection of existing
examples, but also through the exploration of future potentials by analyzing attributes of the
relevant technologies. The second half of the work is a case study for the development of a
chatbot. The presented example guides through the process of designing user interactions for a
chatbot, and additionally explains architectural decisions and technological choices, which
provide a basis for other developers to build on when creating new chatbots in the future.
The term chatbot consists of two other terms - chat and bot. The meaning can be better
understood by examining the two components separately. The Oxford Dictionary defines chat as
“an informal conversation” and more specifically as “the online exchange of messages in real time
with one or more simultaneous users of a computer network”. As apparent in this definition,
conversations play a central role in chat and therefore chatbots. Other noteworthy aspects of this
definition are the inherent informal format of a chat, and the traits of being online and real time.
Informality does not have to be seen as a strict requirement; however a chat message and, for
example, a classical letter have different degrees of formality. Being online and thereby not bound
to a specific geographic location, device or other physicality can be seen as critical foundation for
determining potential types of systems suitable for such media. The aspect of limiting
communication to real time implies restrictions on possible interactions and sets a baseline for the
expected user experience. This also excludes the usage of certain technologies which do not
support the desired responsiveness.
Bot is defined as being “(chiefly in science fiction) a robot” with the specific
characteristics of representing “an autonomous program on a network (especially the Internet)
which can interact with systems or users, especially one designed to behave like a player in some
video games” . Foremost this provides the information that bots, including chatbots, are
programs. The creation of a chatbot implies the creation of an artifact in the form of a computer
program. Furthermore the aspect of autonomy and the communication over a network can be
connected with the previous described trait of a chat to be online.
1.1 HUMAN COMPUTER INTERACTION(HCI):
● Association for Computing Machinery (ACM): “discipline concerned with the design,
evaluation & implementation of interactive computer systems for human use & with the
study of major phenomena surrounding them” (1992)
● Dix: “HCI is study of people, computer technology and the ways these influence each
other. We study HCI to determine how we can make this computer technology more
usable by people” (1998)
● Carroll: “HCI is the study and practice of usability. It is about understanding and creating
software and other technology that people will want to use, will be able to use, and will
find effective when used.” (2002)
What is HCI?
Human: Individual user, a group of users working together, a sequence of users in an organization
Computer: Desktop computer, large-scale computer system, Pocket PC, embedded system (e.g.,
photocopier, microwave oven), software (e.g., search engine, word processor)
User interface: Parts of the computer that the user contacts with
Interaction: Usually involve a dialog with feedback & control throughout performing a task (e.g.,
user invokes “print” command and then interface replies with a dialog box).
Why HCI?
● In the past, computers were expensive & used by technical people only
● Now, computers are cheap and used by non-technical people (different backgrounds,
needs, knowledge, skills)
● Computer and software manufacturers have noticed the importance of making computers
“user-friendly”: easy to use, save people time, etc.
HCI Scope :
Human: Study psychological & physiological aspects e.g., study how a user learns to use a new
product, study human typing speed
Computer: Hardware & software offered e.g., input & output devices, speed, interaction styles,
computer graphics Development: Design, implementation & evaluation.
Goals of HCI :
● Safety
● Utility
● Effectiveness
● Efficiency
● Usability
● Appeal of systems
CHAPTER-2
AIM AND SCOPE
Most of the existing chatbots are designed using Naive bayes algorithm. This algorithm is
used for text classification and Natural language processing(NLP). By using this algorithm the
output may not be accurate and correct.
Naive Bayes model is easy to build and particularly useful for very large data sets. Along
with simplicity, Naive Bayes is known to outperform even highly sophisticated classification
methods. Bayes theorem provides a way of calculating posterior probability P(c|x) from P(c),
P(x) and P(x|c). Look at the equation below:
Above,
● P(c|x) is the posterior probability of class (c, target) given predictor (x, attributes).
● P(c) is the prior probability of class.
● P(x|c) is the likelihood which is the probability of predictor given class.
● P(x) is the prior probability of predictor.
Advantages :
● It is easy and fast to predict class of test data set. It also perform well in multi class
prediction
● When assumption of independence holds, a Naive Bayes classifier performs better
compare to other models like logistic regression and you need less training data.
● It performs well in case of categorical input variables compared to numerical variable(s).
For numerical variable, normal distribution is assumed (bell curve, which is a strong
assumption).
Disadvantages :
● If categorical variable has a category (in test data set), which was not observed in training
data set, then model will assign a 0 (zero) probability and will be unable to make a
prediction. This is often known as “Zero Frequency”. To solve this, we can use the
smoothing technique. One of the simplest smoothing techniques is called Laplace
estimation.
● On the other side naive Bayes is also known as a bad estimator, so the probability outputs
from predict proba are not to be taken too seriously.
● Another limitation of Naive Bayes is the assumption of independent predictors. In real
life, it is almost impossible that we get a set of predictors which are completely
independent.
It deals with the working of AIML based chat robot. A Java Program is developed which
convert AIML files into database. This program is embedded into website which can in turns help
its customers to develop bots. The major technological enhancement in this research is
integrating speech recognition and text to speech converter. This empowers the bots to respond to
user queries using voice instead of text and humans to chat with bots using voice instead of text
messages.
This will help the student to fetch information like ranking of university, availability of
services, university environment, updates regarding activities happening inside campus and many
more and other academic information.
It describes the linking of chat bot with social network. It describes that how a chat bot
can be linked with Twitter to entertain the users. It can also be used for advertisements. The
bot is
linked with Twitter since it part from a simple concept, the exchange of short messages no longer
7
than 140 characters which drastically reduces the amount of information and the way it is
published. The algorithm process in this bot is divided into three different parts:
Message reception.
Message processing.
Chatbots are of different kinds for all the websites, our chatbot is used for movie
applications to know the details of the movie. This works very accurately than compared to other
chatbots.As soon as we enter the information it redirects to the website that they want.In our
chatbot we use Natural Language Processing(NLP)& Latent Semantic Analysis(LSA) by using
these techniques and the keywords provided our chatbot works very accurately.
The feasibility of the project is analyzed in this phase and the proposal is put forth with a
very general plan for the project and some cost estimates. During system analysis the feasibility
study of the proposed system is to be carried out. This is to ensure that the proposed system is not
a burden to the company. For feasibility analysis, some understanding of the major requirements
for the system is essential.
Three key considerations involved in feasibility are:
1. Technical feasibility
2. Operational feasibility
3. Economic feasibility
2.3.1 Technical feasibility :
Technical feasibility study is the complete study of the project in terms of input,
processes, output, fields, programs and procedures. It is a very effective tool for long term
planning and troubleshooting. The technical feasibility study should most essentially support the
financial information of an organization.
8
After knowing the features the chatbot should support, technical requirements can be
extracted and appropriate technology chosen for the implementation.
Operational feasibility refers to the measure of solving problems with the help of a new
proposed system. It helps in taking advantage of the opportunities and fulfills the requirements as
identified during the development of the project. It takes care that the management and the users
support the project.
Our chatbot works very efficiently to give the correct information about details of their
search. Chatbot also solves the problem in accurate time and provides the solution to the user.
Generally, it means whether a business or a project feasible cost wise and logistically.
Economics calculate economic feasibility by analyzing the costs and revenues a business would
incur by undertaking a certain project. There is no need for user to credit the money for accessing
the website the return for investment can be calculated by the number of times website is used.
CHAPTER-3
CONCEPTS AND METHODS
Now -a-days people are attracting too much for entertainment. One of the way for
relaxing themselves is by watching movies. Due to time constraints and their busy schedule they
are willing to complete all the tasks within a short span of time, but searching for different
movies in different websites is time consuming and is of long process. The mindset of people will
be like their work should be completed with less effort and the result must be with in seconds.
To overcome the above problem we creating an efficient Bot which interact with the user
in friendly manner. In this the user can search for the movie which they want to watch. When the
user enters the movie name which they want to see then it displays the information like where the
movie is playing at what time the show will be present etc. Failure of getting correct results of
movies for which we are searching for in short span of time in different websites and Failure to
identify the inappropriate context in the text message is the main reason for introducing of this
chatbot for movie application. The proposed system solves these issues by developing a bot using
NLP and LSA .
There are numerous websites available on World Wide Web which helps to host our
personalized chatbot that can respond intelligently to human queries. These services are used by
many industries, organizations or institutions to service their consumers. One of the most widely
used language for the development of bot is AIML (Artificial Intelligence Markup Language).
This proves to be a deterministic language in terms of development of chat bots. AIML or
Artificial
Intelligence Markup Language is an xml base Language used for creating chatbot (AI) it is
always saved with the extension(.aiml). The basic units of an AIML dialogs are called
categories .A category consists of
(iii)an optional context. Almost all bots are developed using AIML in which all the possible
queries are enclosed in <pattern> and <template> tags which contains question and answer
respectively.
E.g.
The patterns and template tags are further enclosed in <category> tags. Thousands of
categories tags are used to develop chatting bots. These categories are saved in database when the
bot is compiled or published. When a user sends a message the query pattern is matched with the
pattern’s stored in database and the corresponding template is sent as a response to the user.
1) Atomic categories amongst result and subject and it would react with
Atomic category : It is a sort of AIML classification The chatbot does not comprehend what it is
stating. It just creates about this situation there was a control connecting family and mother. At
that point it needed to create an answer that would urge the client to prevent another question
with the trust of finding a keyword. But more often than not ELIZA gives standard answers if a
keyword where there in the exact match.
In the above illustration if the client submits How are you then the chatbot will answer I am fine is
not found.
Default category : It is a kind of AIML class where the utilization of a wild card symbols, for
example, * is utilized to coordinate any info
<category>
He is my brother
< /category>
In the event that ALICE does not discover an answer utilizing the main classification it continues
to the next.
<pattern>
</template>
Alice: Hi there! User: How old are you? Alice: I am eighteen in computer years
For such situation the wild symbol * is utilized to decrease User: Who is your father? Alice: I was
programmed by Dr.Richard S. Wallace
User: so you are a software program? Alice: Interesting deduction. Thanks and you are a
A. AIML Tags delightful person too. Am I a software program? User: wonderful! So what’s your
favorite food ALICE?
AIML Tags :
AIML files start with tag < aiml > and ends with < /aiml >. It also contains encoding and
version attributes that describes the basic usage of AIML. Version attribute defines AIML version
and encoding attribute describes the character set that is used for 1526 document.
<category>
</ category>
</ aiml>
Multiple < category > tag are used under < aiml > tag. Each < category > tag describes
different knowledge base which is bounded within it. Modeling of this tag is done by using <
category > and < /category > tags . This tag should also contain < pattern > and < template > tags
The < pattern > tag states the possible user entered query. The < pattern > tag appears as a
single tag, and it should be the first most element within < category > tag. Sentences written in
this tag should be separated by unit space. Words within this statement can be replaced by wild
card symbol *.
The < template > stores answer to the user’s query. This tag have the scope within <
category > and it should be written just after < pattern >. Almost all of the chatbot data is
bounded within this tag. Also conditional answers and call to other answers are written within
this tag. Above example shows the use of < template > tag where answer (Hello my new friend!)
is written for the selected pattern.
The < srai > tag shows an important characteristic of AIML. By using < srai > we can
target a multiple < pattern > for a single < template > So AIML interpreter will efficiently answer
for different user input having similar meaning. One can make use of < srai > tag in multiple
ways.
The field of NLP involves making computers to perform useful tasks with the natural languages
humans use. The input and output of an NLP system can be −
● Speech
● Written Text
Components of NLP:
There are two components of NLP as given
Natural Language Understanding (NLU):
Understanding involves the following tasks
It involves
● Text planning − It includes retrieving the relevant content from knowledge base.
Steps in NLP:
● Lexical Analysis − It involves identifying and analyzing the structure of words. Lexicon
of a language means the collection of words and phrases in a language. Lexical analysis
is dividing the whole chunk of text into paragraphs, sentences, and words.
● Syntactic Analysis (Parsing) − It involves analysis of words in the sentence for grammar
and arranging words in a manner that shows the relationship among the words. The
sentence such as “The school goes to boy” is rejected by English syntactic analyzer.
Fig 3.1 : Steps in LSA
● Semantic Analysis − It draws the exact meaning or the dictionary meaning from the text.
The text is checked for meaningfulness. It is done by mapping syntactic structures and
objects in the task domain. The semantic analyzer disregards sentence such as “hot ice-
cream”.
● Discourse Integration − The meaning of any sentence depends upon the meaning of the
sentence just before it. In addition, it also brings about the meaning of immediately
,succeeding sentence.
● Pragmatic Analysis − During this, what was said is re-interpreted on what it actually
meant. It involves deriving those aspects of language which require real world
knowledge.
Current approaches to NLP are based on deep learning, a type of AI that examines and
uses patterns in data to improve a program's understanding. Deep learning models require
massive amounts of labelled data to train on and identify relevant correlations, and assembling
this kind of
big data set is one of the main hurdles to NLP currently. Earlier approaches to NLP involved a
more rules-based approach, where simpler machine learning algorithms were told what words
and phrases to look for in text and given specific responses when those phrases appeared.
Communication: Many communication applications such Facebook Messenger are already using
artificial intelligence. On the whole, Facebook looks very interested in AI. Some months ago,
Facebook announced its M service that promises to become your personal assistant (with the
public launch date tbd): “M can do anything a human can.” When you request something that M
can’t do on its own, it sends a message to a Facebook worker and, as they work with the
software, the AI begins to learn. Another interesting application of natural language processing is
Skype Translator, which offers on-the-fly translation to interpret live speech in real time across a
number of languages. Skype Translator uses AI to help facilitate conversation among people who
speak different languages. This is great news! Without language barriers, people can
communicate using the language they are comfortable with, which will in turn speed up a range
of businesses processes
3.2.3 Latent Semantic Analysis(LSA):
Latent Semantic Analysis arose from the problem of how to find relevant documents from search
words. The fundamental difficulty arises when we compare words to find relevant documents,
because what we really want to do is compare the meanings or concepts behind the words. LSA
attempts to solve this problem by mapping both words and documents into a "concept" space and
doing the comparison in this space. Since authors have a wide choice of words available when
they write, the concepts can be obscured due to different word choices from different authors.
This essentially random choice of words introduces noise into the word-concept relationship.
Latent Semantic Analysis filters out some of this noise and also attempts to find the smallest set
of concepts that spans all the documents.
● The first phase deals with data pre-processing. The result of the first step given as an
input to the second phase.
● The second phase deals with implementation of NLP concepts like the removal of stop
words, stemming, entity recognition, tokenization and parts of speech tagging which
derive keywords from the user typed the message. These keywords compared with user
dictionary to identify irrelevant terms.
● The third phase deals with sending and receiving the messages using the internet and
saving the messages in encrypted form in the real-time database.
Latent Semantic Analysis (LSA), also known as Latent Semantic Indexing (LSI) literally means
analyzing documents to find the underlying meaning or concepts of those documents. If each
word only meant one concept, and each concept was only described by one word, then LSA
would be easy since there is a simple mapping from words to concepts.
Unfortunately, this problem is difficult because English has different words that mean the same
thing (synonyms), words with multiple meanings, and all sorts of ambiguities that obscure the
concepts to the point where even people can have a hard time understanding.
In this LSA we used count matrix algorithm since naive bayes algorithm does not give the
appropriate results.
3.3 SYSTEM ANALYSIS METHODS :
● The boundary, which defines the system of interest in relation to the world around it.
● The actors, usually individuals involved with the system defined according to their
roles.
● The use cases, which are the specific roles played by the actors within and around the
system.
● The relationships between and among the actors and the use cases.
Chatbot system
The control flow is drawn from one operation to another. This flow can be sequential,
branched, or concurrent. Activity diagrams deal with all type of flow control by using different
elements such as fork, join, etc
Activity is a particular operation of the system. Activity diagrams are not only used for
visualizing the dynamic nature of a system, but they are also used to construct the executable
system by using forward and reverse engineering techniques. The only missing thing in the
activity diagram is the message part.
It does not show any message flow from one activity to another. Activity diagram is
sometimes considered as the flowchart. Although the diagrams look like a flowchart, they are
not. It shows different flows such as parallel, branched, concurrent, and single.
Software Requirements:
Operating system : Windows
Coding Language : JAVA
Tool : Net Beans
SOFTWARE ENVIRONMENT :
JAVA:
Java is a programming language and a platform. It is a high level, robust, object-oriented
and secure programming language. Java is an object-oriented programming language. Everything
in Java is an object. Object-oriented means we organize our software as a combination of
different types of objects that incorporates both data and behavior.
Java is very easy to learn, and its syntax is simple, clean and easy to understand. According to
Sun, Java language is a simple programming language because:
● Java syntax is based on C++ (so easier for programmers to learn it after C++).
● Java has removed many complicated and rarely-used features, for example, explicit
pointers, operator overloading, etc.
There are mainly 4 types of applications that can be created using Java programming:
1) Standalone Application:
Standalone applications are also known as desktop applications or window-based
applications. These are traditional software that we need to install on every machine. Examples of
standalone application are Media player, antivirus, etc. AWT and Swing are used in Java for
creating standalone applications.
2) Web Application:
An application that runs on the server side and creates a dynamic page is called a web
application. Currently, Servlet, JSP, Struts, Spring, Hibernate, JSF, etc. technologies are used for
creating web applications in Java.
3) Enterprise Application:
An application that is distributed in nature, such as banking applications, etc. is called
enterprise application. It has advantages of the high-level security, load balancing, and clustering.
In Java, EJB is used for creating enterprise applications.
4) Mobile Application:
An application which is created for mobile devices is called a mobile application.
Currently, Android and Java ME are used for creating mobile applications.
4) JavaFX:
It is used to develop rich internet applications. It uses a light-weight user interface API.
Features of Java:
The primary objective of Java programming language creation was to make it portable, simple
and secure programming language. Apart from this, there are also some excellent features which
play an important role in the popularity of this language. The features of Java are also known as
java buzzwords.
1. Object-Oriented
2. Portable
3. Platform independent
4. Secured
5. Robust
6. Architecture neutral
7. Interpreted
8. High Performance
9. Multithreaded
10. Distributed
11. Dynamic
12. Simple
Java is platform independent because it is different from other languages like C, C++, etc.
which are compiled into platform specific machines while Java is a write once, run anywhere
language. A platform is the hardware or software environment in which a program runs.
There are two types of platforms software-based and hardware-based. Java provides a
software-based platform. The Java platform differs from most other platforms in the sense that it
is a software-based platform that runs on the top of other hardware-based platforms. It has two
components:
1. Runtime Environment
A JavaServer Pages component is a type of Java servlet that is designed to fulfill the role of a
user interface for a Java web application. Web developers write JSPs as text files that combine
HTML or XHTML code, XML elements, and embedded JSP actions and commands.
Using JSP, you can collect input from users through Webpage forms, present records from a
database or another source, and create Webpages dynamically.
JSP tags can be used for a variety of purposes, such as retrieving information from a database or
registering user preferences, accessing JavaBeans components, passing control between pages,
and sharing information between requests, pages etc.
JavaServer Pages often serve the same purpose as programs implemented using the Common
Gateway Interface (CGI). But JSP offers several advantages in comparison with the CGI.
JSP are always compiled before they are processed by the server unlike CGI/Perl which
requires the server to load an interpreter and the target script each time the page is
requested.
27
JavaServer Pages are built on top of the Java Servlets API, so like Servlets, JSP also has
access to all the powerful Enterprise Java APIs, including JDBC, JNDI, EJB, JAXP, etc.
JSP pages can be used in combination with servlets that handle the business logic, the
model supported by Java servlet template engines.
Finally, JSP is an integral part of Java EE, a complete platform for enterprise class applications.
This means that JSP can play a part in the simplest applications to the most complex and
demanding.
● Scriptlet tag
● Expression tag
● Declaration tag
● Directive tag
1. Scriptlet tag :
Scriptlet tag allows to write Java code into JSP file.JSP container moves statements in
_jspservice() method while generating servlet from jsp. For each request of the client, service
method of the JSP gets invoked hence the code inside the Scriptlet executes for every request.A
Scriptlet contains java code that is executed every time JSP is invoked.
Here <%%> tags are scriplets tag and within it, we can place java code.
2. Expression tag :
Expression tag is one of the scripting elements in JSP. Expression Tag in JSP is used for writing
your content on client side. We can use this tag for displaying information on client browser. The
JSP Expression tag transforms the code into an expression statement that converts into a value in
the form of string object and insert into the implicit output object.
Syntax of JSP tag:
3. Declaration tag :
The JSP declaration tag is used to declare fields and methods. The code written inside the jsp
declaration tag is placed outside the service() method of auto generated servlet. So it doesn't get
memory at each request.
4. Directive tag:
Directives can have a number of attributes which you can list down as key-value pairs and
separated by commas. The blanks between the @ symbol and the directive name, and between
the last attribute and the closing %>, are optional.
Class diagram is a static diagram. It represents the static view of an application. Class
diagram is not only used for visualizing, describing, and documenting different aspects of a
system but also for constructing executable code of the software application.
Class diagram describes the attributes and operations of a class and also the constraints
imposed on the system. The class diagrams are widely used in the modeling of object oriented
systems because they are the only UML diagrams, which can be mapped directly with object-
oriented languages.
Actors – An actor in a UML diagram represents a type of role where it interacts with the
system and its objects. It is important to note here that an actor is always outside the scope of the
system we aim to model using the UML diagram.
Fig 3.8 : Notation symbol for actor
We use actors to depict various roles including human users and other external subjects. We
represent an actor in a UML diagram using a stick person notation. We can have multiple actors
in a sequence diagram.
We display a lifeline in a rectangle called head with its name and type. The head is located on top
of a vertical dashed line (referred to as the stem) as shown above. If we want to model an
unnamed instance, we follow the same pattern except now the portion of lifeline’s name is left
blank.
Difference between a lifeline and an actor – A lifeline always portrays an object internal to the
system whereas actors are used to depict objects external to the system. The following is an
example of a sequence diagram
Messages – Communication between objects is depicted using messages. The messages appear in
a sequential order on the lifeline. We represent messages using arrows. Lifelines and messages
from the core of a sequence diagram.
Messages can be broadly classified into the following categories :
A sequence diagram with different types of messages
Synchronous messages – A synchronous message waits for a reply before the interaction can
move forward. The sender waits until the receiver has completed the processing of the message.
The caller continues only when it knows that the receiver has processed the previous message i.e.
it receives a reply message. A large number of calls in object oriented programming are
synchronous. We use a solid arrow head to represent a synchronous message.
Asynchronous Messages – An asynchronous message does not wait for a reply from the
receiver. The interaction moves forward irrespective of the receiver processing the previous
message or not. We use a lined arrow head to represent an asynchronous message.
Create message – We use a Create message to instantiate a new object in the sequence diagram.
There are situations when a particular message call requires the creation of an object. It is
represented with a dotted arrow and create word labelled on it to specify that it is the create
Message symbol.
For example – The creation of a new order on a e-commerce website would require a new object
of Order class to be created.
Delete Message – We use a Delete Message to delete an object. When an object is deallocated
memory or is destroyed within the system we use the Delete Message symbol. It destroys the
occurrence of the object in the system. It is represented by an arrow terminating with a x.
For example – In the scenario below when the order is received by the user, the object of order
class can be destroyed.
Self Message – Certain scenarios might arise where the object needs to send a message to itself.
Such messages are called Self Messages and are represented with a U shaped arrow.
Fig 3.10 : self message
Reply Message – Reply messages are used to show the message being sent from the receiver to
the sender. We represent a return/reply message using an open arrowhead with a dotted line. The
interaction moves forward only when a reply message is sent by the receiver.
Found Message – A Found message is used to represent a scenario where unknown source sends
the message. It is represented using an arrow direct towards a lifeline from an endpoint. For
example: Consider the scenario of a hardware failure.
Fig 3.12 : Found message
Lost Message – A Lost message is used to represent a scenario where the recipient is not known
to the system. It is represented using an arrow directed towards an end point from a lifeline. For
example: Consider a scenario where a warning is generated.
An ER diagram shows the relationship among entity sets. An entity set is a group of
similar entities and these entities can have attributes. In terms of DBMS, an entity is a table or
attribute of a table in database, so by showing relationship among tables and their attributes, ER
diagram shows
the complete logical structure of a database. Let’s have a look at a simple ER diagram to
understand this concept.
Here are the geometric shapes and their meaning in an E-R Diagram.
Ellipses: Attributes
Lines: They link attributes to Entity Sets and Entity sets to Relationship Set
1. Entity
2. Attribute
3. Relationship.
1. Entity :
Weak Entity:
An entity that cannot be uniquely identified by its own attributes and relies on the relationship
with other entity is called weak entity. The weak entity is represented by a double rectangle.
2. Attribute:
An attribute describes the property of an entity. An attribute is represented as Oval in an ER
diagram. There are four types of attributes:
1. Key attribute
2. Composite attribute
4. Derived attribute
3. Relationship:
1. One to one
2. One to many
3. Many to one
4. Many to many
Net Beans:
● User settings
● Storage
● Framework wizard
NetBeans uses components, also known as modules, to enable software development. NetBeans
dynamically installs modules and allows users to download updated features and digitally
authenticated upgrades.
NetBeans IDE modules include NetBeans Profiler, a Graphical User Interface (GUI) design tool,
and NetBeans JavaScript Editor.
NetBeans framework reusability simplifies Java Swing desktop application development, which
provides platform extension capabilities to third-party developers.
Glass fish server : Glass Fish is an open-source application server project started by Sun
Microsystems for the Java EE platform and now sponsored by Oracle Corporation. The supported
version is called Oracle GlassFish Server. GlassFish is free software, dual-licensed under two
free software licences: the Common Development and Distribution License (CDDL) and the
GNU General Public License (GPL) with the classpath exception. GlassFish is the reference
implementation of Java EE and as such supports Enterprise JavaBeans, JPA, Java Server Faces,
JMS, RMI, Java Server Pages, servlets, etc. This allows developers to create enterprise
applications that are portable and scalable, and that integrate with legacy technologies. Optional
components can also be installed for additional services. Built on a modular kernel powered by
OSGi, GlassFish runs straight on top of the Apache Felix implementation. It also runs with
Equinox OSGi or Knopflerfish OSGi runtimes. HK2 abstracts the OSGi module system to
provide components, which can also be viewed as services. Such services can be discovered and
injected at runtime. GlassFish is based on source code released by Sun and Oracle Corporation's
TopLink persistence system. It uses a derivative of Apache Tomcat as the servlet container for
serving Web content, with an added component called Grizzly which uses Java New I/O (NIO)
for scalability and speed.
Notepad: Notepad is a simple text editor for Microsoft Windows and a basic text-editing
program which enables computer users to create documents. It was first released as a mouse-
based MS-DOS program in 1983, and has been included in all versions of Microsoft Windows
since Windows 1.0 in 1985. Notepad is a common text-only (plain text) editor. The resulting files
—typically saved with the .txt extension—have no format tags or styles, making the program
suitable for editing system files to use in a DOS environment and, occasionally, source code for
later compilation or execution, usually through a command prompt. It is also useful for its
negligible use of system resources; making for quick load time and processing time, especially on
underpowered hardware. Notepad supports both left-to-right and right-to-left based languages.
Historically, Notepad did not treat newlines in Unix- or classic Mac OS-style text files correctly.
However, on 8th May 2018, Microsoft announced that they had fixed this issue.[11] Notepad offers
only the most basic text manipulation functions, such as finding text. Only newer versions of
Windows include an updated version of Notepad with a search and replace function.
4.2 COMPONENT DIAGRAM :
The purpose of a component diagram is to show the relationship between different
components in a system. For the purpose of UML , the term "component" refers to a module of
classes that represent independent systems or subsystems with the ability to interface with the rest
of the system.
There exists a whole development approach that revolves around components: component-
based development (CBD). In this approach, component diagrams allow the planner to identify
the different components so the whole system does what it's supposed to do.
More commonly, in an OO programming approach, the component diagram allows a senior
developer to group classes together based on common purpose so that the developer and others
can look at a software development project at a high level.
Benefits of component diagrams
Though component diagrams may seem complex at first glance, they are invaluable when it
comes to building your system. Component diagrams can help your team:
UML is a set of conventions for object-oriented diagrams that has a wide variety of
applications. In component diagrams, the Unified Modeling Language dictates that components
and packages are wired together with lines representing assembly connectors and delegation
connectors.
As with the class notation, components also have an optional space to list interfaces, similar to
the way you add attributes and methods to class notation. Interfaces represent the places where
the groups of classes in the component communicate with other system components. An
alternative way to represent interfaces is by extending symbols from the component box. Here is
a quick rundown of the most commonly used symbols.
In UML, a component diagram visually represents how the components of a software system
relate to one another. To build one, try using Lucidchart custom component diagram shape
library. Component diagrams should communicate:
4.3 IMPLEMENTATION:
Chatbot.java
package com.inst.mychatbot;
import java.io.File;
import org.alicebot.ab.Bot;
import org.alicebot.ab.Chat;
import org.alicebot.ab.History;
import org.alicebot.ab.MagicBooleans;
import org.alicebot.ab.MagicStrings;
import org.alicebot.ab.utils.IOUtils;
public class Chatbot {
private static final boolean TRACE_MODE = false;
static String botName = "super";
public static void main(String[] args)
{ try {
String resourcesPath = getResourcesPath();
System.out.println(resourcesPath);
MagicBooleans.trace_mode = TRACE_MODE;
Bot bot = new Bot("super", resourcesPath);
Chat chatSession = new Chat(bot);
bot.brain.nodeStats();
String textLine = "";
while(true) {
System.out.print("Human : ");
textLine = IOUtils.readInputTextLine();
if ((textLine == null) || (textLine.length() < 1))
textLine = MagicStrings.null_input;
if (textLine.equals("q")) {
System.exit(0);
} else if (textLine.equals("wq")) {
bot.writeQuit();
System.exit(0);
} else {
String request = textLine;
if (MagicBooleans.trace_mode) {
} else {
System.out.println("STATE=" + request + ":THAT=" + ((History)
chatSession.thatHistory.get(0)).get(0) + ":TOPIC=" + chatSession.predicates.get("topic"));
}
String response = chatSession.multisentenceRespond(request);
while (response.contains("<"))
response = response.replace("<", "<");
while (response.contains(">"))
response = response.replace(">", ">");
System.out.println("Robot : " + response);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
AIML CODE:
} catch (Exception e)
{ e.printStackTrace();
}
}
private static String getResourcesPath() {
File currDir = new File(".");
String path = currDir.getAbsolutePath();
path = path.substring(0, path.length() - 2);
System.out.println(path);
String resourcesPath = path + File.separator + "src" + File.separator + "main" +
File.separator + "resources";
return resourcesPath;
}
}
Deployment diagrams are used to visualize the topology of the physical components of a
system, where the software components are deployed. Deployment diagrams are used to
describe the static deployment view of a system. Deployment diagrams consist of nodes and
their relationships. Deployment diagrams are used to visualize the topology of the physical
components of a system, where the software components are deployed. Deployment diagrams
are used to describe the static deployment view of a system. Deployment diagrams consist of
nodes and their relationships.
The term Deployment itself describes the purpose of the diagram. Deployment diagrams are
used for describing the hardware components, where software components are deployed.
Component diagrams and deployment diagrams are closely related.Component diagrams are used
to describe the components and deployment diagrams shows how they are deployed in hardware.
Most of the UML diagrams are used to handle logical components but deployment
diagrams are made to focus on the hardware topology of a system. Deployment diagrams are
used by the system engineers.
49
Deployment Diagram for chatbot :
50
4.5 SCREENSHOTS :
A test case is a specification of the inputs, execution conditions, testing procedure, and expected
results that define a single test to be executed to achieve a particular software testing objective,
such as to exercise a particular program path or to verify compliance with a specific requirement.
Test cases underlie testing that is methodical rather than haphazard. A battery of test cases
can be built to produce the desired coverage of the software being tested. Formally defined test
cases allow the same tests to be run repeatedly against successive versions of the software,
allowing for effective and consistent regression testing.
A test case is also defined as a set of conditions or variables under which a tester will determine
whether a system under test satisfies requirements or works correctly. The process of developing
test cases can also help find problems in the requirements or design of an application.
Ask for movies Gives results based on Gives results based on Accepted
place place
Enters irrelevant Displays error Expects answer for the Rejected
query message entered query
User willing to watch Bot askes to enter Get answer to that Accepted
movie place query as to enter place
User enters the Bot askes for movie Askes to enter the Accepted
location name movie name
User enter the location Bot gives the answer Expected for asking Rejected
for which bot do not as we are out of location
provide service service we will reach
you soon with our
service
User provides the Gives link to reach to Get the link to reach the Accepted
movie name. the movie website movie website
CHAPTER-6
CONCLUSION
[2]. Ramya Ravi,” Intelligent Chatbot for Easy web analytics design”
[3]. Salomon Jakobus du Preez, Manoj Lall and Saurabh Sinha, An Intelligent Web-Based Voice
Chat Bot, in EUROCON 2009, EUROCON '09. IEEE, 2009, p. 386.
[4]. Bhavika R. Ranoliya , Nidhi Raghuwanshi and Sanjay Singh,” Chatbot for University Related
FAQs”
[5]. Salto Martínez Rodrigo, Jacques García Fausto Abraham, Development and Implementation
of a Chat Bot in a Social Network, in Ninth International Conference on Information Technology
- New Generations, 2012, p. 751.
[8] Yoko Nishihara, Masaki Ikuta, Ryosuke Yamanishi, and Junichi Fukumoto,” A Generation
Method of Back-channel Response to Let a Chatting bot Be a Member of Discussions in a Text-
based Chat”, 6th IIAI International Congress on Advanced Applied Informatics,2017
[9] D. De Orlando and F. Giovanni, "An integrated system, with natural language management,
for the monitoring activities in e-Iearning environments," in Complex, Intelligent and Software
Intensive Systems, 2008. CISIS 2008. International Conference on. IEEE, 2008, pp. 965970.
[11] S. du Preez, M. Lall, and S. Sinha, "An intelligent web-based voice chat bot," in EUROCON
2009, EUROCON'09. IEEE. IEEE, 2009, pp. 386-391.
[12] A. Augello, G. Pilato, A. Machi, and S. Gaglio, "An approach to enhance chatbot semantic
power and maintainability: Experiences within the frasi project," in Semantic Computing (ICSC),
2012 IEEE Sixth International Conference on. IEEE, 2012, pp. 186-193.