0% found this document useful (0 votes)
155 views54 pages

Movie Recommendation System Using Sentiment Analysis From Micro Blogging Data

The document discusses a proposed hybrid recommender system for movies that leverages concepts from collaborative filtering, content-based filtering, and sentiment analysis of tweets. It aims to understand current trends, public sentiment, and user responses about movies from Twitter data. The system was tested on public databases and yielded promising results. Literature on user modeling with Twitter data, Twitter-based user modeling for recommendations, limitations and extensions of recommender systems, and enhancing deep learning sentiment analysis with ensemble techniques is reviewed.

Uploaded by

Sandeep Sangepu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views54 pages

Movie Recommendation System Using Sentiment Analysis From Micro Blogging Data

The document discusses a proposed hybrid recommender system for movies that leverages concepts from collaborative filtering, content-based filtering, and sentiment analysis of tweets. It aims to understand current trends, public sentiment, and user responses about movies from Twitter data. The system was tested on public databases and yielded promising results. Literature on user modeling with Twitter data, Twitter-based user modeling for recommendations, limitations and extensions of recommender systems, and enhancing deep learning sentiment analysis with ensemble techniques is reviewed.

Uploaded by

Sandeep Sangepu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

1

CONTENTS
ABSTRACT
pg.no
1. INTRODUCTION 1
1.1 MOTIVATION 1
1.2 PROBLEM DEFINITION 1
1.3 OBJECTIVE OF PROJECT 1
2. LITERATURE SURVEY 2
2.1 Analyzing user modeling on Twitter
for personalized news recommendation……………………………………………. 2
2.2 Twitter-based user modeling for news recommendations……………………… 2
2.3 Toward the next generation of recommender
systems: A survey of the state-of-the-art and possible extensions………………… 3
2.4 Enhancing deep learning sentiment
analysis with ensemble techniques in social applications………………………….. 3
2.5 Hybrid recommender systems based on content feature relationship………….. 3
3. SYSTEM ANALYSIS 5
3.1 EXISTING SYSTEM 5
3.1.1 DISADVANTAGES OF EXISTING SYSTEM 5
3.2 PROPOSED SYSTEM 5
3.2.1 ADVANTAGES OF PROPOSED SYSTEM 6
3.3 SYSTEM REQUIREMENTS 6
3.4 SYSTEM STUDY 7
4. SYSTEM DESIGN 9
4.1 SYSTEM ARCHITECTURE 9
4.2 UML DIAGRAMS 9
5. SOFTWARE DEVELOPMENT 16
5.1 HTML 16
5.2 JAVA SCRIPT 20
5.3 MYSQL 21
5.4 JDBC CONNECTIVITY 22
6. IMPLEMENTATION 34
6.1 OVERVIEW 34
6.2 EXECUTION SCREENSHOTS 35
7. SOFTWARE TESTING 42
7.1 Unit Testing: 42
7.2 PERFORMANCE TESTING 42
7.3 INTEGRATION TESTING 43
7.4 TEST CASES 43
8. CONCLUSION AND FUTURE ENHANCEMENTS 47
9. REFERENCES 48

2
ABSTRACT
Recommendation systems (RSs) have garnered immense interest for applications in e-
commerce and digital media. Traditional approaches in RSs include such as
collaborative filtering (CF) and content-based filtering (CBF) through these
approaches that have certain limitations, such as the necessity of prior user history and
habits for performing the task of recommendation. To minimize the effect of such
limitation, this article proposes a hybrid RS for the movies that leverage the best of
concepts used from CF and CBF along with sentiment analysis of tweets from micro
blogging sites. The purpose to use movie tweets is to understand the current trends,
public sentiment, and user response of the movie. Experiments conducted on the
public database have yielded promising results.

3
LIST OF FIGURES

S.NO NAME OF THE FIGURE Pg.no

1 Fig 4.1 SYSTEM ARCHITECTURE 9

2 Fig 4.2 USE CASE DIAGRAM 11

3 Fig 4.3 CLASS DIAGRAM 12

4 Fig 4.4 SEQUENCE DIAGRAM 13

5 Fig 4.5 ACTIVITY DIAGRAM 14

6 Fig 5.4.1 JDBC DRIVERS 22

7 Fig 5.4.2 JDBC CONNECTIVITY 27

8 Fig 6.1 HOMEPAGE 35

9 Fig 6.2 ADMIN LOGIN 36

10 Fig 6.3 ADMIN PAGE 36

11 Fig 6.4 VIEW ALL USERS 37

12 Fig 6.5 ADD SENTIWORDS 37

13 Fig 6.6 USER REGISTRATION 38

14 Fig 6.7 USER LOGIN 38

15 Fig 6.8 USER HOMEPAGE 39

16 Fig 6.9 SEARCH FRINEDS 39

17 Fig 6.10 REQUESTS 40

18 Fig 6.11 POST 40

19 Fig 6.12 VIEW ALL POST 41

20 Fig 6.13 COMMENT 41

21 Fig 6.14 RECOMMENDED MOVIES 42

4
LIST OF TABLES

S.NO NAME OF THE TABLES Pg.no

1 TABLE NO:7.1 TEST CASES 44

2 TABLE NO:7.2 REGISTRATION 44

3 TABLE NO:7.3 FORGET PASSWORD 45-46

5
1. INTRODUCTION
1.1 MOTIVATION
Traditional approaches in RSs include such as collaborative filtering (CF) and
content-based filtering (CBF) through these approaches that have certain limitations,
such as the necessity of prior user history and habits for performing the task of
recommendation.

1.2 PROBLEM DEFINITION


Users often face the problem of excessive available information. Recommendation
systems (RSs) are deployed to help users cope up with the information explosion. RS
is mostly used in digital entertainment, such as Netflix, Prime Video, and IMDB, and
e-commerce portals such as Amazon, Flipkart, and eBay. In this article, we focus on
RS for movies, which is an important source of recreation and entertainment in our
life. Movie suggestions for users depend on Web-based portals. Movies can be easily
differentiated through their genres, such as comedy, thriller, animation, and action.
Another possible way to categorize the movies based on its metadata, such as release
year, language, director, or cast. Most online video-streaming services , provide
personalized user experience by utilizing the user’s historical data, such as previously
viewed or rated history.

