Cyberbullying A17 Major Project
Cyberbullying A17 Major Project
BACHELOR OF TECHNOLOGY
In
Computer Science & Engineering
Submitted by
G. AKHILA (19D31A0536)
G. AKANKSHA (19D31A0534)
G. SHIVA (19D31A0539)
i
Date: / /2023
CERTIFICATE
G. AKHILA (19D31A0536)
G. AKANKSHA (19D31A0534)
G. SHIVA (19D31A0539)
EXTERNAL EXAMINER
ii
ACKNOWLEDGEMENT
We are thankful to Mr CH. Gopi Krishna, Project Guide, Asst. Prof., Dept.
of CSE who guided us a lot by his favourable suggestions to complete our project. he
is the research-oriented personality with higher end technical exposure.
We are thankful to Mr. Ritesh Thakur, Head, Dept. of CSE, Indur Institute
of Engineering & Technology, for extending his help in the department academic
activities in the course duration. He the personality of dynamic, enthusiastic in the
academic activities.
We sincerely acknowledge to all the lecturers of the Dept. of CSE for their
motivation during our B. Tech course.
We would like to say thanks to all of our friends for their timely help and
encouragement.
G. AKHILA (19D31A0536)
G. AKANKSHA (19D31A0534)
G. SHIVA (19D31A0539)
iii
DECLARATION
G. AKHILA (19D31A0536)
G. AKANKSHA (19D31A0534)
G. SHIVA (19D31A0539)
iv
ABSTRACT
Social media is a platform where many young people are getting bullied. As social
networking sites are increasing, cyberbullying is increasing day by day. To identify
word similarities in the tweets made by bullies and make use of machine learning
and can develop an ML model automatically detect social media bullying
actions. However, many social media bullying detection techniques have been
implemented, but many of them were textual based. The goal of this paper is to
show the implementation of software that will detect bullied posts, tweets etc.
A machine learning model is proposed to detect and prevent bullying on Twitter.
Two classifiers i.e., SVM and Navie Bayes are used for training and the social
media bullying content. Both Navie Bayes and SVM (Support Vector Machine)
were able to detect the true positives with 71.21% and 52.70% accuracy
respectively. But SVM outperforms Navie Bayes of similar work on the same
dataset. Also, Twitter API is used to fetch tweets and tweets are passed to the
model to detect whether the tweets are bullying or not.
v
CONTENT
1.INTRODUCTION 2
2.SYSTEM ANALYSIS
3.SYSTEM DESIGN 50
vi
3.3.3 Sequence diagram 55
3.3.4 Activity diagram 56
4.IMPLEMENTATION 59
Modules 59
5.RESULTS 70
6.SYSTEM TESTING 79
6.1 Types Of Tests 79
6.1.1 Unit testing 79
6.1.2 Integration testing 79
6.1.3 Functional testing 80
6.1.4 System testing 80
6.1.5 Whitebox testing 81
6.1.6 Blackbox testing 81
6.2 Sample Test Cases 84
7.1 Conclusion 86
7.2 Further enhancements 86
8.BIBLIOGRAPHY 88
vii
LIST OF FIGURES
LIST OF TABLES
viii
CHAPTER 1
1
INTRODUCTION
Nowadays technology has become a very important part of our lives and most people
can't livewithout it. The Internet provides a platform to share their ideas. Many people are
spending a large amount of time on social media. Communicating with people is no
exception, as technology has changed the way people interact with a broader manner and
has given a new dimension to communication. Many people are illegally using these
communities. Many youngsters are getting bullied these days. Bullies use various services
like Twitter, Facebook, Email to bully people. Studies show that about 37% of children in
India are involved in cyberbullying and nearly 14% of bullying occurs regularly.
Cyberbullying affects the victim both ways emotionally and psychologically. Social media
also allows bullies to harness the anonymity which satisfies their unkind deeds. Things also
get more serious when bullying occurs more repeatedly over time. So, preventing it from
happening will help the victim.
2
1.1 LITERATURE SURVEY
1.1.1 Social Media Cyberbullying Detection using Machine Learning
AUTHORS: John Hani Mounir, Mohamed Nashaat, Mostafa Ahmed,
Zeyad Emad, Eslam Amer, Ammar Mohammed
With the exponential increase of social media users, cyberbullying has been emerged
as a form of bullying through electronic messages. Social networks provides a rich
environment for bullies to uses these networks as vulnerable to attacks against victims.
Given the consequences of cyberbullying on victims, it is necessary to find suitable
actions to detect and prevent it. Machine learning can be helpful to detect language
patterns of the bullies and hence can generate a model to automatically detect
cyberbullying actions. This paper proposes a supervised machine learning approach for
detecting and preventing cyberbullying. Several classifiers are used to train and
recognize bullying actions. The evaluation of the proposed approach on cyberbullying
dataset shows that Neural Network performs better and achieves accuracy of 92.8%
and SVM achieves 90.3. Also, NN outperforms other classifiers of similar work on the
same dataset.
1.1.4 Social media bullying detection using machine learning on Bangla text
Cyber bullying is a new phenomenon resulting from the advance of new communication
technologies including the Internet, cell phones and Personal Digital Assistants. It is a
challenging bullying problem occurring in a new territory. Online bullying can be
particularly damaging and upsetting because it's usually anonymous or hard to trace. In
this paper, the proposed method is utilizing a dataset of real world conversations (i.e.
Pairs of questions and answers between cyber predator and the victim), in which each
predator question is manually annotated in terms of severityusing a numeric label. We
approach the issue as a sequential data modelling approach, in which the predator's
questions are formulated using a Singular Value Decomposition representation. The
motivation of this procedure is to study the accuracy of predicting the level of cyber
5
bullying attack using classification methods and also to examine potential patterns
between the lingustic style of each predator. More specifically, unlike previous
approaches that consider a fixed window of a cyber-predator's questions within a
dialogue, we exploit the whole question set and model it as a signal, whose magnitude
depends on the degree of bullying content. Using feature weighting and dimensionality
reduction techniques, each signal is straightforwardly parsed by a neural network that
forecasts the level of insult within a question given a window between two and three
previous questions. Throughout the time series modeling experiments, an interesting
discovery was made. By applying SVD on the time series data and taking into account
the second dimension (since thefirst is usually modeling trivial dependencies between
instances and attributes) we observed that its plot was very similar to the plot of the class
attribute. By applying a Dynamic Time Warping algorithm, the similarity of the
aforementioned signals was proved to exist, providing an immediate indicator for the
severity of cyber bullying within a give…..
6
CHAPTER 2
7
SYSTEM ANALYSIS
2.1 EXISTING SYSTEM:
Cyber bullying is the use of technology as a medium to bully someone. Although it
has been an issue for many years, the recognition of its impact on young people has
recently increased. Socialnetworking sites provide a fertile medium for bullies, and teens
and young adults who use these sites are vulnerable to attacks. Through machine learning,
we can detect language patterns used bybullies and their victims, and develop rules to
automatically detect cyber bullying content.
Hence the results of producing with such kind of results are not satisfying.
Algorithms: KNN.
The first step in the solution is to collect the tweets from Twitter usingTwitter API. In
the next twosteps are data preprocessing and feature extraction is performed over the
tweets. And after performing preprocessing and feature extraction tweets are passed to
the SVM model for classification to predict whether the tweet is Bullying or Non-
8
Bullying. The second step In this step, the proposed model has transformed the data in a
suitable form which is passed to the machinelearning algorithms. The TFDIF vectorizer
[1] is used to extract the features of the given data. Features of the data are extracted and
put them in a list of features. Also, the polarity (i.e. the text is Bullying or Non-Bullying)
of each text is extracted and stored in the list of features. The third step To detect social
media bullying automatically, supervised Binary classification machine learning
algorithms like SVM with linear kernel and Naive Bayes is used. The reason behind this
is both SVM and Naive Bayes calculate the probabilities for each class (i.e. probabilities
of Bullying and Non-Bullying tweets). Both SVM and NB algorithms are used for the
classificationof the two-cluster.
Naive Bayes models are used recommendation systems, sentiment analysis, and
spam filtering. Naive Bayes algorithms are very easy to implement.
After performing preprocessing and feature extraction on the dataset, for training
and testing, and divided the dataset into ratios 0.45 and 0.55 respectively. Both
SVM and NaiveBayes are evaluated to calculate the accuracy, recall, f-score, and
precision. Interestingly SVM outperformed Naive Bayes in every aspect.
the accuracies of both the Naive Bayes and SVM. The Support Vector Machine
achieved the highest accuracy i.e. 71.25%, while Naive Bayes achieved 52.70%
accuracy.
9
2.3 SYSTEM ENVIRONMENT:
2.3.1 Python:
Python is a general-purpose interpreted, interactive, object-oriented, and high- level
programming language. An interpreted language, Python has a design philosoph that
code readability (notably using whitespace indentation to delimit code blocks rather
than curly brackets or keywords), and a syntax that allows programmers to express
concepts in fewer lines of code than might be usedin languages such as C++or Java. It
provides constructs that enable clear programming on both small and large scales. Python
interpreters are available for many operating systems. CPython, the reference
implementation of Python, is open source software and has a community-based
development model, as do nearly all of its variant implementations. CPython is
managed by the non- profit Python Software Foundation. Python features a dynamic
type system and automatic memory management. It supports multiple programming
paradigms, including object-oriented, imperative, functional and procedural, and has a
large and comprehensive standard library.
Invoking the interpreter without passing a script file as a parameter brings up the
following prompt –
$ python
10
>>>
Type the following text at the Python prompt and press the Enter −
If you are running new version of Python, then you would need to use print statement
with parenthesis as in print ("Hello, Python!");. However in Python version 2.4.3, this
produces the following result −
Hello, Python!
Invoking the interpreter with a script parameter begins execution of the script and
continues until the script is finished. When the script is finished, the interpreter is no
longer active.
Let us write a simple Python program in a script. Python files have extension .py. Type
the following source code in a test.py file –
Live Demo
We assume that you have Python interpreter set in PATH variable. Now, try to runthis
program as follows −
$ python test.py
Live
Demo
#!/usr/bin/p
ython
print "Hello, Python!"
We assume that you have Python interpreter available in /usr/bin directory. Now,try to
run this program as follows −
$./test.py
Python Identifiers
A Python identifier is a name used to identify a variable, function, class, module orother
object. An identifier starts with a letter A to Z or a to z or an underscore (_) followed by
zero or more letters, underscores and digits (0 to 9).
Python does not allow punctuation characters such as @, $, and % within identifiers.
Python is a case sensitive programming language. Thus, Manpower andmanpower are
two different identifiers in Python.
12
Class names start with an uppercase letter. All other identifiers start with alowercase
letter.
Starting an identifier with a single leading underscore indicates that the identifier is
private.
If the identifier also ends with two trailing underscores, the identifier is a language-
defined special name.
Reserved Words
The following list shows the Python keywords. These are reserved words and you cannot
use them as constant or variable or any other identifier names. All the Python keywords
contain lowercase letters only.
13
Lines and Indentation
Python provides no braces to indicate blocks of code for class and function definitions or
flow control. Blocks of code are denoted by line indentation, which is rigidly enforced.
The number of spaces in the indentation is variable, but all statements within theblock
must be indented the same amount. For example −
if True:
print
“True”
else:
print "False"
if True:
print
"Answe
r"print
"True"
else:
print
"Answer
"print
"False"
Thus, in Python all the continuous lines indented with same number of spaces
would form a block. The following example has various statement blocks −
14
Note − Do not try to understand the logic at this point of time. Just make sure you
understood various blocks even if they are without braces.
#!/usr/bin/p
ython
import sys
try:
file =
open(file_name, "w")
except IOError:
print "There was an error writing to", file_name
sys.exit()
print "Enter '",
file_finish,print "'
When finished"
while file_text != file_finish:
file_text = raw_input("Enter
text: ")if file_text ==
file_finish:
# close
the file
file.clo
se
break
file.write(file_text)
file.write
("\n")
15
file.close
()
file_name = raw_input("Enter filename:
")if len(file_name) == 0:
print "Next time please enter
something"sys.exit()
try:
file =
open(file_name, "r")
except IOError:
print "There was an error reading
file"sys.exit()
file_text =
file.read()
file.close()
print file_text
Multi-Line Statements
Statements in Python typically end with a new line. Python does, however, allow the use
of the line continuation character (\) to denote that the line shouldcontinue. For example
−
total =
item_one + \
item_two + \
item_three
16
Statements contained within the [], {}, or () brackets do not need to use the line
continuation character. For example −
Python accepts single ('), double (") and triple (''' or """) quotes to denote string
literals, as long as the same type of quote starts and ends the string.
The triple quotes are used to span the string across multiple lines. For example, allthe
following are legal −
word = 'word'
17
total =
item_one + \
item_two + \
item_three
Statements contained within the [], {}, or () brackets do not need to use the line
continuation character. For example −
Python accepts single ('), double (") and triple (''' or """) quotes to denote string
literals, as long as the same type of quote starts and ends the string.
The triple quotes are used to span the string across multiple lines. For example, allthe
following are legal −
word = 'word'
Live Demo
#!/usr/bin/py
thon# First
comment
18
print "Hello, Python!" # second
commentThis produces the following
result − Hello, Python!
You can type a comment on the same line after a statement or expression −name =
"Madisetti" # This is again comment
You can comment multiple lines as
follows −# This is a comment.
# This is a
comment, too. #
This is a comment,
too. # I said that
already.
Following triple-quoted string is also ignored by Python interpreter and can be usedas a
multiline comments:
'''
This is a
multiline
comment.
'''
The following line of the program displays the prompt, the statement saying “Pressthe
19
enter key to exit”, and waits for the user to take action −
#!/usr/bin/python
Here, "\n\n" is used to create two new lines before displaying the actual line. Oncethe user
presses the key, the program ends. This is a nice trick to keep a console window open
until the user is done with an application.
The semicolon ( ; ) allows multiple statements on the single line given that neither
statement starts a new code block. Here is a sample snip using the semicolon.
Header lines begin the statement (with the keyword) and terminate with a colon (
: ) and are followed by one or more lines which make up the suite. For example −if
expression :
suite
elif expression :
suite
Many programs can be run to provide you with some basic information about howthey
20
should be run. Python enables you to do this with -h −
$ python -h
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ... Options
and arguments (and corresponding environment variables):
-c cmd : program passed in as string (terminates option list)
Python Lists
The list is a most versatile datatype available in Python which can be written as a list of
comma-separated values (items) between square brackets. Important thing about a list is
that items in a list need not be of the same type.
list2 = [1, 2, 3, 4, 5 ];
Similar to string indices, list indices start at 0, and lists can be sliced, concatenated and
so on.
21
A tuple is a sequence of immutable Python objects. Tuples are sequences, just likelists.
The differences between tuples and lists are, the tuples cannot be changed unlike lists
and tuples use parentheses, whereas lists use square brackets.
tup2 = (1, 2, 3, 4, 5 );
tup3 = "a", "b", "c", "d";
tup1 = (50,);
Like string indices, tuple indices start at 0, and they can be sliced, concatenated,and so
on.
To access values in tuple, use the square brackets for slicing along with the index or
indices to obtain value available at that index. For example −
Live
Demo
#!/usr/bin/p
ython
tup1 = ('physics', 'chemistry', 1997, 2000);
tup2 = (1, 2, 3, 4, 5, 6, 7 );
22
Updating Tuples
To access dictionary elements, you can use the familiar square brackets along withthe
key to obtain its value. Following is a simple example −
Live
Demo
#!/usr/bin/p
ython
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
If we attempt to access a data item with a key, which is not part of the dictionary,we get
an error as follows −
Live Demo
#!/usr/bin/p
ython
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
23
dict['Alice']:
Updating Dictionary
You can update a dictionary by adding a new entry or a key-value pair, modifying an
existing entry, or deleting an existing entry as shown below in the simple example
−
Live
Demo
#!/usr/bin/p
ython
dict = {'Name': 'Zara', 'Age': 7, 'Class':
'First'}dict['Age'] = 8; # update existing
entry
dict['School'] = "DPS School"; # Add new
entryprint "dict['Age']: ", dict['Age']
print "dict['School']: ", dict['School']
24
dict['Age']: 8
dict['School']: DPS
School Delete
Dictionary Elements
You can either remove individual dictionary elements or clear the entire contentsof a
dictionary. You can also delete entire dictionary in a single operation.
To explicitly remove an entire dictionary, just use the del statement. Following is a
simple example −
Live
Demo
#!/usr/bin/p
ython
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
This produces the following result. Note that an exception is raised because afterdel
dict dictionary does not exist any more −
25
dict['Age']:
Dictionary values have no restrictions. They can be any arbitrary Python object, either
standard objects or user-defined objects. However, same is not true for thekeys.
(a) More than one entry per key not allowed. Which means no duplicate key is allowed.
When duplicate keys encountered during assignment, the last assignment wins. For
example −
Live Demo
#!/usr/bin/p
ython
dict = {'Name': 'Zara', 'Age': 7, 'Name': 'Manni'}
Live Demo
#!/usr/bin/p
ython
dict = {['Name']: 'Zara', 'Age': 7}
Tuples are immutable which means you cannot update or change the values of tuple
elements. You are able to take portions of existing tuples to create new tuples as the
following example demonstrates −
Live Demo
#!/usr/bin/p
ythontup1 =
(12, 34.56);
27
tup2 = ('abc', 'xyz');
When the above code is executed, it produces the following result –(12,
34.56, 'abc', 'xyz')
Delete Tuple Elements
Removing individual tuple elements is not possible. There is, of course, nothing
wrong with putting together another tuple with the undesired elements discarded.
To explicitly remove an entire tuple, just use the del statement. For example −
Live
Demo
#!/usr/bin/p
ython
tup = ('physics', 'chemistry', 1997,
2000);print tup;
del tup;
28
This produces the following result. Note an exception raised, this is because afterdel
tup tuple does not exist any more −
29
2.3.2 DJANGO
30
Django also provides an optional administrative create, read, update and delete
interface that is generated dynamically through introspection and configured via admin
models
Create a Project
Whether you are on Windows or Linux, just get a terminal or a cmd prompt and
navigate to the place you want your project to be created, then use this code −
init .py
settings.
31
py
urls.py
wsgi.py
The “myproject” folder is just your project container, it actually contains two elements
−
manage.py − This file is kind of your project local django-admin for interacting withyour
project via command line (start the development server, sync db...)
The “myproject” subfolder − This folder is the actual python package of your project. It
contains four files −
urls.py − All links of your project and the function to call. A kind
of ToC of yourproject.
32
The Project Structure
The “myproject” folder is just your project container, it actually contains two elements
−
manage.py − This file is kind of your project local django-admin for interacting withyour
project via command line (start the development server, sync db...). To get a full list of
command accessible via manage.py you can use the code −
The “myproject” subfolder − This folder is the actual python package of your project. It
contains four files −
DEBUG = True
This option lets you set if your project is in debug mode or not. Debug mode letsyou
get more information about your project's error. Never set it to ‘True’ for a live
project. However, this has to be set to ‘True’ if you want the Django light server to
serve static files. Do it only in the development mode.
33
DATABASES = {
'default': {
'ENGINE':
'django.db.backends.sqlite3',
'NAME': 'database.sql',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
Database is set in the ‘Database’ dictionary. The example above is for SQLite engine.As
stated earlier, Django also supports −
MySQL (django.db.backends.mysql)
PostGreSQL
(django.db.backends.postgresql_psycopg2)Oracle
(django.db.backends.oracle) and NoSQL DB
MongoDB (django_mongodb_engine)
Before setting any new engine, make sure you have the correct db driver installed.You
can also set others options like: TIME_ZONE, LANGUAGE_CODE, TEMPLATE…
34
Now that your project is created and configured make sure it's working −
You will get something like the following on running the above code −Validating
models...
0 errors found
A project is a sum of many applications. Every application has an objective and canbe
reused into another project, like the contact form on a website can be an application, and
can be reused for others. See it as a module of your project.
Create an Application
We assume you are in your project folder. In our main “myproject” folder, the samefolder
then manage.py −
You just created myapp application and like project, Django create a “myapp” folderwith
the application structure −
35
myapp/
init .py − Just to make sure python handles this folder as a package.
admin.py − This file helps you make the app modifiable in the admin interface.
models.py − This is where all the application models are stored.
tests.py − This is where your unit tests are.
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contentty
pes',
'django.contrib.sessions',
36
'django.contrib.messa
ges',
'django.contrib.staticf
iles','myapp',
)
Creating forms in Django, is really similar to creating a model. Here again, we just need
to inherit from Django class and the class attributes will be the form fields. Let's add a
forms.py file in myapp folder to contain our app forms. We will create alogin form.
myapp/forms.py
class LoginForm(forms.Form):
As seen above, the field type can take "widget" argument for html rendering; in ourcase,
we want the password to be hidden, not displayed. Many others widget are present in
Django: DateInput for dates, CheckboxInput for checkboxes, etc.
There are two kinds of HTTP requests, GET and POST. In Django, the request object
passed as parameter to your view has an attribute called "method"
37
where the type of the request is set, and all data passed via POST can be accessedvia the
request.POST dictionary.
if request.method == "POST":
MyLoginForm =
LoginForm(request.POST)if
MyLoginForm.is_valid():
username = MyLoginForm.cleaned_data['username']
else:
MyLoginForm = Loginform()
The view will display the result of the login form posted through the loggedin.html.To
test it, we will first need the login form template. Let's call it login.html.
<html>
<body>
38
method = "POST" >{% csrf_token %}
<center>
</center>
</div>
<br>
<center>
</div>
<br>
39
<center>
<strong>Login</strong>
</button>
</center>
</div>
</form>
</body>
</html>
The template will display a login form and post the result to our login view above. You
have probably noticed the tag in the template, which is just to prevent Cross- site Request
Forgery (CSRF) attack on your site.
{% csrf_token %}
Once we have the login template, we need the loggedin.html template that will be
rendered after form treatment.
<html>
<body>
40
You are : <strong>{{username}}</strong>
</body>
</html>
Setting Up Sessions
In Django, enabling session is done in your project settings.py, by adding some linesto the
MIDDLEWARE_CLASSES and the INSTALLED_APPS options. This should be done
while creating the project, but it's always good to know, so MIDDLEWARE_CLASSES
should have −
'django.contrib.sessions.middleware.SessionMiddleware'
And INSTALLED_APPS should have −
'django.contrib.sessions'
41
By default, Django saves session information in database (django_session table or
collection), but you can configure the engine to store information using other wayslike:
in file or in cache.
When session is enabled, every request (first argument of any view in Django) hasa
session (dict) attribute.
Let's create a simple sample to see how to create and save sessions. We have builta simple
login system before (see Django form processing chapter and Django Cookies Handling
chapter). Let us save the username in a cookie so, if not signed out, when accessing our
login page you won’t see the login form. Basically, let's make our login system we used
in Django Cookies handling more secure, by savingcookies server side.
For this, first lets change our login view to save our username cookie server side −def
login(request):
username = 'not logged in'
42
Let's create a simple sample to see how to create and save sessions. We have builta simple
login system before (see Django form processing chapter and Django Cookies Handling
chapter). Let us save the username in a cookie so, if not signed out, when accessing our
login page you won’t see the login form. Basically, let's make our login system we used
in Django Cookies handling more secure, by savingcookies server side.
For this, first lets change our login view to save our username cookie server side −def
login(request):
username = 'not logged in'
if request.method == 'POST':
MyLoginForm =
LoginForm(request.POST)if
MyLoginForm.is_valid():
username = MyLoginForm.cleaned_data['username']
request.session['username'] = username
else:
MyLoginForm = LoginForm()
Then let us create formView view for the login form, where we won’t display the form
if cookie is set −
def formView(request):
if request.session.has_key('username'):
43
username = request.session['username']
Now let us change the url.py file to change the url so it pairs with our new view −from
django.conf.urls import patterns, url
from django.views.generic import
TemplateViewurlpatterns =
patterns('myapp.views',
url(r'^connection/','formView', name = 'loginform'),
url(r'^login/', 'login', name = 'login'))
When accessing /myapp/connection, you will get to see the following page
FEASIBILITY STUDY:
The feasibility of the project is analyzed in this phase and business proposalis
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 thecompany. For
feasibility analysis, some understanding of the major
requirements for the system is essential.
44
Three key considerations involved in the feasibility analysis are,
ECONOMICAL FEASIBILITY
TECHNICAL FEASIBILITY
SOCIAL
FEASIBILITY
ECONOMICAL
FEASIBILITY
This study is carried out to check the economic impact that the system willhave
on the organization. The amount of fund that the company can pour into theresearch and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this wasachieved 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 highdemand
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 ornull 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. Theuser must
not feel threatened by the system, instead must accept it as a necessity.
45
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.
The project involved analyzing the design of few applications so as to make the
application more users friendly. To do so, it was really important to keep the navigations
from one screen to the other well ordered and at the same time reducing the amount of
typing the user needs to do. In order to make the application more accessible, the browser
version had to be chosen so that it is compatible with most of the Browsers.
REQUIREMENT SPECIFICATION
Functional Requirements
Software Requirements
For developing the application the following are the Software Requirements:
1. Python
2. Django
1. Windows 10 64 bit OS
46
Technologies and Languages used to Develop
1. Python
Hardware Requirements
For developing the application the following are the Hardware Requirements:
Processor: Intel i9
RAM: 32 GB
System : Intel i3
Ram : 4GB.
47
2.6.2 SOFTWARE REQUIREMENTS:
Designing : Html,css,javascript.
48
CHAPTER 3
49
SYSTEM DESIGN
50
3.2 DATA FLOW DIAGRAM:
The DFD is also called as bubble chart. It is a simple graphical formalism thatcan be used
to represent a system in terms of input data to the system, variousprocessing carried out
on this data, and the output data is generated by this system.
1. The data flow diagram (DFD) is one of the most important modeling tools. Itis
used to model the system components. These components are the system process,
the data used by the process, an external entity that interacts with thesystem and
the information flows in the system.
2. DFD shows how the information moves through the system and how it is
modified by a series of transformations. It is a graphical technique that depicts
information flow and the transformations that are applied as data moves from
input to output.
3. DFD is also known as bubble chart. A DFD may be used to represent a systemat
any level of abstraction. DFD may be partitioned into levels that represent
increasing information flow and functional detail.
51
3.3 UML DIAGRAMS
GOALS:
53
3.3.2 CLASS DIAGRAM:
54
3.3.3 SEQUENCE DIAGRAM:
55
56
3.3.4 ACTIVITY DIAGRAM:
57
CHAPTER 4
58
IMPLEMENTATION:
4.1 MODULES:
User
Admin
Data Preprocessing
Machine Learning
MODULES DESCRIPTION:
4.1.1 User:
The User can register first. While registering he required a valid user email and mobile
for further communications. Once the user register then admin can activatethe user. Once
admin activated the user then user can login into our system. User can upload the dataset
based on our dataset column matched. For algorithm execution data must be in int
or float format. Here we took Adacel Technologies Limited dataset for testing
purpose. User can also add the new data for existing dataset based on our Django
application. User can click the Data Preparations in the web page so that the data cleaning
process will be starts. The cleaned data and its required graph will be displayed.
4.1.2 Admin:
Admin can login with his login details. Admin can activate the registered users. Oncehe
activate then only the user can login into our system.
Admin can view Users and he can view overall data in the browser and he load thedata.
Admin can view the training data list and test data list. Admin can load the data and view
forecast results.
59
4.1.3 Data Processing:
A dataset can be viewed as a collection of data objects, which are often also calledas a
Sentiment tweets like positive, negative and neutral. Data objects are describedby a number
of features that capture the basic characteristics of an object, such asthe mass of a physical
object or the time at which an event occurred, etc. Featuresare often called as variables,
characteristics, fields, attributes, or dimensions. The study is based on a pipeline that
involves preprocessing, sentiment analysis, topic modeling, natural language processing
and statistical analysis of Twitter data extracted in the form of tweets. We use Tweets
and Sentiment amount of data.
Based on the split criterion, the cleaned data is split into 80% training and 20% test,then
the dataset is subjected to one machine learning classifier such as Natural Language
Process(NLP). Sentiment analysis by fine tuning auto encoding models like BERT and
ALBERT to achieve a comprehensive understanding of public sentiment. Thus, we have
analyzed the results of our experiment and methodologyusing the contextual information
and verified the insights.
def
UserRegisterActions(reque
st):if request.method ==
'POST':
form =
UserRegistrationForm(request.POST)if
form.is_valid():
print('Data is
Valid')
form.save()
messages.success(request, 'You have been successfully registered')form =
UserRegistrationForm()
form = UserRegistrationForm()
loginid =
request.POST.get('loginid')pswd
= request.POST.get('pswd')
61
print("Login ID = ", loginid, ' Password = ',
pswd)try:
check =
UserRegistrationModel.objects.get(
loginid=loginid, password=pswd)
status = check.status
print('Status is = ',
status)if status ==
"activated":
request.session['id'] = check.id
request.session['loggeduser'] =
check.namerequest.session['loginid'] =
loginid
request.session['email'] = check.email
print("User id At", check.id, status)
print('Exception is ',
str(e))pass
messages.success(request, 'Invalid Login id and password')
return render(request, 'UserLogin.html', {})
def UserHome(request):
svm_acc, svm_report =
twitterMLEDA.process_SVM() svm_report =
pd.DataFrame(svm_report).transpose() svm_report =
pd.DataFrame(svm_report)
nb_acc, nb_report = twitterMLEDA.process_naiveBayes()
nb_report = pd.DataFrame(nb_report).transpose()
nb_report = pd.DataFrame(nb_report)
return render(request, 'users/twitterMl.html',
def
predictTrustWorthy(reques
t):if request.method ==
'POST':
test_user_data =
request.POST.get('news')
print(test_user_data)
from .utility import twitterMLEDA
result = twitterMLEDA.fake_news_det(test_user_data)
63
Base.html
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;
700;800&display=swap" rel="stylesheet">
<link
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css "
rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.10.0/css/all.min.css" rel="stylesheet">
64
rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</div>
{%block contents%}
{%end
block%
}
<div class="row">
<div class="col-md-6">
</div>
<div class="col-md-6">
</div>
</div>
</div>
</div>
-->
66
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.mi
n.js"></script>
</body>
</html>
return render(request,'admins/viewregisterusers.html',{'data':data})
def ActivaUsers(request):
if request.method ==
'GET': id =
request.GET.get('uid
')status = 'activated'
print("PID = ", id,
status)
UserRegistrationModel.objects.filter(id=id).update(status=status)data =
UserRegistrationModel.objects.all()
return render(request,'admins/viewregisterusers.html',{'data':data})
68
CHAPTER 5
69
RESULTS
Input Design:
The input design is the link between the information system and the user.
It comprises the developing specification and procedures for data preparation and those
steps are necessary to put transaction data in to a usable form for processing can be
achieved by inspectingthe computer to read data from a written or printed document or
it can occur by having people keying the data directly into the system. The design of
input focuses on controlling the amount ofinput required, controlling the errors, avoiding
delay, avoiding extra steps and keeping the processsimple. The input is designed in such
a way so that it provides security and ease of use with retaining the privacy. Input Design
considered the following things:
Objectives:
3. When the data is entered it will check for its validity. Data can be entered
70
with the help of screens. Appropriate messages are provided as when needed so that the
user will not be inmaize of instant. Thus the objective of input design is to create an input
layout that is easy to follow
Output Design:
A quality output is one, which meets the requirements of the end user and
presents the information clearly. In any system results of processing are communicated
to the users and toother system through outputs. In output design it is determined how
the information is to be displaced for immediate need and also the hard copy output. It
is the most important and direct source information to the user. Efficient and intelligent
output design improves the system’s relationship to help user decision-making.
71
Trigger an action.
Confirm an action.
5.1 Screenshots:
72
5.2 User register:
73
5.4 User details:
74
5.6 User home:
75
5.8 Ml results:
76
5.9 Predict results true:
77
CHAPTER 6
78
System Testing
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid outputs. All
decision branches and internal code flow should be validated. It is the testing of
individual software units of the application .it is done after the completion of an
individual unit before integration. This is a structural testing, that relies on knowledge of
its construction and is invasive. Unit tests perform basic tests at component level and test
a specific business process, application, and/or system configuration. Unit tests ensure
that each unique path of a business process performs accurately to the documented
specifications and contains clearly defined inputs and expected results.
79
6.1.3 Functional Testing
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is theconfiguration oriented system integration test. System
testing is based on process descriptions andflows, emphasizing pre-driven process links
and integration points.
80
6.1.5 White Box Testing
White Box Testing is a testing in which in which the software tester has knowledge
of the inner workings, structure and language of the software, or at least its purpose. It is
purpose.It is used to test areas that cannot be reached from a black box level.
Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as most other
kinds of tests, mustbe written from a definitive source document, such as specification or
requirements document, such as specification or requirements document. It is a testing in
which the software under test is treated, as a black box .you cannot “see” into it. The test
provides inputs and responds to outputs without considering how the software works.
Unit testing is usually conducted as part of a combined code and unit test phase of
the software lifecycle, although it is not uncommon for coding and unit testing to be
conducted astwo distinct phases.
Field testing will be performed manually and functional tests will be written in
detail.
Test objectives
All field entries must work properly.
Features to be tested
Verify that the entries are of the correct format
Integration Testing
The task of the integration test is to check that components or software applications, e.g.
components in a software system or – one step up – software applications at the company
level – interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
User Acceptance Testing is a critical phase of any project and requires significant
participation bythe end user. It also ensures that the system meets the functional
requirements.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
82
6.2 Sample Test Cases
Remarks(IF
S.no Test Case Excepted Result Result
Fails)
If already user
1 User Register If User registration successfully. Pass email exist
thenit
fails.
Un
If Username and password is
2 User Login Pass Register
correct then it will getting
Users will
valid page.
not
logged in.
The request
The request will be accepted by will be not
svm
3 thesvm Pass accepted by
the svm
otherwise its
failed
The request
The request will be accepted by will be
4 Naive Bayes theNaive Bayes Pass accepted by the
Naive Bayes
otherwise its
failed
View dataset by Results not true
5 Data set will be displayed by the Pass
user user failed
Results not
6 User Display reviews with true results Pass
truefailed
classification
83
Calculate macro avg and
macro avg and weighted
7 accuracy Pass weighted avg
avg calculated
macro avg and not displayed
weighted avg failed
Result will be cyberbulling or not
8 prediction pass Otherwise fail
cyberbulling
Admin can login with his login Invalid login
9 Admin login credential. If success he get his Pass details will
homepage not allowed
here
Admin can If user id
10 activate the Admin can activate the register user Pass not found
register users id then it
won’t login.
84
CHAPTER 7
85
CONCLUSION & FUTURE ENHANCEMENT
7.1 CONCLUSION
Further research on this topic to improve and design better models to improve
accuracy andgenerate reviews.
86
CHAPTER 8
87
BIBLIOGRAPHY
[1] John Hani Mounir, Mohamed Nashaat, Mostafa Ahmed, Zeyad Emad, Eslam Amer,
Ammar Mohammed, “Social Media Cyberbullying Detection using Machine Learning”,
(IJACSA) International Journal of Advanced Computer Science and Applications Vol.
10, pages 703-707, 2019.
[2] Kelly Reynolds, April Kontostathis, Lynne Edwards, "Using Machine Learning to
Detect Cyberbullying”, 2011 10th International Conference on Machine Learning and
Applications volume 2, pages 241–244. IEEE, 2011
[6] Ying Chen, Yilu Zhou, Sencun Zhu, and Heng Xu. “Detecting offensive language in
social media to protect adolescent online safety”. In Privacy, Security, Risk and Trust
(PASSAT), 2012 International Conference on and 2012 International Conference on
Social Computing (SocialCom), pages 71– 80. IEEE, 2012
[7] Vikas S Chavan, SS Shylaja. “Machine learning approach for detection of cyber-
aggressive comments by peers on social media network". In Advances in computing,
communications, and informatics (ICACCI), 2015 International Conference on, pages
2354–2358. IEEE,2015
88
appearance patterns”, In Knowledge and Smart Technology (KST), 2017 9th
International Conference on, pages 242–
247. IEEE, 2017
[9] https://muthu.co/understanding-the-classification-report-in-sklearn/
[10] https://developer.twitter.com/en/apps
[11] https://text-processing.com/demo/tokenize/
[12] https://towardsdatascience.com/support-vector-machine-introduction-
tomachine-learning- algorithms-934a444fca47
[13] https://towardsdatascience.com/naive-bayes-classifier-81d512f50a7c
89
90