Professional Documents
Culture Documents
Lofo
Lofo
Lofo
By
Rahul Yerramsetti
Summer 2018
Committee Members
ABSTRACT
An Intelligent Lost and Found System is designed and developed in this project
using Natural Language Processing (NLP) techniques to address the problem of
polysemy in it and is implemented as a highly scalable web service. In general, a
Lost and Found system is implemented with the help of human management into it
for correlating the found items with those of the lost ones, as the existing systems
have not yet been developed to correlate the objects automatically on their own due
to the problem of polysemy in the system data records. The existing systems can
only assist humans in managing such a system but cannot implement it completely
on their own. The proposed system is capable enough to handle this problem with
ease and can be implemented without any human effort for managing it. This can
be achieved by using the NLP techniques. When an item is found by an individual,
he/she can report it to the Intelligent Lost and Found system with its complete
details so that it can be handed over to that individual who lost it. The information
of the reported found items is hidden from other users to tackle the problem of
multiple claims for the object. The system also incorporates a design to preserve
the privacy of the user details from other users using it with the help of an efficient
request handling mechanism. When a lost item is reported to the system by an
individual with its complete details, the system finds a match to this lost item from
its repository of found items and vice versa. The matching is done on the basis
of finding ontological relationships among the object names, similarities among the
colors and performing Semantic analysis using NLP techniques on their descriptions
to obtain various properties about them. When a good match is found the individuals
are communicated about it through their mails.
ii
TABLE OF CONTENTS
CHAPTER Page
ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
TABLE OF CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
LIST OF TABLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Background and Rationale . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Software Literature . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 Natural-language processing . . . . . . . . . . . . . . . . . . . 5
1.2.2 Latent Semantic analysis . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 Topic modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.4 Latent Dirichlet allocation . . . . . . . . . . . . . . . . . . . . 7
1.2.5 Crowdsourcing . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.6 Message-oriented middleware . . . . . . . . . . . . . . . . . . . 8
1.2.7 Spring Framework . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.8 Hibernate ORM Framework . . . . . . . . . . . . . . . . . . . . 9
2 NARRATIVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
CHAPTER Page
4 IMPLEMENTATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.1 Tools Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.2 Code Templates/Snippets . . . . . . . . . . . . . . . . . . . . . . . . 28
4.2.1 Controller Class . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.2.2 Service Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.3 DAO Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2.4 Entity Mapping Class . . . . . . . . . . . . . . . . . . . . . . . 34
4.2.5 RPC via Middle-ware Class . . . . . . . . . . . . . . . . . . . . 35
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
iv
LIST OF TABLES
TABLE Page
LIST OF FIGURES
FIGURE Page
1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
FIGURE Page
27 Confirmation Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
32 Confirmation Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
FIGURE Page
46 Viewing claims . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
48 Claim Accepted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
49 Contact Details of Lost Item user shared with Found Item user . . . 56
50 Contact Details of Found item user shared with Lost Item user . . . 56
1
CHAPTER 1
INTRODUCTION
Many valuable items are lost by people in their day to day life, which are
found by someone else. Though, they are interested in returning the found items to
the appropriate owners there is no such mechanism to facilitate this. To build and
establish such a system to the open public would require lot of costs in employing
people for its maintenance. The Intelligent Lost and Found system is a solution to
deal with these situations in a cost effective and accurate way. The Intelligent Lost
and Found system is a Web Service which can relate a found item to a lost item that
is reported to the system using Natural Language Processing techniques without any
human intervention into it. This is a complete automatic system and is designed to
provide privacy to the user details in it.
The current Lost and Found systems are being maintained at organizational
levels with human workforce involved in managing it. Most of the items can’t be
properly related or found in a timely manner when organization levels are huge.
These include places like Airports, Theme parks, Shopping malls, Universities, Public
Transportation Services etc. Many of these items which were unclaimed are never
reported to be lost and are sold in huge auctions by these organizations. Below are
the details about how it is implemented across various organizational levels.
The Lost and Found Systems are maintained at various airports and almost by
all the airlines. They collect the lost items by the passengers in the airports
2
and store them so that they can be handed over to those passengers who lost
them upon their claims. This service is maintained by sorting and categorizing
the items found by the authorities manually. This manual sorting again can
also cause ambiguity as it is person specific to classify the item. Although they
might have an web interface to the world it satisfies only the communication
needs of the system. These systems are not capable enough to automate this
process. There are many challenges and issues face when implementing these
services. It is a challenging job for the authorities to communicate about the
lost items with passengers from different parts of the world. It involves lot of
time constraints, as all these items needs to be sorted and identified manually,
in the meanwhile the passengers might need to leave the place to catch their
Theme Parks also maintain lost and found services at massive scale. Many
items are lost by public in the theme parks. These are collected and maintained
by them for about 30 days, which are later sold in auctions. The biggest
problem in this scenario is maintaining such huge system. The major problem
lies in its effective identification of its properties during its recognition which is
done manually. In this process many fine distinguishing features of the items
are overlooked, in-turn which again cause further delays during the claiming
process of the object. This is crucial because there can be similar items that
are lost but may have very fine distinguishing characters between them. The
persons sorting and categorizing these may not have an idea on the already
existing objects in the entire system.
3
Public Services like Metro Bus and Rail services etc also maintain Lost and
Found Systems. Many commuters forget their things during their travel, these
items are safely stored and managed so that they can be given to the people
who lost them. The challenge in this scenario is collection of the lost items and
its features identification to sort it.
Many Private and Public Offices, Schools, Universities also implement these
lost and found services at their organizational level. The challenge in these
scenarios is maintaining communication across its organization to maintain this
in this scenario.
One of the most popular available crowd sourced application for Lost and Found
the public. This system is general used to report lost pets. There are many
other such similar applications having the problems like lack of privacy to the
user details and multiple claims. Most of these systems work on the principle
by any rules.
Understanding and crowd-sourcing. This opens the service for use to the open public
rather than an organizational implementation there by expanding its scope of usage.
It could provide fast and accurate results in relating objects and can also handle
large volume of objects and regions. The maintenance of such system would be easy
and cost effective.
The proposed system does this using Natural Language Processing (NLP).
Natural language Processing [6] helps the system in understanding the actual mean-
ing of the textual data given by the users. This in-turn helps in correlating the lost
and found object together based on their relativeness in object names, descriptions,
time, locations etc. Ontological mapping [1] is applied on the object names to iden-
tify their object roots, semantic analysis [5] is done on the descriptions entered by
the users to identify their properties of the objects and correlate them together.
Relational Mapping offered by them. The Java based system is connected to the
Python based NLP system using a Message-oriented middleware technology [4] Rab-
bitMQ which further makes the system more scalable. The database is maintained
to efficiently process and analyze large amounts of natural language data. Chal-
lenges in natural-language processing involve speech recognition, natural-language
understanding, and natural-language generation. In this project we concentrate on
of documents and the terms they contain by producing a set of concepts related to
the documents and terms. LSA assumes that words that are close in meaning will
occur in similar pieces of text (the distributional hypothesis). A matrix containing
word counts per paragraph (rows represent unique words and columns represent each
6
while preserving the similarity structure among columns. Words are then compared
by taking the cosine of the angle between the two vectors (or the dot product between
the normalizations of the two vectors) formed by any two rows. Values close to 1
represent very similar words while values close to 0 represent very dissimilar words.
type of statistical model for discovering the abstract topics that occur in a collection
of documents. Topic modeling is a frequently used text-mining tool for discovery
of hidden semantic structures in a text body. Intuitively, given that a document
is about a particular topic, one would expect particular words to appear in the
document more or less frequently: ”dog” and ”bone” will appear more often in
documents about dogs, ”cat” and ”meow” will appear in documents about cats, and
”the” and ”is” will appear equally in both. A document typically concerns multiple
topics in different proportions; thus, in a document that is 10 percent about cats
and 90 percent about dogs, there would probably be about 9 times more dog words
than cat words. The ”topics” produced by topic modeling techniques are clusters of
similar words [2]. A topic model captures this intuition in a mathematical framework,
which allows examining a set of documents and discovering, based on the statistics
of the words in each, what the topics might be and what each document’s balance
of topics is.
Topic models are also referred to as probabilistic topic models, which refers to
statistical algorithms for discovering the latent semantic structures of an extensive
7
text body. In the age of information, the amount of the written material we encounter
each day is simply beyond our processing capacity. Topic models can help to organize
and offer insights for us to understand large collections of unstructured text bodies.
Originally developed as a text-mining tool, topic models have been used to detect
instructive structures in data such as genetic information, images, and networks.
observed groups that explain why some parts of the data are similar. For example,
if observations are words collected into documents, it posits that each document is
a mixture of a small number of topics and that each word’s creation is attributable
to one of the document’s topics. LDA is an example of a topic model and was first
presented as a graphical model for topic discovery by David Blei, Andrew Ng, and
Michael I. Jordan in 2003.
LDA. This is identical to probabilistic latent semantic analysis (pLSA), except that
in LDA the topic distribution is assumed to have a sparse Dirichlet prior. The sparse
Dirichlet priors encode the intuition that documents cover only a small set of topics
and that topics use only a small set of words frequently. In practice, this results
in a better disambiguation of words and a more precise assignment of documents
to topics. LDA is a generalization of the pLSA model, which is equivalent to LDA
1.2.5 Crowdsourcing
tain goods and services, including ideas and finances, from a large, relatively open
and often rapidly-evolving group of Internet users; it divides work between partici-
ture supporting sending and receiving messages between distributed systems. MOM
allows application modules to be distributed over heterogeneous platforms and re-
duces the complexity of developing applications that span multiple operating systems
works are typically provided by MOM. MOM provides software elements that reside
in all communicating components of a client/server architecture and typically sup-
port asynchronous calls between the client and server applications. MOM reduces
its ability to store (buffer), route, or transform messages while conveying them from
senders to receivers. Another advantage of messaging provider mediated messaging
between clients is that by adding an administrative interface, you can monitor and
tune performance. Client applications are thus effectively relieved of every problem
except that of sending, receiving, and processing messages. It is up to the code
9
that implements the MOM system and up to the administrator to resolve issues like
interoperability, reliability, security, scalability, and performance.
Java application, but there are extensions for building web applications on top of the
Java EE (Enterprise Edition) platform. Although the framework does not impose
any specific programming model, it has become popular in the Java community as
an addition to, or even replacement for the Enterprise JavaBeans (EJB) model. The
Spring Framework is open source.
Central to the Spring Framework is its inversion of control (IoC) container,
which provides a consistent means of configuring and managing Java objects using
reflection. The container is responsible for managing object lifecycles of specific
objects: creating these objects, calling their initialization methods, and configuring
injection. Dependency lookup is a pattern where a caller asks the container object
for an object with a specific name or of a specific type. Dependency injection is
a pattern where the container passes objects by name to other objects, via either
database tables, and mapping from Java data types to SQL data types. Hibernate
also provides data query and retrieval facilities. It generates SQL calls and relieves
the developer from the manual handling and object conversion of the result set.
11
CHAPTER 2
NARRATIVE
2.1 Problem statement
Many objects are lost and found by people on a daily basis. Implementing an
efficient lost and found system is a tough challenge to organizations as they require
human effort to classify and relate the lost item with an found item. The existing
software systems can’t handle this all alone due to the problem of polysemy in data
records of the objects. The people who report lost objects to the system may use a
different words to describe them and the person who found it may use some other
terminology to identify the same object. The existing software systems are not
adequate enough to handle this problem that raised due to polysemy. This problem
of polysemy cannot be completely solved even with the intervention of humans into
the systems. In general Lost and Found Systems are implemented using the principle
of categorization. The humans find the correlation and categorization a difficult task
and ambiguous though the existing software systems are used. Therefore, a complete
automatic Intelligent Lost and Found System is build in this project to handle these
situation.
2.2 Motivation
Items are lost and found by people in their daily life. Among these, there
can be objects of greater significance like certificates, memories, other valuables
etc. Though people who find these objects wants to return them there is no proper
mechanism to facilitate this accurately with privacy. This project has been designed
to serve as a medium to facilitate this need.
12
2.3 Objective
The main objectives in building such a system that can understand the natural
language semantics and interact as a web-service are making the system modularized,
scalable, facilitate cross platform integration of the system components. The design
involves cross platform communications among various components of the system
between Java and Python. At the component level we have the challenge of building
an ontological root relating system among the items, getting the proper contextual
meaning of the descriptions using semantic analysis and topic modeling, establishing
other spatial-temporal correlations among the data records on properties like loca-
tion, time, date, colour etc. The next level of challenge involves in implementing the
NLP system in Python (due to the rich available NLTK library) and its integration
with the Java-based systems (to resolve the issues of high scalability, modularization,
security and ease in project maintenance) on a webserver. The other main challenge
which we need to address in this project is to get precise correlation search results
2.4 Scope
The effort involved in designing this project is a kind of new step into building
based pay as you use model software. It can be used by various Airports around
the world, Airline Companies, Cruise Ships, Rental Cars, Theme Parks like Disney,
Metro Transport services, Schools and Universities, Offices and in many public places.
13
All this could be implemented with least cost and very little human effort.
14
CHAPTER 3
MySQL database is used for storing information records of the users. Using
a secure DAO(Data Access Object) layer the information is communicated in both
directions with application with the help an Object-relational mapping (ORM) tool
hibernate.
A key design principle in Spring MVC is the Open for extension, closed for modi-
fication principle. High flexible data-binding is offered by spring. This framework
consists of three main components: a Controller, a Model Map and a ViewResolver.
Objects form the backbone of a application in Spring and are managed by the Spring
IoC (Inversion of Control) container are called Beans. In Spring Framework, a Bean
is an object that is managed (instantiated, assembled) and maintained by a Spring
16
IoC container. Spring Beans are defined using a Spring configuration file or by an-
notations, instantiated by the Spring container and are injected into the application.
Spring Beans need not to be Java Beans always. Compared to Java Beans, Spring
Beans may not implement java.io.Serializable Interface and can have arguments in
constructor etc.
resolution is highly configurable through file extension or Accept header content type
negotiation, through Bean names, properties file, or even a custom ViewResolver im-
plementation. The model (the M in MVC) is a Map interface, which allows for the
complete abstraction of the view technology. You can integrate directly with tem-
plate based rendering technologies such as JSP, Velocity and Freemarker, or directly
generate XML, JSON, Atom, and many other types of content. The model Map is
simply transformed into an appropriate format, such as JSP request attributes, a
Velocity template model etc.
It plays an crucial role in cross platform integration of the Java based back-end
system with the Python-subsystem that consists of the NLP implementations in a
Procedure Calls (RPC). The defining features of AMQP [4] are message orientation,
queuing, routing (including point-to-point and publish-and-subscribe), reliability and
security. It is a wire-level protocol. A wire-level protocol is a description of the for-
mat of the data that is sent across the network as a stream of bytes. Consequently,
any tool that can create and interpret messages that conform to this data format can
inter-operate with any other compliant tool irrespective of implementation language.
This component of the system is also implemented on the server and is com-
municated with the Java Back-end System with the help of RabbitMQ MOM. This
component houses the real power of resolving the polysemy problem in the applica-
tion. It uses advanced NLP techniques like Latent Semantic analysis, Named Entity
Recognition, Parts of Speech Tagging (POS) [9] [8], etc for processing information
given by the user to obtain its inner meaning. We have used the Natural Language
Toolkit (NLTK 3) library for implementing the NLP Subsystem. It contains over
50 corpora and lexical resources such as WordNet, along with a suite of text pro-
software. The main aim of the UML diagrams is to help users understand about
interaction between different components of the application.
Use case diagram consists of the actors and the use cases. Actor represents
the role played by the user or any external system whereas the use cases describe the
functionality of the application.
Figure 2 shows the use case diagram for the Lost and Found System. It
consists of two actors i.e., Lost Item User and Found Item User. It is made up of
six use cases Search Lost Item, Search Found Item, Report Lost Item, Report Found
Item, Claim Match Item and Accept Request.
Figure 2: Use Case Diagram for Intelligent Lost and Found System.
1. Search Lost Item: This use case represents the actions of searching and retriev-
ing the details of the queried Lost Record.
19
2. Search Found Item: This use case represents the actions of searching and re-
trieving the details of the queried Found Record.
3. Report Lost Item: This use case represents the actions of saving the Lost record
and then matching it with the relevant Found Records using the designed NLP
based mechanism in the database.
4. Report Found Item: This use case represents the actions of saving the Found
record and then matching it with the relevant Lost Records using the designed
NLP based mechanism in the database.
5. Claim Match Item: This use case represents the action of claiming a matched
Found item by the Lost Item user. This claim appears as a request to the
6. Accept Request: This use case represents the action of Accepting or Declining
the Claim Request by the Found Item User. If user Accepts the claim request,
the contact details of Requester are exchanged with Accepting User through
The relationship between different classes and objects can be shown using a
class diagram. The arrows are used to illustrate the relationship between different
classes.
Figure. 3 shows the Class Diagram for the Intelligent Lost and Found System.
As the system is built using the Spring MVC and Hibernate ORM Frameworks
we have a three layered Class Diagram which includes the Presentation Layer, the
Service Layer and the Persistence Layer.
20
1. Presentation Layer:
This layer consists of the controllers that handles the incoming requests and
The Controller Class is the Classic controller which is annotated with the
annotation which is used for request handling methods. The request handling
method is annotated with @ResponseBody. This annotation enables automatic
serialization of the return object into the HttpResponse. The Controller class
acts as a classic Spring MVC handler to the basic Lost and Found web appli-
cation with JSP’s as view components.
handler to the application that outputs its response as JSON or XML objects.
2. Service Layer:
The Service Layer Consists of the classes that hold the business logic of the
application. They act as mediating logic layer between the Controller and the
Data Repository. Here in this application we have a LostServiceImpl, Found-
ServiceImpl Classes which has methods that can fetch, save, perform matching
based on the system design principles using NLP in the application. They in-
tegrate with a NLP based Python subsystem system using a Message-oriented
middle-ware (RabbitMQ) for cross platform communication. The ReqServi-
ceImpl class has all the methods that deal with item claiming and information
dissipation for establishing a communication link between Lost Item user and a
Found Item User safeguarding privacy and security of the users in the systems.
3. Persistence Layer:
The Persistence Layer consists of all the classes that enable communication
between the application and the Database. It deals with storing and retrieving
data from a database. It consists of the DAO (Data Access Object) classes
that provides access to the database operations and Entity classes that fa-
cilitate Object Relational Mapping. The DAO classes handles the database
operation required to manipulate entity or object and the Entity classes map
22
able to the service layer for processing. Here in this application Hibernate
ORM framework is used as a persistence provider.The LostDAO, FoundDAO,
ReqHandlDAO Classes in this layer provide access to database operations on
Lost, Found and Request tables in the database. The entity classes LostEntity,
FoundEntity and ReqEnitity map Java Objects with Lost, Found and Request
tables in the database. They consists of the Mappings, default constructors
4. NLP Class:
Toolkit) for natural language processing, achieve faster load free synchronized
execution via a Message-oriented middleware (MOM) like RabbitMQ. Various
NLP operations are applied on texts to obtain the root meaning of the item-
Spell Corrections, Topic Modeling, POS tagging( parts of speech tagging) and
NER (Named Entity Recognition) are used for analyzing text and extracting
their semantics. This class also contains the RPC functions to communicate
with the Java subsystem via MOM RabbitMQ using a Request/reply pattern.
23
3.4 Work-flow
In this section, we explore the work-flow of the Intelligent Lost and Found
or people and what conditions allow the sequence to move forward. There are four
different work-flow paths in this project and they are discussed as follows.
In this case we explore the workflow for saving a Lost Item record by a Lost
Item user (referred as the user in this case). The Lost Item user enters the lost
item record using the lost item form web-page.
This data is stored in a lost item table and the user is notified about successful
saving of the record in the system through an email. He/She will be issued
24
an Tracking ID through email once the record is successfully saved. Next, the
system performs a similarity matching of this lost item record with the found
matching results if any such similar found records existed in the system. The
user can view the details of the matching found records result list if any existed.
It is not recommended to claim for the object unless until the user finds an
legitimate match to his record as the found user who receives this request can
decline it and the user cannot claim another object if a more satisfying result
is found. He/She will be able to place the claim again either only after the
found user declines his/her claim or wait for other three days. Therefore, it is
advisable to wait for a week (depending upon how fast the lost item is reported
to the system) or so and claim the object using the tracking module. The user
will be notified through email when when a matching found record is entered
into system. He can view its details by using the tracking section with his ID.
He/She can view the matches in the tracking section and claim it if his/her lost
item appears to be found. The user will be notified about the status of his/her
claim record through email. If the Claim is accepted the contact details of the
Lost Item user will be exchanged with the Found Item user.
In this case we explore the workflow for saving a Found Item record by a Found
Item user (referred as the user in this case) . The Found Item user enters the
Found item record using the found item form web-page.
25
This data is stored in a found item table and user is notified about the successful
saving of the record in the system through an email. He/She will be issued
an Tracking ID through email once the record is successfully saved. Next, the
system performs a similarity matching of this found item record with the lost
item records in the database using Natural Language Processing, Ontology
mapping, color matching, etc., in the above specified fashion. It follows a
weighting schema for prioritizing the search results. If any matching similar
lost records are found, the system then sends emails to matching Lost record
users. The Found Item user receives email when some lost item user claims
their object. The Found Item user can view these claim request using the
tracking system with the help of his ID. The user then examines the lost item
record of the claimer and accepts the request if it is legitimate or else declines
it. If the Claim is accepted the contact details of the Found Item user will be
exchanged with the Lost Item user.
26
Figure 6: Work-flow diagram for Claiming Found Record from Matching list.
In this case we explore the workflow for Claiming Found Record from Matching
list by a Lost Item user (referred as the user in this case) . When a Lost Item
user receives email about a new match being found, he/she opens the tracking
system and enter his/her Tracking ID to view the Found Matching records.
The user examines each found record in detail and claims it if finds that it is
his/her lost item. A claim request will be placed by him/her to the Found Item
user. When the Found Item user accepts this request the contact details of the
Lost Item user will be exchanged with the Found Item user.
27
In this case we explore the workflow for Dealing with Claim Requests by a
Found Item user (referred as the user in this case) . When a Found Item user
receives email about a new claim request placed he opens the tracking system
and enter his Tracking ID to view the Claim requests. The user then examines
the lost item record of the claimer and accepts the request if it is legitimate or
else declines it. If the Claim is accepted the contact details of the Found Item
user will be exchanged with the Lost Item user.
28
CHAPTER 4
IMPLEMENTATION
4.1 Tools Used
(e) Web Technologies: JavaScript, jQuery, CSS, Bootstrap, XML, JSTL, HTML;
chitecture and ready components that can be used to develop flexible and loosely
29
coupled web applications. The MVC pattern results in separating the different as-
pects of the application (input logic, business logic, and UI logic), while providing a
• The Model encapsulates the application data and in general, they will consist
of POJO.
• The View is responsible for rendering the model data and in general it generates
HTML output that the client’s browser can interpret.
• The Controller is responsible for processing user requests and building an ap-
a DispatcherServlet that handles all the HTTP requests and responses. On Recieve-
ing an incoming HTTP request the DispatcherServlet consults the HandlerMapping
to call the appropriate Controller. The Controller takes the request and calls the
appropriate service methods based on used GET or POST method. The service
method will set model data based on defined business logic and returns view name
to the DispatcherServlet. The DispatcherServlet will take help from ViewResolver to
pickup the defined view for the request.Once view is finalized, the DispatcherServlet
passes the model data to the View which is finally rendered on the browser.
The code templates of the main structural components explaining the concept
of Dependency Injection which have been implemented in this project are discussed
below.
30
The Controller class is responsible for processing the user requests, building
this application. The @Controller annotation defines the class as a Spring MVC con-
troller. Here, the first usage of @RequestMapping indicates that all handling methods
on this controller are relative to the /lnfbase path. Next annotation @RequestMap-
ping is responsible for handing the /showsortedcases path call by implementing the
CustomersCases method. We inject the Statservice to this controller class using the
@Autowired annotation. This annotation allows Spring to resolve and inject collab-
orating Beans into your Bean. Next we get the Sorted Cases from the StatService
class, which is added to the model and forwarded to the view component.
The Service layer contains all the business logic of the application. The Ser-
vice layer consists of an interface and its implementing class that contains various
methods which define the services offered by the application. This layer implements
a Service Facade design pattern into the application architecture. This design helps
to address the problem of coupling the core service logic to contracts and implemen-
tation resources that inhibit its evolution and negatively impact service consumers.
The DAO (Data Access Object) class is responsible for interacting with un-
derlying Database. Our DAO needs a Hibernate SessionFactory to communicate to
the database via the Hibernate framework and the Hibernate SessionFactory needs
a Data Source which defines the database connections. All these dependencies are
wired together using the Dependency Injection. In Figure 11, we have a code snippet
of a DAO interface StatDAO which is implemented in the following Figure 12 by a
contains all Database related property details pulled from either hibernate.cfg.xml
file or hibernate.properties file.
Next, the HQL(Hibernate Query Language) query is executed using the cus-
tomers entity mapping class. The obtained results are then returned to the Service
Layer Class.
The entire concept of Hibernate is to take the values from Java class attributes
and persist them to a database table. The Entity Mapping Class helps Hibernate
in determining how to pull the values from the classes and map them with table
and associated fields. To implement an efficient mapping these classes are written
in Plain Old Java Object (POJO) programming model. The POJO name is used
to emphasize that a given object is an ordinary Java Object, not a special object,
and in particular not an Enterprise JavaBean. Using Hibernate Annotations, all the
metadata is clubbed into the POJO Java file along with the code, which helps the user
understand the table structure and POJO simultaneously during the development.
In general it consists of the attributes relating to that of the columns in a table
declared private, have getter and setter methods and a default constructor.
In Figure 13, a code snippet of a Entity Mapping class is shown consisting
of the attributes mapping to the columns in the table, default constructor, getter
and methods. The @Entity annotation in Figure 13 is used to mark this class as an
entity Bean. The next annotation @Table allows to specify the details of the table
that will be used to persist the entity in the database. The @Id annotation is used to
annotate the primary key of a entity Bean and the @GeneratedValue annotation is
used to automatically assign the entity identifier using the IDENTITY column in the
following Figure 13. The next annotation @Column is used to specify the details of
the column to which a field will be mapped by explicitly specifying the name of the
35
column in the table. Using these annotations together with the POJO programming
model the Customer Object is efficiently designed and mapped with the stat table
in the database.
cedure call, without the programmer explicitly coding the details for the remote
36
interaction. Here we use this pattern for cross platform integration among two dif-
ferent subsystems implemented on different platforms namely Java and Python. To
utilize this pattern we build a client and scalable RPC server. Here in this archi-
tecture the Java Subsystem acts as the client and the Python systems responses to
it as the RPC server. A client sends a request message and a server replies with a
RPC Server receives this request process it and sends back the result as a reply to
Java Client. The message communication takes place using the AMQP protocol in
the form of a String data-type. In Figure 14, a code snippet implement this RPC
Figure 14: Code snippet implementing the RPC message pattern on a Java client.
37
CHAPTER 5
polysemy in it using NLP and observe its responsiveness. To do this four use cases
are fed to the system. Three different lost item records (Case: 1, Case: 2 , Case:
3) with similar properties and a found item record matching to one of the three lost
items (Case: 1) are entered into the system and tested for efficiency in correlating
the lost item records with found item record.
The UI for Home Page of the application is shown in Figure 15. First the
38
found item is reported to the system by a Found Item user. The user clicks the
Found Image on the home page to navigate to the found form to fill the details.
Figure 16: Scenario of Reporting a Found Item into the system (Case: 1).
As shown in Figure 16, the user enters the details of the found item (assume
this entry as Case: 1), describes it in detail, uploads an image of the object and
submits his/her entry. Once these details are submitted, the system validates and
saves them in the database. Next, it processes (as shown in Figure 17) for finding a
Matching Lost record to the Found record and if a similar match is found, it notifies
the Lost Item user through their email about a new match being found.
39
Figure 17: Processing of the submitted Found Record Details (Case: 1).
Next, the lost item is reported to the system by a lost item user. As shown
in Figure 16, the user enters the details of the lost item, describes it in detail and
submits his/her entry.
Once these details are submitted, the system validates and saves them in the
database. Next, it processes for finding a Matching Found Record to the Lost record
submitted (as shown in Figure 21) and if a similar match is found the lost record is
shown (Figure 23) which can be claimed (if that is the exact item which was lost). It
is not recommended to claim the object at this instant, if he/she is doubtful about
the shown object. The user can claim it later using the tracking system by giving
space for the found users to report more found items that could contain the lost users
item (exact item which was lost).
Next, a new found item (Case: 2) similar to the lost item with similar item
name, slight variation in color, time, date and description is reported to the system
Figure 25: Scenario of Reporting another Found Item into the system (Case: 2).
44
Once these details are submitted, the system processes as shown in Figure 26
and finds a Matching Lost Record to the Found record submitted. When a match is
found, it notifies the Lost Item user through their email as shown in Figure 29.
Again, a new found item (Case: 3) similar to the lost item with similar item
name, slight variation in color, time, date and description is reported to the system
as shown in Figure 30.
46
Figure 30: Scenario of Reporting another Found Item into the system (Case: 3).
Once the details in Figure 30 are submitted the system processes as shown
in Figure 31 and searches for a Match in Lost Records similar to the Found record
submitted, as there are no matches found to this found record among the lost records,
no further action is taken. Figure 34 shows the details of the submitted found Case:
3 from the tracking section.
48
Now let us (representing the lost user) track the status of the submitted lost
item to see if any new matches are found similar to this record using the tracking
Here, in Figure 38 we see that there are two matches found by the system
(Case: 1 , Case: 2) out of the submitted three records. The lost user examines each
of the matches in detail as shown in Figures 39 40 and claims the record if the Lost
user’s item existed among these matches.
51
Out of these two items, Found Item in Case: 1 shown in Figure 40 is claimed
by the Lost user. (as this is the item which we are looking for the system to show
up)
An email notification is sent to the Found Item user about the claim request
of the Lost Item user as shown in Figure 42.
Figure 42: Email Notification to Found Item user about new Claim.
53
The Found Item user views this claim request to take an action against it
using the tracking module as shown in Figures 43, 44, 45 and 46.
Once the Found item user accepts the claim request (shown in Figure 47)
both their contact details are exchanged with one another through emails as shown
Figure 49: Contact Details of Lost Item user shared with Found Item user.
Figure 50: Contact Details of Found Item user shared with Lost Item user.
Out of three similar found records submitted to the system against a lost record,
only two most similar records (Case: 1, Case: 2) have been found to be similar. One
case. Though they do not have the same colors, they are of a close range. The
interactive color picker in the UI helped tackling the issue of fuzziness in describing
the color by the user. Their descriptions are also almost similar, both are of the
same brand Tommy Hilfiger and both of them contained one $20 note and three $5
notes and found at library. Although, the Found item in Case: 2 had some extra
attributes into it, these were not considered by the filtering system as majority of the
properties matched with the lost Item described in Figure 20. The Case: 3 item was
discarded by the filtering system because even tough it had the same entity name
and brand name, its properties differed in other aspects as shown in Figure 37. It is
black in color which is not in close range to the lost item color (i.e., Brown). It was
found in a different location and none of the items in its description matched with
that of the items in the Lost record. Hence this item was rejected from the match
list. The system is also tested with many other use cases like (Cap, Hat), (Chain,
Necklace), (Book, Record), (Ring, Jewelery) etc and was found to be working with
good accuracy.
A survey on user experience was performed for this application on the basis of
factors like User Interface Design, Application Responsiveness, System Performance,
score out of 10. The details about these ratings are shown in Table 5.1 as follows:
Effectiveness 10 9 10 9 10 9.6
CHAPTER 6
In this project an efficient Intelligent Lost and Found system was successfully
built as a web service addressing the problem of polysemy in it using NLP. It offers
a high degree of user privacy in its design. A complete automatic system that is
independent on humans intervention for management was built in this project. An
efficient architecture has been developed to take the advantage of the Java based
frameworks (Spring MVC, Hibernate ORM) in building an effective web service and
is integrated with a Python subsystem to utilize the rich NLP libraries of the NLTK
However, the system could have achieved more efficiency if customized NLTK learn-
ing models were used. This requires initial implementation of this prototype to
collect the data records so as to implement such models. The system could ad-
dress specific streamlined cases like correlating lost and found objects in motion like
trains, buses etc if this system was implemented at an organizational levels (Metro
Systems, Railways etc). Another important requirement for an effective experience
customized NLP trained models. This can be only achieved once the application is
implemented and such data records are collected to build customized models. The
system can also be improved by adding Fuzzy Logic System to the location section
of the application. A mobile application extending the web service could be built to
reach more users.
61
REFERENCES
[2] Du, L., Pate, J. K., and Johnson, M. Topic models with topic ordering
regularities for topic segmentation. In 2014 IEEE International Conference on
[3] Fang, Y., Huang, H., Jian, P., Xin, X., and Feng, C. Self-adaptive
topic model: A solution to the problem of rich topics get richer. China Com-
munications 11, 12 (Dec 2014), 35–43.
[5] Hussain, F., Qamar, U., and Zeb, S. A novel approach for searching
[6] Shchitov, I., Lagutina, K., Lagutina, N., Paramonov, I., and Vasi-
lyev, A. A survey on thesauri application in automatic natural language pro-
[7] Tu, H. T., Phan, T. T., and Nguyen, K. P. An adaptive latent semantic
analysis for text mining. In 2017 International Conference on System Science
[9] Yuan, L. Improvement for the automatic part-of-speech tagging based on hid-
[10] Zhang, D. Y., Wang, D., Zheng, H., Mu, X., Li, Q., and Zhang, Y.
Large-scale point-of-interest category prediction using natural language process-
ing models. In 2017 IEEE International Conference on Big Data (Big Data)
(Dec 2017), pp. 1027–1032.