1.3 OBJECTIVE OF PROJECT


The purpose to use movie tweets is to understand the current trends, public sentiment,
and user response of the movie. Experiments conducted on the public database have
yielded promising results.

1
2. LITERATURE SURVEY
2.1 ANALYZING USER MODELING ON TWITTER FOR
PERSONALIZED NEWS RECOMMENDATIONS
AUTHORS: F. Abel, Q. Gao, G.-J. Houben, and K. Tao.
How can micro-blogging activities on Twitter be leveraged for user modeling and
personalization? In this paper we investigate this question and introduce a framework
for user modeling on Twitter which enriches the semantics of Twitter messages
(tweets) and identifies topics and entities (e.g. persons, events, products) mentioned in
tweets. We analyze how strategies for constructing hashtag-based, entity-based or
topic-based user profiles benefit from semantic enrichment and explore the temporal
dynamics of those profiles. We further measure and compare the performance of the
user modeling strategies in context of a personalized news recommendation system.
Our results reveal how semantic enrichment enhances the variety and quality of the
generated user profiles. Further, we see how the different user modeling strategies
impact personalization and discover that the consideration of temporal profile patterns
can improve recommendation quality.

2.2 TWITTER-BASED USER MODELING FOR NEWS


RECCEMDATONS
AUTHORS: F. Abel, Q. Gao, G.-J. Houben, and K. Tao.
How can micro-blogging activities on Twitter be leveraged for user modeling and
personalization? In this paper we investigate this question and introduce a framework
for user modeling on Twitter which enriches the semantics of Twitter messages
(tweets) and identifies topics and entities (e.g. persons, events, products) mentioned in
tweets. We analyze how strategies for constructing hashtag-based, entity-based or
topic-based user profiles benefit from semantic enrichment and explore the temporal
dynamics of those profiles. We further measure and compare the performance of the
user modeling strategies in context of a personalized news recommendation system.
Our results reveal how semantic enrichment enhances the variety and quality of the
generated user profiles. Further, we see how the different user modeling strategies

2
impact personalization and discover that the consideration of temporal profile patterns
can improve recommendation quality.

2.3 TOWARD THE NEXT GENERATION OF RECOMMENDER


SYSTEMS: A survey of the state-of-the-art and possible
extensions.

AUTHORS: G. Adomavicius and A. Tuzhilin.


This paper presents an overview of the field of recommender systems and describes
the current generation of recommendation methods that are usually classified into the
following three main categories: content-based, collaborative, and hybrid
recommendation approaches. This paper also describes various limitations of current
recommendation methods and discusses possible extensions that can improve
recommendation capabilities and make recommender systems applicable to an even
broader range of applications. These extensions include, among others, an
improvement of understanding of users and items, incorporation of the contextual
information into the recommendation process, support for multi criteria ratings, and a
provision of more flexible and less intrusive types of recommendations.

2.4 ENHANCING DEEP LEARNING SENTIMENT ANALYSIS


WITH ENSEMBLE TECHNIQUES IN SOCIAL APPLICATIONS

AUTHORS: O. Araque, I. Corcuera-Platas, J. F. Sánchez-Rada, and


C. A. Iglesias.
Deep learning techniques for Sentiment Analysis have become very popular. They
provide automatic feature extraction and both richer representation capabilities and
better performance than traditional feature based techniques (i.e., surface methods).
Traditional surface approaches are based on complex manually extracted features, and
this extraction process is a fundamental question in feature driven methods. These
long-established approaches can yield strong baselines, and their predictive
capabilities can be used in conjunction with the arising deep learning methods. In this
paper we seek to improve the performance of deep learning techniques integrating
them with traditional surface approaches based on manually extracted features. The
contributions of this paper are sixfold. First, we develop a deep learning based
sentiment classifier using a word embeddings model and a linear machine learning
algorithm. This classifier serves as a baseline to compare to subsequent results.

3
Second, we propose two ensemble techniques which aggregate our baseline classifier
with other surface classifiers widely used in Sentiment Analysis. Third, we also
propose two models for combining both surface and deep features to merge
information from several sources. Fourth, we introduce a taxonomy for classifying the
different models found in the literature, as well as the ones we propose. Fifth, we
conduct several experiments to compare the performance of these models with the
deep learning baseline. For this, we use seven public datasets that were extracted from
the microblogging and movie reviews domain. Finally, as a result, a statistical study
confirms that the performance of these proposed models surpasses that of our original
baseline on F1-Score.

2.5 HYBRID RECOMMENDER SYSTEMS BASED ON


CONTENT FEATURE RELATIONSHIP

AUTHORS: E. Aslanian, M. Radmanesh, and M. Jalili

Recommendation systems get ever-increasing importance due to their applications in


both academia and industry. The most popular type of these systems, known as
collaborative filtering algorithms, employ user-item interactions to perform the
recommendation tasks. With growth of additional information sources other than the
rating (or purchase) history of users on items, such as item descriptions and social
media information, further extensions of these systems have been proposed, known as
hybrid recommendation algorithms. Hybrid recommenders use both user-item
interaction data and their contextual information. In this work, we propose new hybrid
recommender algorithms by considering the relationship between content features.
This relationship is embedded into the hybrid recommenders to improve their
accuracy. We first introduce a novel method to extract the content feature relationship
matrix, and then the collaborative filtering recommender is modified such that this
relationship matrix can be effectively integrated within the algorithm. The proposed
algorithm can better deal with the cold-start problem than the state-of-art algorithms.
We also propose a novel content-based hybrid recommender system. Our experiments
on a benchmark movie dataset show that the proposed approach significantly
improves the accuracy of the system, while resulting in satisfactory performance in
terms of novelty and diversity of the recommendation lists.

4
3. SYSTEM ANALYSIS
3.1 EXISTING SYSTEM

