RELEVANT MULTIMEDIA QUESTION ANSWERING
A PROJECT REPORT
PRASANTH.G - 100105901019
SURYA.B - 100105901034
VEMBARASU.L - 100105901039
in partial fulfillment for the award of the degree
BACHELOR OF ENGINEERING
COMPUTER SCIENCE AND ENGINEERING
DR.NALLINI INSTITUTE OF ENGINEERING AND TECNOLOGY
ANNA UNIVERSITY OF TECHNOLOGY::CHENNAI-600 025
ANNA UNIVERSITY OF TECHNOLOGY:CHENNAI-600 025
Certified that this project report “RELEVANT MULTIMEDIA QUESTION
ANSWER” is the bonafide work of “PRASANTH.G, SURYA.B,
VEMBARASU.L” Who carried out the project work under my supervision.
Mr.P.MANIVANNAN M.TECH., Mr.S.ANANDHASARAVANAN ME.,
HEAD OF THE DEPARTMENT SUPERVISOR
Department Of Computer Science Department Of Computer Science
Dr.Nallini Institute Of Engineering Dr.Nallini Institute Of Engineering
and Tecnology and Tecnology
Dharapuram – 638 673 Dharapuram – 638 673
Submitted To University Viva Examination Held On……………………………
INTERNAL EXAMINER EXTERNAL EXAMINER
First of all i thank god almighty for all his blessings our heartfelt
thankfulness goes to our honorable chairman Dr.S.APPUSWAMY,
M.S.,PH.D.,F.I.C.M.,M.R.S.H.(LOND) for having provided us with the
entire necessary infra structure and other facilities for his extensive support to
successfully carry out this project.
I extend our gratitude to Dr.E.RAMASAMY, M.TECH.,Ph.D, principal,
Dr.Nallini institute of engineering &technolongy,Dharapuram, for his high degree
of encouragement and moral support during the course of this project.
I extremely happy for expressing our heartfelt gratitude to
Mr.P.MANIVANNAN M.TECH.,head of the department ,department of
computer science engineering, Dr.Nallini institute of
engineering&technology,Dharapuram, for extending all possible works and also
his valuable guidance in making this project a grand success.
I extent our honest gratitude to Mr.S.ANANDHASARAVANAN
M.E.,department of computer science engineering ,Dr.Nallini institute of
engineering & technology, Dharapuram.
I thank all teaching & non teaching staffs of computer science engineering
department who have helped us during the course of our project.
I am also express gratitude towards our parents and friends for their valuable help.
In general, while searching in search engine one would search for an exact
answer for his query. In the existing QA forums, it usually provide only textual
answers which are not informative enough for real queries. In this paper, we
propose the scheme that is able to enrich the textual answers with appropriate
media data. By processing a large set of question answer, this approach can enable
a multimedia question answering(MMQA). MMQA research offers that attempt to
directly answer questions with image and video data. In my approach, we propose
to contribute textual answers and able to deal with more complex queries.To
enhance the above said process, propose a scheme named “WSMA” to enrich text
answers with image & video and able to take relevance and diversity into account
by exploring the content retreival.
TABLE OF CONTENTS
CHAPTER NO TITLE PAGE NO
LIST OF TABLES Iv
LIST OF FIGURES V
LIST OF ABBREVIATIONS Vi
1 INTRODUCTION 01
2 LITERATURE SURVEYS 04
2.1Multimedia Answering: Enriching Text
QA with Media Information
2.2Knowledge Sharing and Yahoo Answers:
Everyone Knows Something
2.3Automatic Set Expansion for List
2.4Semi-supervised kernel density estimation
for video annotation
2.5Photo-based Question Answering 06
3 SYSTEM ANALYSIS 07
3.1 Existing System 07
3.2 Proposed System 08
LIST OF TABLES
TABLE NO TITLE PAGE NO
3.1 Sample questions answerable by template-based QA
3.2 Illustration of QA Event Elements 10
LIST OF FIGURES
TABLE NO TITLE PAGE
3.1 Images In Our Pilot Dataset 09
3.2 Illustration of QA Event Elements 10
4.1 Stateless XML Web services model 15
4.2 .net Architecture 16
4.3 Inside The Common Language Runtime 19
4.4 Visual Basic compiler options dialog 20
4.5 The JIT process and verification 21
4.6 The .NET Framework class library. 22
5.1 Architectural Diagram 35
LIST OF ABBREVIATIONS
MLMIL Multilabel Multi-Instance Learning
HCRFs Hidden Conditional Random Fields
SSKDE Semisupervised Kernel Density Estimation
KDE Kernel Density Estimation
SSAKDE Semi-Supervised Adaptive Kernel Density Estimation
MMQA Multimedia Question Answering
SMTP Simple Mail Transfer Protocol
SOAP Simple Object Access Protocol
CIL Common Intermediate Language
GUI Graphical User Interface
ECMA European Computer Manufacturers Association
Question-answering (qa) is a technique for automatically answering a
question posed in natural language compared to keyword-based search systems, it
greatly facilitates the communication between humans and computers by naturally
stating users’ intention in plain sentences. It also avoids the painstaking browsing
of a vast quantity of information contents returned by search engines for the correct
answers. However, fully automated QA still faces challenges that are not easy to
tackle, such as the deep understanding of complex questions and the sophisticated
syntactic, semantic and contextual processing to generate answers. It is found that,
in most cases, automated approach cannot obtain results that are as good as those
generated by human intelligence. Along with the proliferation and improvement of
underlying communication technologies, community QA (cQA) has emerged as an
extremely popular alternative to acquire information online, owning to the
First, information seekers are able to post their specific questions on any
topic and obtain answers provided by other participants. By leveraging community
efforts, they are able to get better answers than simply using search engines.
Second, in comparison with automated QA systems, cQA usually receives answers
with better quality as they are generated based on human intelligence. Third, over
times, a tremendous number of QA pairs have been accumulated in their
repositories, and it facilitates the preservation and search of answered questions.
For example, Wiki Answer, one of the most well-known cQA systems, hosts more
than 13 million answered questions distributed in 7,000
categories. Despite their great success, existing cQA forums mostly support
only textual answers. Unfortunately, textual answers may not provide sufficient
natural and easy-to grasp information. For the questions “What are the steps to
make a weather vane” and “What does $1 Trillion Look Like”, the answers are
described by long sentences. Clearly, it will be much better if there are some
accompanying videos and images that visually demonstrate the process or the
object. Therefore, the textual answers in cQA can be significantly enhanced by
adding multimedia contents, and it will provide answer seekers more
comprehensive information and better experience.
In fact, users usually post URLs that link to supplementary images or videos
in their textual answers. For example, for the questions , the best answers on Y!A
both contain video URLs. It further confirms that multimedia contents are useful in
answering several questions. But existing cQA forums do not provide adequate
support in using media information.
In this paper, we propose a novel scheme which can enrich community-contributed
textual answers in cQA with appropriate media data. It contains three main
(1) Answer medium selection. Given a QA pair, it predicts whether the textual
answer should be enriched with media information, and which kind of media data
should be added. Specifically, we will categorize it into one of the four classes. It
means that the scheme will automatically collect images, videos, or the
combination of images and videos to enrich the original textual answers.
(2) Query generation for multimedia search. In order to collect multimedia data,
we need to generate informative queries. Given a QA pair, this component extracts
three queries from the question, the answer, and the QA pair, respectively. The
most informative query will be selected by a three-class classification model.
(3) Multimedia data selection and presentation. Based on the generated queries, we
vertically collect image and video data with multimedia search engines. We then
perform reranking and duplicate removal to obtain a set of accurate and
representative images or videos to enrich the textual answers.
2.1 Multimedia Answering: Enriching Text QA with Media Information:
In this paper, we introduce a scheme that is able to enrich text answers with
image and video information. Our scheme investigates a rich set of techniques
including question/answer classification, query generation, image and video search
reranking, etc. Given a question and the community-contributed answer, our
approach is able to determine which type of media information should be added,
and then automatically collects data from Internet to enrich the textual answer.
Different from some efforts that attempt to directly answer questions with image
and video data, our approach is built based on the community-contributed textual
answers and thus it is more feasible and able to deal with more complex questions.
We have conducted empirical study on more than 3,000 QA pairs and the results
demonstrate the effectiveness of our approach.
2.2 Knowledge Sharing and Yahoo Answers: Everyone Knows Something
In this paper, we seek to understand YA’s knowledge sharing activity. We
analyze the forum categories and cluster them according to content characteristics
and patterns of interaction among the users. While interactions in some categories
resemble expertise sharing forums, others incorporate discussion, everyday advice,
and support. With such a diversity of categories in which one can participate, we
find that some users focus narrowly on specific topics, while others participate
across categories. This not only allows us to map related categories, but to
characterize the entropy of the users’ interests. We find that lower entropy
correlates with receiving higher answer ratings, but only for categories where
factual expertise is primarily sought after. We combine both user attributes and
answer characteristics to predict, within a given category, whether a particular
answer will be chosen as the best answer by the asker.
2.3 Automatic Set Expansion for List Question Answering
This paper explores the use of set expansion (SE) to improve question
answering (QA) when the expected answer is a list of entities belonging to a
certain class. Given a small set of seeds, SE algorithms mine textual resources to
produce an extended list including additional members of the class represented by
the seeds. We explore the hypothesis that a noise-resistant SE algorithm can be
used to extend candidate answers produced by a QA system and generate a new list
of answers that is better than the original list produced by the QA system. We
further introduce a hybrid approach which combines the original answers from the
QA system with the output from the SE algorithm. Experimental results for
severalstate-of-the-art QA systems show that the hybrid system performs better
than the QA systems alone when tested on list question data from past TREC
2.4 Semi-supervised kernel density estimation for video annotation
In this paper, we propose a novel semi-supervised learning algorithm named
semisupervised kernel density estimation (SSKDE) which is developed based on
kernel density estimation (KDE) approach. While only labeled data are utilized in
classical KDE, in SSKDE both labeled and unlabeled data are leveraged to
estimate class conditional probability densities based on an extended form of KDE.
It is a non-parametric method, and it thus naturally avoids the model assumption
problem that exists in many parametric semi-supervised methods. Meanwhile, it
can be implemented with an efficient iterative solution process. So, this method is
appropriate for video annotation. Furthermore, motivated by existing adaptive
KDE approach, we propose an improved algorithm named semi-supervised
adaptive kernel density estimation (SSAKDE). It employs local adaptive kernels
rather than a fixed kernel, such that broader kernels can be applied in the regions
with low density. In this way, more accurate density estimates can be obtained.
Extensive experiments have demonstrated the effectiveness of the proposed
2.5 Photo-based Question Answering
A photo-based QA system allows direct use of a photo to refer to the object.
We develop a three-layer system architecture for photo-based QA that brings
together recent technical achievements in question answering and image matching.
The first, template-based QA layer matches a query photo to online images and
extracts structured data from multimedia databases to answer questions about the
photo. To simplify image matching, it exploits the question text to filter images
based on categories and keywords. The second, information retrieval QA layer
searches an internal repository of resolved photo-based questions to retrieve
relevant answers. The third, human-computation QA layer leverages community
experts to handle the most difficult cases. A series of experiments performed on a
pilot dataset of 30,000 images of books, movie DVD covers, grocery items, and
landmarks demonstrate the technical feasibility of this architecture. We present
three prototypes to show how photo-based QA can be built into an online album,
a text-based QA, and a mobile application.
3.1 EXISTING SYSTEM:
• In existing, we propose a scheme that is able to enrich textual answers in
cQA with appropriate media data.
• Increasing exposure by the use of web harvesting is essential for a business
wishing to expand online.
• It then automatically collects data from the web to enrich the answer.
• By processing a large set of QA pairs and adding them to a pool, our
approach can enable a novel multimedia question answering (MMQA)
approach as users can find multimedia answers by matching their questions
with those in the pool.
• No content retreival.
ISSUES IN EXISTING SYSTEM:
• The system may fail to generate reasonable multimedia answers if the
generated queries are verbose and complex.
• Relevant and irrelevant datas will generate
• Non automated maintenance
3.2 PROPOSED SYSTEM:
• We proposes a relevance reranking scheme which is able to simultaneously
take relevance data and diversity into account.
• It takes advantage of both the content of images and their associated
• It estimates the relevance scores of images with respect to the query term based
on both the visual information, images and the semantic information of
associated multimedia datas.
• Here, we propose “WSMA” to enrich text answers with image & video and able
to take relevance and diversity into account by exploring the content of images.
It investigates a rich set of techniques :
1) Question/Answer classification.
2) Query generation.
3) image and video search re-ranking.
TABLE 3.1 Sample questions answerable by the
template-based QA layer.
Fig 3.1 Images in our pilot dataset.
CATEGORY SAMPLE QUESTIONS
ALL What is it?
Is it in stock?
How much is this on Amazon?
Where can I buy it?
What is its rating?
What is its review?
Is there a sequel?
Is there a blue-ray edition?
What is its boxoffice?
Who is the director?
Is it a fiction?
Is there a paperback edition?
Who is the author?
Where is it?
Who is the architect?
When was it built?
WH-Question QA Event Elements
Who/Whose/Whom Subject, Object
What Subject, Object, Description, Action
Which Subject, Object
How Quantity, Description
Table 3.2 Correspondence of WH-Questions & Event Elements
Figure 3.2 Illustration of QA Event Elements
The benefits from solving the above challenge would be enormous. Potential
applications include 1) a formalized machine-readable encyclopedia that can be
queried with high precision like a semantic database; 2) a key asset for
disambiguating entities by supporting fast and accurate mappings of textual
phrases onto named entities in the knowledge base; 3) an enabler for entity-
relation- ship-oriented semantic search on the Web, for detecting entities and
relations in Web pages and reasoning about them in expressive (probabilistic)
logics; 4) a backbone for natural-language question answering that would aid in
dealing with entities and their relationships in answering who/where/when/ etc.
questions; 5) a catalyst for acquisition of further knowledge and largely automated
maintenance and growth of the knowledge base
Operating system : Windows XP Professional
Environment : Visual Studio .NET 2008
.Net framework : Version 3.5
Language : C#.NET
Web technology : ASP.NET
Backend : SQL SERVER 2005
PROCESSOR : PENTIUM III 866 MHz
RAM : 128 MD SD RAM
MONITOR : 15” COLOR
HARD DISK : 20 GB
FLOPPY DRIVE : 1.44 MB
CD DRIVE : LG 52X
KEYBOARD : STANDARD 102 KEYS
MOUSE : 3 BUTTONS
• Microsoft C#. Net used as front end tool. The reason for selecting C# dot
Net as front end tool as follows:
• C#. Net has flexibility , allowing one or more language to interoperate to
provide the solution. This Cross Language Compatibility allows to do
project at faster rate.
• C#. Net has Common Language Runtime , that allows all the component to
converge into one intermediate format and then can interact.
• C#. Net has provide excellent security when your application is executed in
• C#.Net has flexibility, allowing us to configure the working environment to
best suit our individual style. We can choose between a single and multiple
document interfaces, and we can adjust the size and positioning of the
various IDE elements.
• C#. Net has Intelligence feature that make the coding easy and also
Dynamic help provides very less coding time.
• The working environment in C#.Net is often referred to as Integrated
Development Environment because it integrates many different functions
such as design, editing, compiling and debugging within a common
environment. In most traditional development tools, each of separate
program, each with its own interface.
• The C#.Net language is quite powerful – if we can imagine a programming
task and accomplished using C#.Net.
• After creating a C#. Net application, if we want to distribute it to others we
can freely distribute any application to anyone who uses Microsoft windows.
We can distribute our applications on disk, on CDs, across networks, or over
an intranet or the internet.
• Toolbars provide quick access to commonly used commands in the
programming environment. We click a button on the toolbar once to carry
out the action represented by that button. By default, the standard toolbar is
displayed when we start Visual Basic. Additional toolbars for editing, form
design, and debugging can be toggled on or off from the toolbars command
on the view menu.
• Many parts of C# are context sensitive. Context sensitive means we can get
help on these parts directly without having to go through the help menu. For
example, to get help on any keyword in the C#language, place the insertion
point on that keyword in the code window and press F1.
• C# interprets our code as we enter it, catching and highlighting most syntax
or spelling errors on the fly. It’s almost like having an expert watching over
our shoulder as we enter our code.
FEATURES OF DOTNET
When .NET was announced in late 1999, Microsoft positioned the
technology as a platform for building and consuming Extensible Markup Language
(XML) Web services. XML Web services allow any type of application, be it a
Windows- or browser-based application running on any type of computer system,
to consume data from any type of server over the Internet. The reason this idea is
so great is the way in which the XML messages are transferred: over established
standard protocols that exist today. Using protocols such as SOAP, HTTP, and
SMTP, XML Web services make it possible to expose data over the wire with little
or no modifications to your existing code. Figure 4.1 presents a high-level
overview of the .NET Framework and how XML Web services are positioned.
Stateless XML Web services model.
Since the initial announcement of the .NET Framework, it's taken on many new
and different meanings to different people. To a developer, .NET means a great
environment for creating robust distributed applications. To an IT manager, .NET
means simpler deployment of applications to end users, tighter security, and
simpler management. To a CTO or CIO, .NET means happier developers using
state-of-the-art development technologies and a smaller bottom line. To understand
why all these statements are true, you need to get a grip on what the .NET
Framework consists of, and how it's truly a revolutionary step forward for
application architecture, development, and deployment.
Now that you are familiar with the major goals of the .NET Framework,
let's briefly examine its architecture. As you can see in Figure 3-2, the .NET
Framework sits on top of the operating system, which can be a few different
flavors of Windows and consists of a number of components .NET is essentially a
system application that runs on Windows. Conceptually, the CLR and the JVM are
similar in that they are both runtime infrastructures that abstract the underlying
platform differences. However, while the JVM officially supports only the Java
language, the CLR supports any language that can be represented in its Common
Intermediate Language (CIL).
Fig 4.2 .net Architecture
The JVM executes byte code, so it can, in principle, support many
languages, too. Unlike Java's byte code, though, CIL is never interpreted. Another
conceptual difference between the two infrastructures is that Java code runs on any
platform with a JVM, whereas .NET code runs only on platforms that support the
CLR. In April, 2003, the International Organization for Standardization and the
International Electro technical Committee (ISO/IEC) recognized a functional
subset of the CLR, known as the Common Language Interface (CLI), as an
This development, initiated by Microsoft and developed by ECMA
International, a European standards organization, opens the way for third parties to
implement their own versions of the CLR on other platforms, such as Linux or
Mac OS X. For information on third-party and open source projects working to
implement the ISO/IEC CLI and C# specifications. The layer on top of the CLR is
a set of framework base classes. This set of classes is similar to the set of classes
found in STL, MFC, ATL, or Java. These classes support rudimentary input and
output functionality, string manipulation, security management, network
communications, thread management, text management, reflection functionality,
collections functionality, as well as other functions.
On top of the framework base classes is a set of classes that extend
the base classes to support data management and XML manipulation. These
classes, called ADO.NET, support persistent data management—data that is stored
on backend databases. Alongside the data classes, the .NET Framework supports a
number of classes to let you manipulate XML data and perform XML searching
and XML translations .Classes in three different technologies (including web
services, Web Forms, and Windows Forms) extend the framework base classes and
the data and XML classes.
Web services include a number of classes that support the
development of lightweight distributed components, which work even in the face
of firewalls and NAT software. These components support plug-and-play across
the Internet, because web services employ standard HTTP and SOAP. Web Forms,
the key technology behind ASP.NET, include a number of classes that allow you to
rapidly develop web Graphical User Interface (GUI) applications.
If you're currently developing web applications with Visual Interdev, you
can think of Web Forms as a facility that allows you to develop web GUIs using
the same drag-and-drop approach as if you were developing the GUIs in Visual
Basic. Simply drag-and-drop controls onto your Web Form, double-click on a
control, and write the code to respond to the associated event. Forms support a set
of classes that allow you to develop native Windows GUI applications. You can
think of these classes collectively as a much better version of the MFC in C++
because they support easier and more powerful GUI development and provide a
common, consistent interface that can be used in all languages.
THE COMMON LANGUAGE RUNTIME:
At the heart of the .NET Framework is the common language runtime. The
common language runtime is responsible for providing the execution environment
that code written in a .NET language runs under. The common language runtime
can be compared to the Visual Basic 6 runtime, except that the common language
runtime is designed to handle all .NET languages, not just one, as the Visual Basic
6 runtime did for Visual Basic 6. The following list describes some of the benefits
the common language runtime gives you
• Automatic memory management
• Cross-language debugging
• Cross-language exception handling
• Full support for component versioning
• Access to legacy COM components
• XCOPY deployments
• Robust security model
You might expect all those features, but this has never been possible using
Microsoft development tools. Figure 10.3 shows where the common language
runtime fits into the .NET Framework.
The common language runtime and the .NET Framework.
Fig 4.3 INSIDE THE COMMON LANGUAGE RUNTIME
The common language runtime enables code running in its execution
environment to have features such as security, versioning, memory management
and exception handling because of the way .NET code actually executes. When
you compiled Visual Basic 6 forms applications, you had the ability to compile
down to native node or p-code. Figure 3.4 should refresh your memory of what the
Visual Basic 6 options dialog looked like.
Fig 4.4 Visual Basic compiler options dialog.
When you compile in .NET, you're converting your code—no matter what
.NET language you're using—into an assembly made up of an intermediate
language called Microsoft Intermediate Language (MSIL or just IL, for short). The
IL contains all the information about your application, including methods,
properties, events, types, exceptions, security objects, and so on, and it also
includes metadata about what types in your code can or cannot be exposed to other
applications. This was called a type library in Visual Basic 6 or an IDL (interface
definition language) file in C++. In .NET, it's simply the metadata that the IL
contains about your assembly.
Fig 4.5 The JIT process and verification.
When code is JIT compiled, the common language runtime checks to make sure
that the IL is correct. The rules that the common language runtime uses for
verification are set forth in the Common Language Specification (CLS) and the
Common Type System (CTS).
THE .NET FRAMEWORK CLASS LIBRARY
The second most important piece of the .NET Framework is the .NET
Framework class library (FCL). As you've seen, the common language runtime
handles the dirty work of actually running the code you write. But to write the
code, you need a foundation of available classes to access the resources of the
operating system, database server, or file server. The FCL is made up of a
hierarchy of namespaces that expose classes, structures, interfaces, enumerations,
and delegates that give you access to these resources. The namespaces are logically
defined by functionality. For example, the System. Data namespace contains all the
functionality available to accessing databases.
This namespace is further broken down into System.Data.SqlClient, which
exposes functionality specific to SQL Server, and System.Data.OleDb, which
exposes specific functionality for accessing OLEDB data sources. The bounds of a
namespace aren't necessarily defined by specific assemblies within the FCL; rather,
they're focused on functionality and logical grouping. In total, there are more than
20,000 classes in the FCL, all logically grouped in a hierarchical manner. Figure
1.8 shows where the FCL fits into the .NET Framework and the logical grouping
Fig 4.6 the .NET Framework class library.
To use an FCL class in your application, you use the Imports statement
in Visual Basic .NET or the using statement in C#. When you reference a
namespace in Visual Basic .NET or C#, you also get the convenience of auto-
complete and auto-list members when you access the objects' types using Visual
Studio .NET. This makes it very easy to determine what types are available for
each class in the namespace you're using. As you'll see over the next several
weeks, it's very easy to start coding in Visual Studio .NET.
THE STRUCTURE OF A .NET APPLICATION
To understand how the common language runtime manages code execution, you
must examine the structure of a .NET application. The primary unit of a .NET
application is the assembly. An assembly is a self-describing collection of code,
resources, and metadata. The assembly manifest contains information about what
is contained within the assembly. The assembly manifest provides:
• Identity information, such as the assembly’s name and version number
• A list of all types exposed by the assembly
• A list of other assemblies required by the assembly
• A list of code access security instructions, including permissions required by
the assembly and permissions to be denied the assembly
Each assembly has one and only one assembly manifest, and it contains
all the description information for the assembly. However, the assembly manifest
can be contained in its own file or within one of the assembly’s modules. An
assembly contains one or more modules. A module contains the code that makes
up your application or library, and it contains metadata that describes that code.
When you compile a project into an assembly, your code is converted
from high-level code to IL. Because all managed code is first converted to IL code,
applications written in different languages can easily interact. For example, one
developer might write an application in Visual C# that accesses a DLL in Visual
Basic .NET. Both resources will be converted to IL modules before being
executed, thus avoiding any language-incompatibility issues. Each module also
contains a number of types.
Types are templates that describe a set of data encapsulation and
functionality. There are two kinds of types: reference types (classes) and value
types (structures). These types are discussed in greater detail in Lesson 2 of this
chapter. Each type is described to the common language runtime in the assembly
manifest. A type can contain fields, properties, and methods, each of which should
be related to a common functionality. For example, you might have a class that
represents a bank account. It contains fields, properties, and methods related to the
functions needed to implement a bank account. A field represents storage of a
particular type of data. One field might store the name of an account holder, for
example. Properties are similar to fields, but properties usually provide some kind
of validation when data is set or retrieved. You might have a property that
represents an account balance.
When an attempt is made to change the value, the property can check
to see if the attempted change is greater than a predetermined limit. If the value is
greater than the limit, the property does not allow the change. Methods represent
behavior, such as actions taken on data stored within the class or changes to the
user interface. Continuing with the bank account example, you might have a
Transfer method that transfers a balance from a checking account to a savings
account, or an Alert method that warns users when their balances fall below a
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Programming in the .NET Framework environment is done with objects.
Objects are programmatic constructs that represent packages of related data and
functionality. Objects are self-contained and expose specific functionality to the
rest of the application environment without detailing the inner workings of the
object itself. Objects are created from a template called a class. The .NET base
class library provides a set of classes from which you can create objects in your
applications. You also can use the Microsoft Visual Studio programming
environment to create your own classes. This lesson introduces you to the concepts
associated with object-oriented programming.
OVERVIEW OF ADO.NET
Most applications require some kind of data access. Desktop applications
need to integrate with central databases, Extensible Markup Language (XML) data
stores, or local desktop databases. ADO.NET data-access technology allows
simple, powerful data access while maximizing system resource usage. Different
applications have different requirements for data access. Whether your application
simply displays the contents of a table, or processes and updates data to a central
SQL server, ADO.NET provides the tools to implement data access easily and
DISCONNECTED DATABASE ACCESS
Previous data-access technologies provided continuously connected data
access by default. In such a model, an application creates a connection to a
database and keeps the connection open for the life of the application, or at least
for the amount of time that data is required. However, as applications become more
complex and databases serve more and more clients, connected data access is
impractical for a variety of reasons, including the following:
• Open database connections are expensive in terms of system resources. The
more open connections there are, the less efficient system performance
• Applications with connected data access are difficult to scale. An application
that can comfortably maintain connections with two clients might do poorly
with 10 and be completely unusable with 100.
• Open database connections can quickly consume all available database licenses,
which can be a significant expense. In order to work within a limited set of
client licenses, connections must be reused whenever possible.
ADO.NET addresses these issues by implementing a disconnected data
access model by default. In this model, data connections are established and left
open only long enough to perform the requisite action. For example, if an
application requests data from a database, the connection opens just long enough to
load the data into the application, and then it closes. Likewise, if a database is
updated, the connection opens to execute the UPDATE command, and then closes
By keeping connections open only for the minimum required time, ADO.NET
conserves system resources and allows data access to scale up with a minimal
impact on performance.
ADO.NET DATA ARCHITECTURE
Data access in ADO.NET relies on two entities: the Dataset, which stores
data on the local machine, and the Data Provider, a set of components that
mediates interaction between the program and the database.
The Dataset is a disconnected, in-memory representation of data. It can be
thought of as a local copy of the relevant portions of a database. Data can be
loaded into a Dataset from any valid data source, such as a SQL Server database, a
Microsoft Access database, or an XML file. The Dataset persists in memory, and
the data therein can be manipulated and updated independent of the database.
When appropriate, the Dataset can then act as a template for updating the central
The Dataset object contains a collection of zero or more Data Table objects,
each of which is an in-memory representation of a single table. The structure of a
particular Data Table is defined by the Data Columns collection, which enumerates
the columns in a particular table, and the Constraint collection, which enumerates
any constraints on the table. Together, these two collections make up the table
schema. A Data Table also contains a Data Rows collection, which contains the
actual data in the Dataset.
The Dataset contains a Data Relations collection. A Data Relation object
allows you to create associations between rows in one table and rows in another
table. The Data Relations collection enumerates a set of Data Relation objects that
define the relationships between tables in the Dataset. For example, consider a
Dataset that contains two related tables: an Employees table and a Projects table. In
the Employees table, each employee is represented only once and is identified by a
unique Employee field. In the Projects table, an employee in charge of a project is
identified by the Employee field, but can appear more than once if that employee is
in charge of multiple projects. This is an example of a one-to-many relationship;
you would use a Data Relation object to define this relationship. Additionally, a
Dataset contains an Extended Properties collection, which is used to store custom
information about the Dataset.
THE DATA PROVIDER
The link to the database is created and maintained by a data provider. A data
provider is not a single component; rather it is a set of related components that
work together to provide data in an efficient, performance-driven manner. The first
version of the Microsoft .NET Framework shipped with two data providers: the
SQL Server .NET Data Provider, designed specifically to work with SQL Server 7
or later, and the Loeb .NET Data Provider, which connects with other types of
databases. Microsoft Visual Studio .NET 2005 added two more data providers: the
ODBC Data Provider and the Oracle Data Provider. Each data provider consists of
versions of the following generic component classes:
• The Connection object provides the connection to the database.
• The Command object executes a command against a data source. It can
execute non-query commands, such as INSERT, UPDATE, or DELETE, or
return a Data Reader with the results of a SELECT command.
• The Data Reader object provides a forward-only, read-only, connected
• The Data Adapter object populates a disconnected Dataset or Data Table
with data and performs updates.
Data access in ADO.NET is facilitated as follows: a Connection object
establishes a connection between the application and the database. This connection
can be accessed directly by a Command object or by a Data Adapter object. The
Command object provides direct execution of a command to the database. If the
command returns more than a single value, the Command object returns a Data
Reader to provide the data. This data can be directly processed by application
logic. Alternatively, you can use the Data Adapter to fill a Dataset object. Updates
to the database can be achieved through the Command object or through the Data
Adapter. The generic classes that make up the data providers are summarized in
the following sections.
THE CONNECTION OBJECT
The Connection object represents the actual connection to the database.
Visual Studio .NET 2003 supplies two types of Connection classes: the
SqlConnection object, which is designed specifically to connect to SQL Server 7 or
later, and the OleDbConnection object, which can provide connections to a wide
range of database types. Visual Studio .NET 2003 further provides a multipurpose
ODBCConnection class, as well as an Oracle Connection class optimized for
connecting to Oracle databases. The Connection object contains all of the
information required to open a channel to the database in the Connection String
property. The Connection object also incorporates methods that facilitate data
THE COMMAND OBJECT
The Command object is represented by two corresponding classes,
SqlCommand and OleDbCommand. You can use Command objects to execute
commands to a database across a data connection. Command objects can be used
to execute stored procedures on the database and SQL commands, or return
complete tables. Command objects provide three methods that are used to execute
commands on the database.
Executes commands that return no records, such as INSERT, UPDATE, or
Returns a single value from a database query
Returns a result set by way of a DataReader object
THE DATA READER OBJECT
The Data Reader object provides a forward-only, read-only, connected
stream record set from a database. Unlike other components of a data provider,
Data Reader objects cannot be directly instantiated. Rather, the Data Reader is
returned as the result of a Command object’s ExecuteReader method. The
SqlCommand.ExecuteReader method returns a SqlDataReader object, and the
OleDbCommand.ExecuteReader method returns an OleDbDataReader object.
Likewise, the ODBC and Oracle Command.ExecuteReader methods return a
DataReader specific to the ODBC and Oracle Data Providers respectively. The
DataReader can supply rows of data directly to application logic when you do not
need to keep the data cached in memory.
THE DATAADAPTER OBJECT
The DataAdapter is the class at the core of ADO.NET disconnected data
access. It is essentially the middleman, facilitating all communication between the
database and a DataSet.The DataAdapter provides four properties that represent
database commands. The four properties are:
• SELECT COMMAND
Contains the command text or object that selects the data from the database.
This command is executed when the Fill method is called and fills a Data
Table or a DataSet.
• INSERT COMMAND
Contains the command text or object that inserts a row into a table.
• DELETE COMMAND
Contains the command text or object that deletes a row from a table.
• UPDATE COMMAND
Contains the command text or object that updates the values of a
When the Update method is called, changes in the DataSet are copied back to the
database, and the appropriate Insert Command, Delete Command, or Update
Command is executed.
Visual Studio .NET has many built-in wizards and designers to help you
shape your data-access architecture rapidly and efficiently. With minimal actual
coding, you can implement robust data access for your application. However, the
ADO.NET object model is fully available through code to implement customized
features or to fine-tune your program.
FEATURES OF SQL SERVER
The OLAP Services feature available in SQL Server version 7.0 is now called
SQL Server 2000 Analysis Services. The term OLAP Services has been replaced
with the term Analysis Services. Analysis Services also includes a new data mining
component. The Repository component available in SQL Server version 7.0 is now
called Microsoft SQL Server 2000 Meta Data Services. References to the
component now use the term Meta Data Services.
SQL-SERVER database consist of six type of objects, They are,
A database is a collection of data about a specific topic.
VIEWS OF TABLE:
We can work with a table in two types,
1. Design View
2. Datasheet View
A query is a question that has to be asked the data. Access gathers data that
answers the question from one or more table. The data that make up the answer
is either dynaset (if you edit it) or a snapshot (it cannot be edited).Each time we
run query, we get latest information in the dynaset. Access either displays the
dynaset or snapshot for us to view or perform an action on it, such as deleting or
A form is used to view and edit information in the database record by
record .A form displays only the information we want to see in the way we
want to see it. Forms use the familiar controls such as textboxes and
checkboxes. This makes viewing and entering data easy.
VIEWS OF FORM:
We can work with forms in several primarily there are two views,
• Design View
• Form View
To build or modify the structure of a form, we work in forms design view.
We can add control to the form that are bound to fields in a table or query,
includes textboxes, option buttons, graphs and pictures.
The form view which display the whole design of the form.
A report is used to views and print information from the database. The
report can ground records into many levels and compute totals and average by
checking values from many records at once. Also the report is attractive and
distinctive because we have control over the size and appearance of it.
A macro is a set of actions. Each action in macros does something. Such as
opening a form or printing a report .We write macros to automate the common
tasks the work easy and save the time.
Modules are units of code written in access basic language. We can write and
use module to automate and customize the database in very sophisticated ways.
5.1 ARCHITECTURAL DIAGRAM:
Relevance ranking algorithm:
There exist multiple variations of neighborhood-based CF
techniques. In this paper, to estimate R*(u, i), i.e., the rating that user u would give
to item i, we first compute the similarity between user u and other users u' using a
cosine similarity metric.
Formula : for finding prediction by using recommendation techniques:
Where I (u, u') represents the set of all items rated by both user u and user u'. Based
on the similarity calculation, set N (u) of nearest neighbors of user u is obtained.
The size of set N (u) can range anywhere from 1 to |U|-1, i.e., all other users in the
Then, R*(u, i) is calculated as the adjusted weighted sum of all
known ratings R (u', i) Here R (u) represents the average rating of user u. A
neighborhood-based CF technique can be user-based or item-based, depending on
whether the similarity is calculated between users or items, the user-based
approach, but they can be straightforwardly rewritten for the item-based approach
because of the symmetry between users and items in all neighborhood-based CF
calculations. In our experiments we used both user-based and item-based
approaches for rating estimation
• Posting the opinion
• Recommendation Technique
• Rating Prediction
• Ranking Approach
6.2 MODULES DESCRIPTION
POSTING THE OPINION:
In this module, we get the opinions from various people about business,
e-commerce and products through online. The opinions may be of two types.
Direct opinion and comparative opinion. Direct opinion is to post a comment about
the components and attributes of products directly. Comparative opinion is to post
a comment based on comparison of two or more products. The comments may be
positive or negative.
The quality of recommendations can be evaluated along a number of
dimensions, and relying on the accuracy of recommendations alone may not be
enough to find the most relevant items for each User, these studies argue that one
of the goals of recommender systems is to provide a user with highly personalized
items, and more diverse recommendations result in more opportunities for users to
get recommended such items. With this motivation, some studies proposed new
recommendation methods that can increase the diversity of recommendation sets
for a given individual user. They can give the feedback of such items.
First, the ratings of unrated items are estimated based on the
available information (typically using known user ratings and possibly also
information about item content) using some recommendation algorithm. Heuristic
techniques typically calculate recommendations based directly on the previous user
activities (e.g., transactional data or rating values). For each user, ranks all the
predicted items according to the predicted rating value ranking the candidate
(highly predicted) items based on their predicted rating value, from lowest to
highest (as a result choosing less popular items).
Ranking items according to the rating variance of neighbors of a
particular user for a particular item. There exist a number of different ranking
approaches that can improve recommendation diversity by recommending items
other than the ones with topmost predicted rating values to a user. A
comprehensive set of experiments was performed using every rating prediction
technique in conjunction with every recommendation ranking function on every
dataset for different number of top-N recommendations.
In this paper, we describe the motivation and evolution of WSMA, and it is
analyzed that the existing approaches mainly focus on narrow domains. Aiming at
a more general approach, we propose a novel scheme to answer questions using
media data by leveraging textual answers in cQA. For a given QA pair, our scheme
first predicts which type of medium is appropriate for enriching the original textual
answer. Following that, it automatically generates a query based on the QA
knowledge and then performs multimedia search with the query. Finally, query-
adaptive reranking and duplicate removal are performed to obtain a set of images
and videos for presentation along with the original textual answer. Different from
the conventional WSMA research that aims to automatically generate multimedia
answers with given questions, our approach is built based on the community-
contributed answers, and it can thus deal with more general questions and achieve
public partial class adminlogin : System.Web.UI.Page
SqlConnection con = new
protected void Button1_Click(object sender, EventArgs e)
SqlCommand cmd=new SqlCommand ("select count(*) from login where
uid='"+TextBox1 .Text +"' and pwd='"+ TextBox2 .Text +"' ", con);
int c = Convert .ToInt32 (cmd.ExecuteScalar());
if (c > 0)
Label3.Text = "successful";
Label3.Text = "Invalid Data";
public partial class Askquest : System.Web.UI.Page
SqlConnection con = new
protected void Page_Load(object sender, EventArgs e)
DateTime d = Convert.ToDateTime(DateTime.Now.ToLongTimeString());
Label3.Text = d.ToString();
Label6.Text = Session["uid"].ToString();
protected void Button1_Click(object sender, EventArgs e)
string str = "insert into askqust (ques,qdetail,mailfrom,today)values ('" +
TextBox5.Text + "','" + TextBox1.Text + "','" + Label6.Text + "','" + Label3.Text +
TextBox1.Text = "";
TextBox5.Text = "";
public partial class docdetails : System.Web.UI.Page
SqlConnection con = new
protected void Page_Load(object sender, EventArgs e)
string qry = string.Empty;
qry="select *from askqust where qid='"+Request.QueryString["id"]+"'";
DataSet ds=new DataSet();
if (ds != null)
protected void Button1_Click(object sender, EventArgs e)
string vfilename = string.Empty;
string filename = string.Empty;
public partial class docregister : System.Web.UI.Page
catch (Exception ex)
if (con.State == ConnectionState.Open)
public partial class search : System.Web.UI.Page
DataTable dt = new DataTable();
protected void Button1_Click(object sender, EventArgs e)
SqlConnection connection = new
SqlCommand command = new SqlCommand("SELECT * from replydata where
ques like '%"+TextBox1.Text+"%' ", connection);
SqlDataAdapter ada = new SqlDataAdapter(command);
gvImages.DataSource = dt;
private void BindGrid()
string strConnString =
using (SqlConnection con = new SqlConnection(strConnString))
using (SqlCommand cmd = new SqlCommand())
cmd.CommandText = "select qid, Name from replydata where ques like'%" +
TextBox1.Text + "%'";
cmd.Connection = con;
DataList1.DataSource = cmd.ExecuteReader();
SqlConnection connection = new
SqlCommand command = new SqlCommand("SELECT* from replydata where
ques like '%" + TextBox1.Text + "%'", connection);
SqlDataAdapter ada = new SqlDataAdapter(command);
GridView1.DataSource = dt;
public partial class viewdoct : System.Web.UI.Page
SqlConnection con = new
protected void Page_Load(object sender, EventArgs e)
DataSet ds = new DataSet();
ds = Connection.ExecuteQuery("select * from askqust");
GridView1.DataSource = ds.Tables;
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs
Label txtcity = (Label)GridView1.Rows[e.RowIndex].FindControl("Label3");
string m = txtcity.ToString();
Response.Redirect("docdetails.aspx?id=" + txtcity.Text.ToString());
 L. A. Adamic, J. Zhang, E. Bakshy, andM. S. Ackerman,(2008) “Knowledge
sharing and Yahoo answers: Everyone knows something,” in Proc. Int.
World Wide Web Conf.
 J. Cao, F. Jay, and J. Nunamaker,(2004)“Question answering on lecture
videos: A multifaceted approach,” in Proc. Int. Joint Conf. Digital Libraries.
 H. Cui, M.-Y. Kan, and T.-S. Chua,(2007) “Soft pattern matching models
for definitional question answering,” ACM Trans. Inf. Syst., vol. 25, no. 2,
 L. Nie, M. Wang, Z. Zha, G. Li, and T.-S. Chua,(2011)“Multimedia
answering: Enriching text QA with media information,” in Proc. ACM Int.
 S. A. Quarteroni and S. Manandhar,(2008)“Designing an interactive open
domain question answering system,” J. Natural Lang. Eng., vol. 15, no. 1,
 M. Wang, X. S. Hua, T. Mei, R. Hong, G. J. Qi, Y. Song, and L. R.
Dai,(2009) “Semi-supervised kernel density estimation for video annotation,”
Comput. Vision Image Understand., vol. 113, no. 3, pp. 384–396.
 R. C. Wang, N. Schlaefer, W. W. Cohen, and E. Nyberg,(2008) “Automatic
set expansion for list question answering,” in Proc. Int. Conf. Empirical
Methods in Natural Language Processing.
 Z.-J. Zha, X.-S. Hua, T. Mei, J. Wang, G.-J. Qi, and Z. Wang,(2008)“Joint
multi- label multi-instance learning for image classification,” in Proc.
IEEE Conf. Computer Vision and Pattern Recognition, pp. 1–8.