Many RSs have been developed over the past decades. These systems use different
approaches, such as CF, CBF, hybrid, and sentiment analysis to recommend the
preferred items. These approaches are discussed as follows. A. Collaborative,
Content-Based, and Hybrid Filtering Various RS approaches have been proposed in
the literature for recommending items [48]. The primordial use of CF was introduced
in [18], which proposed a search system based on document contents and responses
collected from other users. Yang et al. [59] inferred implicit ratings from the number
of pages the users read. The more pages read by the users, the more they are assumed
to like the documents. This concept is helpful to overcome the cold start problem in
CF. Optimizing the RS is an ill-posed problem. Researchers have proposed several
optimization algorithms, such as gray wolf optimization [26], artificial bee colony
[21], particle swarm optimization [53], and genetic algorithms [6]. Katarya et al. and
Verma [26] developed a collaborative movie RS based on gray wolf optimizer and
fuzzy c-mean clustering techniques. Both techniques are applied to the Movielens
data set and predicted a better RS. They improved the existing framework in [24]
proposing an artificial bee colony and k-mean cluster (ABC-KM) framework for a
collaborative movie RS to reduce the scalability and cold start complication.

3.1.1 DISADVANTAGES OF EXISTING SYSTEM

1. The existing users not only receive information according to their social links but
also gain access to other user-generated information.

2. The necessity of prior user history and habits for performing the task of
recommendation.

3.2 PROPOSED SYSTEM

The proposed sentiment-based RS is shown in Fig. 1. In this section, we describe


various components of the proposed RS. A. Data Set Description The proposed
system needs two types of databases. One is a user-rated movie database, where
ratings for relevant movies are present, and another is the user tweets from Twitter.

1) Public Databases: There are many popular public databases available, which have
been widely used to recommend the movies and other entertainment media. To
incorporate the sentiment analysis in the proposed framework, the tweets of movies
were extracted from Twitter against the movies that were available in the database.
Experiments conducted using various public databases, such as the Movielens 100K,2
Movielens 20M,3 Internet Movie Database (IMDb,4) and Netflix database,5 that were

5
not found suitable for our work due to the absence of microblogging data. After a
thorough assessment of the abovementioned databases, the MovieTweetings database
[12] was finally selected for the proposed system. MovieTweetings is widely
considered as a modern version of the MovieLens database. The purpose of this
database is to provide an up-to-date movie rating so that it contains more realistic data
for sentiment analysis. Table I displays the relevant details of the MovieTweetings
database.

2) Modified MovieTweetings Database: In the proposed work, the MovieTweetings


database is modified to implement the RS. The primary objective to modify the
database was to use sentiment analysis of tweets by the users, in the prediction of the
movie RS. The MovieTweetings database contains the movies with published years
from 1894 to 2017. Due to the scarcity of tweets for old movies, we only considered
the movies that were released in or after the year 2014 and extracted a subset of the
database which complied with our objective.

3.2.1 ADVANTAGES OF PROPOSED SYSTEM

1. To use movie tweets is to understand the current trends, public sentiment, and user
response of the movie.

2. Experiments conducted on the public database have yielded promising results.

3.3 SYSTEM REQUIREMENTS

HARDWARE REQUIREMENTS:

• System : Pentium IV 2.4 GHz.


• Hard Disk : 40 GB.
• Floppy Drive : 1.44 Mb.
• Monitor : 15 VGA Colour.
• Mouse : Logitech.
• Ram : 512 Mb.

6
SOFTWARE REQUIREMENTS:

• Technology : Java 2 Standard Edition, JDBC

• Web Server : Tomcat 7.0


• Client Side Technologies : HTML, CSS, JavaScript
• Server Side Technologies : Servlets, JSP
• Data Base Server : MySQL
• Editor : Netbeans 8.1
• Operating System : Microsoft Windows, Linux or Mac any
version

3.4 SYSTEM STUDY

FEASIBILITY STUDY

The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is to
ensure that the proposed system is not a burden to the company. For feasibility
analysis, some understanding of the major requirements for the system is essential.

Three key considerations involved in the feasibility analysis are

 ECONOMICAL FEASIBILITY
 TECHNICAL FEASIBILITY
 SOCIAL FEASIBILITY

7
ECONOMICAL FEASIBILITY

This study is carried out to check the economic impact that the system will have on
the organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this was achieved because most of the
technologies used are freely available. Only the customized products had to be
purchased.

TECHNICAL FEASIBILITY

This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on
the available technical resources. This will lead to high demands on the available
technical resources. This will lead to high demands being placed on the client. The
developed system must have a modest requirement, as only minimal or null changes
are required for implementing this system.

SOCIAL FEASIBILITY

The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must
not feel threatened by the system, instead must accept it as a necessity. The level of
acceptance by the users solely depends on the methods that are employed to educate
the user about the system and to make him familiar with it. His level of confidence
must be raised so that he is also able to make some constructive criticism, which is
welcomed, as he is the final user of the system.

8
4. SYSTEM DESIGN

4.1 SYSTEM ARCHITECTURE

Fig:4.1

4.2 UML DIAGRAMS


UML stands for Unified Modeling Language. UML is a standardized general-purpose
modeling language in the field of object-oriented software engineering. The standard
is managed, and was created by, the Object Management Group.
The goal is for UML to become a common language for creating models of object
oriented computer software. In its current form UML is comprised of two major
components: a Meta-model and a notation. In the future, some form of method or
process may also be added to; or associated with, UML.
The Unified Modeling Language is a standard language for specifying, Visualization,
Constructing and documenting the artifacts of software system, as well as for business
modeling and other non-software systems.

9
The UML represents a collection of best engineering practices that have proven
successful in the modeling of large and complex systems.
The UML is a very important part of developing objects oriented software and the
software development process. The UML uses mostly graphical notations to express
the design of software projects.

GOALS:
The Primary goals in the design of the UML are as follows:
1. Provide users a ready-to-use, expressive visual modeling Language so that
they can develop and exchange meaningful models.
2. Provide extensibility and specialization mechanisms to extend the core
concepts.
3. Be independent of particular programming languages and development
process.
4. Provide a formal basis for understanding the modeling language.
5. Encourage the growth of OO tools market.
6. Support higher level development concepts such as collaborations,
frameworks, patterns and components.
7. Integrate best practices.

10
USE CASE DIAGRAM
A use case diagram in the Unified Modeling Language (UML) is a type of behavioral
diagram defined by and created from a Use-case analysis. Its purpose is to present a
graphical overview of the functionality provided by a system in terms of actors, their
goals (represented as use cases), and any dependencies between those use cases. The
main purpose of a use case diagram is to show what system functions are performed
for which actor. Roles of the actors in the system can be depicted.

Fig:4.2

11
CLASS DIAGRAM
In software engineering, a class diagram in the Unified Modeling Language (UML) is
a type of static structure diagram that describes the structure of a system by showing
the system's classes, their attributes, operations (or methods), and the relationships
among the classes. It explains which class contains information.

Fig:4.3

12
SEQUENCE DIAGRAM

A sequence diagram in Unified Modeling Language (UML) is a kind of interaction


diagram that shows how processes operate with one another and in what order. It is a
construct of a Message Sequence Chart. Sequence diagrams are sometimes called
event diagrams, event scenarios, and timing diagrams.

Fig 4.4

13
ACTIVITY DIAGRAM

Activity diagrams are graphical representations of workflows of stepwise activities


and actions with support for choice, iteration and concurrency. In the Unified
Modeling Language, activity diagrams can be used to describe the business and
operational step-by-step workflows of components in a system. An activity diagram
shows the overall flow of control.

Fig 4.5

14
INPUT/OUTPUT DESIGN

Input design: Considering the requirements, procedures to collect the necessary


input data in most efficiently designed. The input design has been done keeping in
view that, the interaction of the user with the system being the most effective and
simplified way.

Also the measures are taken for the following

▪ Controlling the amount of input


▪ Avoid unauthorized access to the classroom.
▪ Eliminating extra steps
▪ Keeping the process simple
▪ At this stage the input forms and screens are designed.

Output design: All the screens of the system are designed with a view to provide
the user with easy operations in simpler and efficient way, minimum key strokes
possible. Instructions and important information is emphasized on the screen. Almost
every screen is provided with no error and important messages and option selection
facilitates. Emphasis is given for speedy processing and speedy transaction between
the screens. Each screen assigned to make it as much user friendly as possible by
using interactive procedures. So to say user can operate the system without much
help from the operating manual.

15
5. SOFTWARE DEVELOPMENT

5.1 HTML

Html is a language which is used to create web pages with html marking up a
page to indicate its format, telling the web browser where you want a new line to
begin or how you want text or images aligned and more are possible.

We used the following tags in our project.

Table:

Tables are so popular with web page authors is that they let you arrange the
elements of a web page in such a way that the browser won’t rearrange them web
page authors frequently use tables to structure web pages.

TR:

TR is used to create a row in a table encloses <TH> and <TD> elements.


<TR> contain many attributes. Some of them are,

• ALIGN: specifies the horizontal alignment of the text in the table row.
• BGCOLOR: Specifies the background color for the row.
• BORDERCOLOR: Sets the external border color for the row.
• VALIGN: Sets the vertical alignment of the data in this row.

TH:

TH is used to create table heading.

• ALIGN: Sets the horizontal alignment of the content in the table cell. Sets
LEFT, RIGHT, CENTER.

16
• BACKGROUND: Species the back ground image for the table cell.
• BGCOLOR: Specifies the background color of the table cell
• VALIGN: Sets the vertical alignment of the data. Sets to TOP, MIDDLE,
BOTTOM or BASELINE.
• WIDTH: Specifies the width of the cell. Set to a pixel width or a percentage of
the display area.

TD:

TD is used to create table data that appears in the cells of a table.

• ALIGN: Species the horizontal alignment of content in the table cell. Sets to
LEFT, CENTER, RIGHT.
• BGCOLOR: Specifies the background image for the table cell.
• BGCOLOR: sets the background color of the table cells.
• WIDTH: Species the width of the cell

Frames:

Frames are used for either run off the page or display only small slices of what
are supposed to be shown and to configure the frame we can use
<FRAMESET>There are two important points to consider when working with
<FRAMESET>.

• <FRAMESET> element actually takes the place of the <BODY> element in a


document.
• Specifying actual pixel dimensions for frames .

<FRAME> Elements are used to create actual frames.

From the frameset point of view dividing the browser into tow vertical frames
means creating two columns using the <FRAMESET> elements COLS attribute.

The syntax for vertical fragmentation is,

17
<FRAMESET COLS =”50%, 50%”>

</FRAMESET>

Similarly if we replace COLS with ROWS then we get horizontal


fragmentation.

The syntax for horizontal fragmentation is,

<FRAMESET ROWS=”50%, 50%”>

</FRAMESET>

Form:

The purpose of FORM is to create an HTML form; used to enclose HTML


controls, like buttons and text fields.

Attribute:

• ACTION: Gives the URL that will handle the form data.
• NAME: Gives the name to the form so you can reference it in code set to an
alphanumeric string.
• METHOD: method or protocol is used to sending data to the target action
URL. The GET method is the default, it is used to send all form name/value pair
information in an URL. Using the POST method, the content of the form are
encoded as with the GET method, but are sent in environment variables.

Controls in HTML:
<INPUT TYPE =BUTTON>:

Creates an html button in a form.

ATTRIBUTES:

• NAME: gives the element a name. Set to alphanumeric characters.


• SIZE: sets the size.
• VALUE: sets the caption of the element.

18
<INPUT TYPE = PASSWORD>:

Creates a password text field, which makes typed input.

ATTRIBUTES:

• NAME: gives the element a name, set to alphanumeric characters.


• VALUE: sets the default content of the element.

<INPUT TYPE=RADIO>:

Creates a radio button in a form.

ATTRIBUTE:

• NAME: Gives the element a name. Set to alphanumeric character.


• VALUE: Sets the default content of the element.

<INPUT TYPE=SUBMIT>:

Creates a submit button that the user can click to send data in the form back to the
web server.

ATTRIBUTES:

NAME: Gives the element a name. Set to alphanumeric characters.

VALUE: Gives this button another label besides the default, Submit Query. Set to
alphanumeric characters.

<INPUT TYPE=TEXT>:

Creates a text field that the user can enter or edit text in.

ATTRIBUTES:

NAME: Gives the element a name. Set to alphanumeric characters.

VALUE: Holds the initial text in the text field. Set to alphanumeric characters.

19
5.2 JAVA SCRIPT

Java script originally supported by Netscape navigator is the most popular


web scripting language today. Java script lets you embedded programs right in your
web pages and run these programs using the web browser. You place these programs
in a <SCRIPT> element, usually within the <HEAD> element. If you want the script
to write directly to the web page, place it in the <BODY> element.

Java script Methods:

Writeln:

Document.writeln () is a method, which is used to write some text to the


current web page.

onClick:

Occurs when an element is clicked.

onLoad:

Occurs when the page loads.

onMouseDown:

Occurs when a mouse button goes down.

onMouseMove:

Occurs when the mouse moves.

OnUnload:

Occurs when a page is unloaded.

20
5.3 MYSQL

MySQL is an open source relational database management system


(RDBMS).This is the most popular database system used with PHP. MySQL is
distributed and supported by Oracle Corporation.

MySQL runs on almost all platforms including Linux, Unix and Windows. Although
it can be used in a wide range of applications, MySQL is often associated with web
applications and online publishing.

MySQL is an essential constituent of an open source enterprise stack called LAMP.


LAMP is a web development platform that uses Linux as an operating system, in the
form of Apache web server, MySQL relational database management system and PHP
object-oriented scripting language.

Advantages of MySQL:

Data Security: MySQL is globally renowned for being the most secure and
reliable database management system used in popular web applications including
WordPress, Drupal, Joomla, Facebook and Twitter.

High Performance: MySQL features a distinct storage-engine framework that


facilitates system administrators to configure the MySQL database server for a
flawless performance.

Round-the-Clock Up-time: MySQL comes with the assurance of 24×7 up-time


and offers a wide range of high-availability solutions, including specialized cluster
servers and master/slave replication configurations.

The Flexibility of Open Source: All the fears and worries that arise in an open-
source solution can be brought to an end with MySQL’s round-the-clock support and
enterprise indemnification. The secure processing and trusted software of MySQL
combine to provide effective transactions for large-volume projects. It makes
maintenance, debugging and upgrades fast and easy while enhancing the end-user
experience.

21
5.4 JDBC CONNECTIVITY

JDBC is a Java API for executing SQL statements. (As a point of interest, JDBC is a
trademarked name and is not an acronym; nevertheless, JDBC is often thought of as
standing for Java Database Connectivity. It consists of a set of classes and interfaces
written in the Java programming language. JDBC provides a standard API for
tool/database developers and makes it possible to write database applications using
a pure Java API.

Using JDBC, it is easy to send SQL statements to virtually any relational database.
One can write a single program using the JDBC API, and the program will be able to
send SQL statements to the appropriate database

JDBC Drivers: The JDBC API only defines interfaces for objects used for performing
various database-related tasks like opening and closing connections, executing SQL
commands, and retrieving the results. We all write our programs to interfaces and not
implementations. Either the resource manager vendor or a third party provides the
implementation classes for the standard JDBC interfaces. These software implementations are
called JDBC drivers.JDBC drivers transform the standard JDBC calls to the external resource
manager-specific API calls.

The diagram below depicts how a database client written in java accesses an external resource
manager using the JDBC API.

Fig 5.4.1

22
Driver:Depending on the mechanism of implementation, JDBC drivers are
broadly classified into four types.

TYPE1:

Type1 JDBC drivers implement the JDBC API on top of a lower level API
like ODBC. These drivers are not generally portable because of the independency on
native libraries. These drivers translate the JDBC calls to ODBC calls and ODBC
sends the request to external data source using native library calls. The JDBC-
ODBC driver that comes with the software distribution for J2SE is an example of a
type1 driver.

TYPE2:

Type2 drivers are written in mixture of java and native code. Type2 drivers
use vendors specific native APIs for accessing the data source. These drivers
transform the JDBC calls to vendor specific calls using the vendor’s native library.

These drivers are also not portable like type1 drivers because of the dependency on
native code.

TYPE3:

Type3 drivers use an intermediate middleware server for accessing the


external data sources. The calls to the middleware server are database independent.
However, the middleware server makes vendor specific native calls for accessing the
data source. In this case, the driver is purely written in java.

TYPE4:

Type4 drivers are written in pure java and implement the JDBC interfaces and
translate the JDBC specific calls to vendor specific access calls. They implement the
data transfer and network protocol for the target resource manager. Most of the
leading database vendors provide type4 drivers for accessing their database
servers.

23
Driver manager and Driver: The java.sql package defines an interface called
Java.sql.Driver that makes to be implemented by all the JDBC drivers and a class
called java.sql.DriverManager that acts as the interface to the database clients for
performing tasks like connecting to external resource managers, and setting log
streams. When a JDBC client requests the DriverManager to make a connection to
an external resource manager, it delegates the task to an approate driver class
implemented by the JDBC driver provided either by the resource manager vendor or
a third party.

JAVA.SQL.DRIVERMANAGER:

The primary task of the class driver manager is to manage the various JDBC
drivers register. It also provides methods for:

• Getting connections to the databases.


• Managing JDBC logs.
• Setting login timeout.

Managing drivers:

JDBC clients specify the JDBC URL when they request a connection. The
driver manager can find a driver that matches the request URL from the list of
register drivers and delegate the connection request to that driver if it finds a match
JDBC URLs normally take the following format:

<protocol>:<sub-protocol>:<resource>

The protocol is always jdbc and the sub-protocol and resource depend on the type of
resource manager. The URL for postgreSQL is in the format:

Jdbc: postgres ://< host> :< port>/<database>

Here host is the host address on which post master is running and database is the
name of the database to which the client wishes to connect.

Managing controls:

Driver Manager class is responsible for managing connections to the databases:

24
public static Connection getConnection (String url,Properties info) throws
SQLException

This method gets a connection to the database by the specified JDBC URL using the
specified username and password. This method throws an instance of
SQLException if a database access error occurs.

Connections:

The interface java.sql.Connection defines the methods required for a persistent


connection to the database. The JDBC driver vendor implements this interface. A
database ‘vendor-neutral’ client never uses the implementation class and will always
use only the interface. This interface defines methods for the following tasks:

• Statements, prepared statements, and callable statements are the different types
of statements for issuing sql statements to the database by the JDBC clients.
• For getting and setting auto-commit mode.
• Getting meta information about the database.
• Committing and rolling back transactions.

Creating connections: The interface java.sql.Connection defines a set of


methods for creating database statements. Database statements are used for sending
SQL statements to the database:

Public Statement createStatement () throws SQLException

This method is used for creating instances of the interface java.sql.Statement. This
interface can be used for sending SQL statements to the database. The interface
java.sql.Statement is normally used for sending SQL statements that don’t take any
arguments. This method throws an instance of SQLException if a database access
error occurs:

Public Statement createStatement (int resType, int resConcurrency) throws


SQLException.

JDBC resultset: A JDBC resultset represents a two dimentional array of data


produced as a result of executing SQL SELECT statements against databases using

25
JDBC statements. JDBC resultsets are represented by the interface java.sql.ResultSet.
The JDBC vendor provider provides the implementation class for this interface.

Scrolling resultset:

public boolean next() throws SQLException

public boolean previous() throws SQLException

public boolean first() throws SQLException

public boolean last() throws SQLException

Statement: The interface java.sql.stament is normally used for sending SQL


statements that do not have IN or OUT parameters. The JDBC driver vendor
provides the implementation class for this interface. The common methods required
by the different JDBC statements are defined in this interface. The methods defined
by java.sql. Statement can be broadly categorized as follows:

• Executing SQL statements


• Querying results and resultsets
• Handling SQL batches
• Other miscellaneous methods

The interface java.sql.statements defines methods for executing different SQL


statements like SELECT, UPDATE, INSERT, DELETE, and CREATE.

Public Resultset execute Query (string sql) throws SQLException

The following figure shows how the Driver Manager, Driver, Connection, Statement,
ResultSet classes are connected.

26
DriverManager

Driver
Driver
Layer

Application
Connection
Layer

Prepared Statement Statement Callable Statement

Result Set Result Set Result Set

Fig 5.4.2

JAVA SERVER PAGES (JSP):

Introduction: Java Server Pages (JSP) technology enables you to mix regular,
static HTML with dynamically generated content. You simply write the regular
HTML in the normal manner, using familiar Web-page-building tools. You then
enclose the code for the dynamic parts in special tags, most of which start with <%
and end with %>.

The need of JSP: Servlets are indeed useful, and JSP by no means makes them
obsolete. However,

• It is hard to write and maintain the HTML.


• You cannot use standard HTML tools.
• The HTML is inaccessible to non-Java developers.

27
Benefits of JSP: JSP provides the following benefits over servlets alone:
• It is easier to write and maintain the HTML: In this no extra backslashes, no
double quotes, and no lurking Java syntax.
• You can use standard Web-site development tools:
We use Macromedia Dreamweaver for most of the JSP pages. Even HTML
tools that know nothing about JSP can used because they simply ignore the JSP
tags.

• You can divide up your development team:


The Java programmers can work on the dynamic code. The Web developers
can concatenate on the representation layer. On large projects, this division is
very important. Depending on the size of your team and the complexity of
your project, you can enforce a weaker or stronger separation between the
static HTML and the dynamic content.

Creating template text: A large percentage of our JSP document consists of


static text known as template text. In almost all respects, this HTML looks just likes
normal HTML follows all the same syntax rules, and simply “passed through” to
that client by the servlet created to handle the page. Not only does the HTML look
normal, it can be created by whatever tools you already are using for building Web
pages.

There are two minor exceptions to the “template text passed through” rule. First, if
you want to have <% 0r %> in the out port, you need to put <\% or %\> in the
template text. Second, if you want a common to appear in the JSP page but not in the
resultant document,

<%-- JSP Comment -- %>

HTML comments of the form:

<!—HTML Comment -->

are passed through to the client normally.

28
Types of JSP scrolling elements:

JSP scripting elements allow you to insert Java code into the servlet that will be
generated from the JSP page. There are three forms:

1. Expressions of the form <%=Java Expression %>, which are evaluated and
inserted into the servlet’s output.
2. Sciptlets of the form <%Java code %>, which are inserted into the
servlet’s_jspService method (called by service).
3. Declarations of the form<%! Field/Method Declaration %>, which are
inserted into the body of the servlet class, outside any existing methods.

Using JSP Expressions:

A JSP element is used to insert values directly into the output. It has the following
form:

<%= Java Expression %>

The expression is evaluated, converted to a string, and inserted in the page. This
evaluation is performed at runtime (when the page is requested) and thus has full
access to the information about the request For example, the following shows the
date/time that the page was requested.

Current time: <%=new java.util.Date () %>

Predefined variables:

To simplify expressions we can use a number of predefined variables (or “implicit


objects”). The specialty of these variables is that, the system simple tells what names
it will use for the local variables in _jspService.The most important ones of these are:

• request, the HttpServletRequest.


• response, the HttpServletResponse.
• session, the HttpSession associated with the request
• out, the writer used to send output to clients.

29
• application, the ServletContext. This is a data structure shared by all servlets
and JSP pages in the web application and is good for storing shared data.
Here is an example:

Your hostname: <%= request.getRemoteHost () %>

Comparing servlets to JSP pages:

JSP works best when the structure of the HTML page is fixed but the values at
various places need to be computed dynamically. If the structure of the page is
dynamic, JSP is less beneficial. Some times servlets are better in such a case. If the
page consists of binary data or has little static content, servlets are clearly superior.
Sometimes the answer is neither servlets nor JSP alone, but rather a combination of
both.

Writing scriptlets:

If you want to do something more complex than output the value of a simple
expression .JSP scriptlets let you insert arbitrary code into the servlet’s jspService
method.Scriptlets have the following form:

<% Java code %>

Scriptlets have access to the same automatically defined variables as do expressions


(request, response, session, out , etc ) .So for example you want to explicitly send
output of the resultant page , you could use the out variable , as in the following
example:

<%

String queryData = request.getQueryString ();

out.println (“Attached GET data: “+ queryData);

%>

30
Scriptlet Examples:

As an example of code that is too complex for a JSP expression alone, a JSP
page that uses the bgColor request parameter to set the background color of the page
.Simply using

<BODY BGCOLOR=”<%= request.getParameter (“bgcolor”) %> “>

would violate the cardinal rule of reading form data.

Using declarations:

A JSP declaration lets you define methods or fields that get inserted into the
main body of the servlet class .A declaration has the following form:

<%! Field or Method Definition %>

Since declarations do not generate output, they are normally used in conjunction with
JSP expressions or scriptlets. In principle, JSP declarations can contain field
(instance variable) definitions, method definitions, inner class definitions, or even
static initializer blocks: anything that is legal to put inside a class definition but
outside any existing methods. In practice declarations almost always contain field or
method definitions.

We should not use JSP declarations to override the standard servlet life cycle
methods. The servlet into which the JSP page gets translated already makes use of
these methods. There is no need for declarations to gain access to service, doget, or
dopost, since calls to service are automatically dispatched to _jspService , which is
where code resulting from expressions and scriptlets is put. However for initialization
and cleanup, we can use jspInit and jspDestroy- the standard init and destroy methods
are guaranteed to call these methods in the servlets that come from JSP.

Jakarta Tomcat:

Tomcat is the Servlet/JSP container. Tomcat implements the Servlet 2.4 and
JavaServer Pages 2.0 specification. It also includes many additional features that

31
make it a useful platform for developing and deploying web applications and web
services.

Terminology:

Context – a Context is a web application.

$CATALINA_HOME – This represents the root of Tomcat installation.

Directions and files:

/bin – Startup, shutdown, and other scripts. The *.sh files (for Unix
systems) are functional duplicates of the *.bat files (for Windows systems). Since
the Win32 command-line lacks certain functionality, there are some additional files
in here.

/conf – Configuration files and related DTDs. The most important file in here
is server.xml. It is the main configuration file for the container.

/logs – Log files are here by default.

/webapps – This is where webapps go\

Installation

Tomcat will operate under any Java Development Kit (JDK) environment that
provides a JDK 1.2 (also known as Java2 Standard Edition, or J2SE) or later
platform. JDK is needed so that servlets, other classes, and JSP pages can be
compiled.

Deployment directions for default web applications:

HTML and JSP Files

• Main Location
$CATALINA_HOME/webapps/ROOT

32
• Corresponding URLs.
http://host/SomeFile.html

http://host/SomeFile.jsp

• More Specific Location (Arbitrary Subdirectory).


$CATALINA_HOME/webapps/ROOT/SomeDirectory

• Corresponding URLs
http://host/SomeDirectory/SomeFile.html

http://host/SomeDirectory/SomeFile.jsp

Individual Servlet and Utility Class Files

• Main Location (Classes without Packages).


$CATALINA_HOME/webapps/ROOT/WEB-INF/classes

• Corresponding URL (Servlets).


http://host/servlet/ServletName

• More Specific Location (Classes in Packages).


$CATALINA_HOME/webapps/ROOT/WEB-INF/classes/packageName

• Corresponding URL (Servlets in Packages).


http://host/servlet/packageName.ServletName

Servlet and Utility Class Files Bundled in JAR Files

• Location
$CATALINA_HOME/webapps/ROOT/WEB-INF/lib

• Corresponding URLs (Servlets)


http://host/servlet/ServletName

http://host/servlet/packageName.ServletName

33
6. IMPLEMENTATION

6.1 OVERVIEW

Implementation is the stage of the project when the theoretical design is turned out
into a working system. Thus it can be considered to be the most critical stage in
achieving a successful new system and in giving the user, confidence that the new
system will work and be effective.

The implementation stage involves careful planning, investigation of the existing


system and it’s constraints on implementation, designing of methods to achieve
changeover and evaluation of changeover methods

MODULES:
1. Admin
In this module admin used to login, view all users and add senti words.
2. User
In this module user will register, login, search friends, requests, post, view all posts
and Recommend Movies.

34
6.2 EXECUTION SCREENSHOTS

HOME PAGE

ADMIN LOGIN

Fig 6.1

35
ADMIN PAGE

VIEW ALL USERS

36
ADD SENTIMENT WORDS

USER REGISTRATION

37
USER LOGIN

USER HOMEPAGE

38
SEARCH FRIENDS

REQUESTS

39
POST

VIEW ALL POSTS

40
COMMENT

RECOMMENDED MOVIES

41
7. SOFTWARE TESTING

What do you mean by software testing?

Testing involves operation of a system or application under controlled


conditions and evaluating the results. The controlled conditions should include both
normal and abnormal conditions. Testing should intentionally attempt to make things
go wrong to determine if things happen when they shouldn't or things don't happen
when they should. It is oriented to 'detection'.

7.1 UNIT TESTING

Unit testing is a software development process in which the smallest testable parts of
an application, called units, are individually and independently scrutinized for proper
operation. Unit testing is often automated but it can also be done manually. This
testing mode is a component of Extreme Programming (XP), a pragmatic method of
software development that takes a meticulous approach to building a product by
means of continual testing and revision.

42
Unit tests are written from a programmer's perspective. They ensure that a particular
method of a class successfully performs a set of specific tasks. Each test confirms that
a method produces the expected output when given a known input.

7.2 PERFORMANCE TESTING

Performance testing is the process of determining the speed or effectiveness of a


computer, network, software program or device. This process can involve quantitative
tests done in a lab, such as measuring the response time or the number of MIPS
(millions of instructions per second) at which a system functions. Qualitative
attributes such as

Reliability, scalability and interoperability may also be evaluated. Performance testing


is often done in conjunction with stress testing.

Performance testing can verify that a system meets the specifications claimed by its
manufacturer or vendor. The process can compare two or more devices or programs in
terms of parameters such as speed, data transfer rate, bandwidth, throughput,
efficiency or reliability.

Performance testing can also be used as a diagnostic aid in locating communications


bottlenecks. Often a system will work much better if a problem is resolved at a single
point or in a single component. For example, even the fastest computer will function
poorly on today's Web if the connection occurs at only 40 to 50 Kbps (kilobits per
second).

7.3 INTIGRATION TESTING

Integration testing, also known as integration and testing (I&T), is a software


development process which program units are combined and tested as groups in
multiple ways. In this context, a unit is defined as the smallest testable part of an
application. Integration testing can expose problems with the interfaces among
program components before trouble occurs in real-world program execution.
Integration testing is a component of Extreme Programming (XP), a pragmatic
method of software development that takes a meticulous approach to building a
product by means of continual testing and revision.

43
7.4 TEST CASES

Test case for Login form:

FUNCTION: LOGIN

EXPECTED RESULTS: Should Validate the user and check his


existence in database

ACTUAL RESULTS: Validate the user and checking the user


against the database

LOW PRIORITY No

HIGH PRIORITY Yes

Test case for User Registration form:

FUNCTION: USER REGISTRATION

EXPECTED RESULTS: Should check if all the fields are filled by


the user and saving the user to database.

ACTUAL RESULTS: Checking whether all the fields are field


by user or not through validations and
saving user.

LOW PRIORITY No

HIGH PRIORITY Yes

Test case 1:

Test case for Change Password:

44
When the old password does not match with the new password ,then this results
in displaying an error message as “ OLD PASSWORD DOES NOT MATCH
WITH THE NEW PASSWORD”.

Test case 2:

Test case for Forget Password:

When a user forgets his password he is asked to enter Login name, ZIP code, Mobile
number. If these are matched with the already stored ones then user will get his
Original password.

Modu Functi Test Case Expected Results Actual Res


le onality Results ult Priori
ty

1. Navigate To A Pass High


User Login A Validation
Www.Sample.Co Validation
Usecase Should Be As
m Has Been
Below “Please
Populated
Enter Valid
As
2. 2.Click On Username &
Expected
Submit Button Password”
Without Entering
Username and
Password
1. aNavigate To A
A Validation Pass
Www.Sample.Co Validation
Should Be As High
m Is Shown
Below “Please
As
Enter Valid
Expected
1. 2. Click On Password Or
Submit Button Password Field
With Out Filling Can Not Be
Password And Empty “
With Valid

45
Username Test UsernameField

1. NNavigate To High
A Validation A Pass
Www.Sample.Co
Shown As Below Validation
m
“The Username Is Shown
Entered Is As
2. Enter Both
Wrong” Expected
Username And
Password Wrong
And Hit Enter
1. Navigate To
Validate Main Pass
Www.Sample.Co
Username And Page/ High
m
Password In Home
DataBase And Page Has
2. Enter Validate
Once If They Been
Username And
Correct Then Displayed
Password And
Show The Main
Click On Submit
Page

46
8. CONCLUSION AND FUTURE ENHANCEMENTS

RSs are an important medium of information filtering systems in the modern age,
where the enormous amount of data is readily available. In this article, we have
proposed a movie RS that uses sentiment analysis data from Twitter, along with
movie metadata and a social graph to recommend movies. Sentiment analysis
provides information about how the audience is respond to a particular movie and
how this information is observed to be useful. The proposed system used weighted
score fusion to improve the recommendations. Based on our experiments, the average
precision in Top-5 and Top-10 for sentiment similarity, hybrid, and proposed model
are 0.54 and 1.04, 1.86 and 3.31, and 2.54 and 4.97, respectively. We found that the
proposed model recommends more precisely than the other models. In the future, we
plan to consider more information about the emotional tone of the user from different
social media platforms and non-English languages to further improve the RS

47
9. REFERENCES
1. F. Abel, Q. Gao, G.-J. Houben, and K. Tao, “Analyzing user modeling on Twitter
for personalized news recommendations,” in Proc. 19th Int. Conf. Modeling,
Adaption, Pers. (UMAP). Berlin, Germany: SpringerVerlag, 2011, pp. 1–12.

2.F. Abel, Q. Gao, G.-J. Houben, and K. Tao, “Twitter-based user modeling for news
recommendations,” in Proc. Int. Joint Conf. Artif. Intell., vol. 13, 2013, pp. 2962–
2966.

3.G. Adomavicius and A. Tuzhilin, “Toward the next generation of recommender


systems: A survey of the state-of-the-art and possible extensions,” IEEE Trans.
Knowl. Data Eng., vol. 17, no. 6, pp. 734–749, Jun. 2005.

4.O. Araque, I. Corcuera-Platas, J. F. Sánchez-Rada, and C. A. Iglesias, “Enhancing


deep learning sentiment analysis with ensemble techniques in social applications,”
Expert Syst. Appl., vol. 77, pp. 236–246, Jul. 2017.

5.E. Aslanian, M. Radmanesh, and M. Jalili, “Hybrid recommender systems based on


content feature relationship,” IEEE Trans. Ind. Informat., early access, Nov. 21, 2016,
doi: 10.1109/TII.2016.2631138.

6.J. Bobadilla, F. Ortega, A. Hernando, and J. Alcalá, “Improving collaborative


filtering recommender system results and performance using genetic algorithms,”
Knowl.-Based Syst., vol. 24, no. 8, pp. 1310–1316, Dec. 2011.

48
7.R. Burke, “Hybrid recommender systems: Survey and experiments,” User Model.
User-Adapted Interact., vol. 12, no. 4, pp. 331–370, 2002.

8. E. Cambria, “Affective computing and sentiment analysis,” IEEE Intell. Syst., vol.
31, no. 2, pp. 102–107, Mar./Apr. 2016.

9. I. Cantador, A. Bellogín, and D. Vallet, “Content-based recommendation in social


tagging systems,” in Proc. 4th ACM Conf. Rec. Syst. (RecSys), 2010, pp. 237–240.

10.P. Cremonesi, Y. Koren, and R. Turrin, “Performance of recommender algorithms


on top-N recommendation tasks,” in Proc. 4th ACM Conf. Rec. Syst. (RecSys), 2010,
pp. 39–46.

49

You might also like