Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 60

DETECTION OF DEPRESSION IN SPEECH

A Project Report Submitted in partial fulfillment of the requirements


for the award of the degree of
BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE AND ENGINEERING

Submitted By
PADAM HARIKA SANTHOSHI BANGARI (17H41A0596)
CHITTURI NIKHIL (17221A0521)
CHALLA LAKSHMI SRIDEVI (17221A0515)
CHIKKAM AISHWARYA (17221A0520)

Under the Esteemed Guidance of


Mr. B P N MADHU KUMAR
M.Tech., (Ph.D), MISTE

Associate Professor

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

BONAM VENKATA CHALAMAYYA ENGINEERING COLLEGE


(AUTONOMOUS)

(Approved by A.I.C.T.E, New Delhi & Affiliated to J.N.T.U.K, Kakinada)

(Accredited by NAAC with “A‟ Grade)

ODALAREVU-533210
2017– 2021

2
BONAM VENKATA CHALAMAYYA ENGINEERING COLLEGE
(AUTONOMOUS)
ODALAREVU-533210

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that the project work entitled “DETECTION OF DEPRESSION IN SPEECH” is
being submitted for the partial fulfillment of the requirements for the award of the degree of Bachelor Of
Technology in Computer Science and Engineering to B V C Engineering College, Odalarevu, is a
bonafide work done by PADAM HARIKA SANTHOSHI BANGARI (17H41A0596), CHITTURI
NIKHIL (17221A0521), CHALLA LAKSHMI SRIDEVI (17221A0515), CHIKKAM AISHWARYA
(17221A0520) under my guidance during the academic year 2017 – 2021 and it has been found suitable for
acceptance according to the requirement of the University.

The results embodied in this thesis have not been submitted to any other University or Institute for
the award of any degree.

Project Guide Head of the Department


Mr. B P N MADHU KUMAR Dr. GUNAMANI JENA.
M.Tech, (Ph.D), MISTE M.E, Ph.D

Associate Professor Professor

2
EXTERNAL EXAMINER
ACKNOWLEDGEMENT

We profoundly grateful to express our deep sense of gratitude and respect towards our guide Mr.
B.P.N MADHU KUMAR, Associate Professor of CSE Department, B V C Engineering College,
Odalarevu, for his excellent guidance right from selection of the project and his valuable suggestions
throughout the project work. His constant encouragement and support has been the cause of our success, in
completing this thesis in the college.
We also grateful to the project Coordinator Dr. P.DEVABALAN Professor CSE Department, B V
C Engineering College, Odalarevu, for her excellent guidance right from selection of the project and her
valuable suggestions throughout the project work.

We really thankful to Dr. GUNAMANI JENA Professor and Head of the Department of
Computer Science and Engineering for providing the laboratory facilities to the fullest extent as and when
required and also for giving us the opportunity to carry out the project work in the college.

We also thankful to Dr. D S V PRASAD, Principal, B V C Engineering College, Odalarevu, for his
support during and till the completion of the project.

We thankful to all the teaching and non-teaching staff of Computer Science and Engineering
Department, Management, B V C Engineering College, Odalarevu, and our friends for their direct and
indirect help provided to us in completing the project.

Project Associates………
PADAM HARIKA SANTHOSHI BANGARI (17H41A0596)
CHITTURI NIKHIL
(17221A0521)
CHALLA LAKSHMI SRIDEVI
(17221A0515)
CHIKKAM AISHWARYA
(17221A0520)

2
ABSTRACT

Depression is a common mental disorder and one of the main causes of disability worldwide. Lacking
objective depressive disorder assessment methods is the key reason that many depressive patients can't be
treated properly. Developments in affective sensing technology with a focus on acoustic features will
potentially bring a change due to depressed patient's slow, hesitating, monotonous voice as remarkable
characteristics. Our motivation is to find out a speech feature set to detect, evaluate and even predict
depression. For these goals, we investigate a large sample of 300 subjects (100 depressed patients, 100
healthy controls and 100 high-risk people) through comparative analysis and follow-up study. For
examining the correlation between depression and speech, we extract features as many as possible according
to previous research to create a large voice feature set. Then we employ some feature selection methods to
eliminate irrelevant, redundant and noisy features to form a compact subset. To measure effectiveness of this
new subset, we test it on our dataset with 300 subjects using several common classifiers and 10-fold cross-
validation. Since we are collecting data currently, we have no result to report yet.

In this project we are detecting depression from users post,user can upload post in the form of text file,image
file, or audio file,this project an help peoplewho are in depression by sending motivated messages to
them.Now-a-days peoples are using online post service to interact with each other compare to human to
human interaction.So by analysinguser post this application can detect depression and send motivation
messages to them.Administrator of this application will send motivation messages to all people who are
depression.To detect depression we are using SVM (support vector machine)algorithm which analyse users
post and give result as negative or positive.If users express depression words in post then SVM detect it as a
negative post else positive post.

2
TABLE OF CONTENTS
ABSTRACT i

TABLE OF CONTENTS ii

CHAPTER 1

INTRODUCTION 1 ……………………………………………8

1.1.About the Project ……………………………………………..8

1.2.Project Overview ……………………………………………...8

1.3.Existing System ………………………………………………. 8

1.4.Proposed system…………………………………………………9

CHAPTER 2

SYSTEM OVERVIEW ……………………………………………10

2.1.Requirment Specifications
Software Requirements Specifications(SRS) ……………………10

2.1.1.Functional Requirements………………………………………10

2.1.2.Non Functional Requirements …………………………………10

2.2.System Specifications

2.2.1.Hardware Requirements ……………………………………..10

2.2.2.Software Requirements …………………………………….11

CHAPTER 3

SYSTEM ANALYSIS AND DESIGN PHASE……………………12

3.1.Html …………………………………………………………………12

3.2.xml ……………………………………………………………12

3.2.1.Xml usage ……………………………………………………12

3.2.2.what is markup …………………………………………………12

3.2.3.xml tags ..………………………………………………...12

3.3.Introduction …………………………………………………….13

3.4.UsecaseDiagram……………………………………………………14

3.5.Class Diagram ……………………………………………………….15


2
3.6. Sequence Diagram………………………………………..16

3.7. Activity Diagram………………………………………….17

3.8.State Chart Diagram…………………………………………18

3.9.Data Design………………………………………………….19

3.10.Conclusion…………………………………………………19

CHAPTER 4

SYSTEM LOW LEVEL DESIGN……………………………20

4.1.Modules of the project………………………………………20

4.2.Objectives…………………………………………………..20

4.3.Project overview…………………………………………….20

CHAPTER 5

SOFTWARE ENVIRONMENT………………………………..21

5.1.What is python………………………………………………..21

5.2.Advantages……………………………………………………21

5.3.Applications…………………………………………………21

5.4.Disadvantages………………………………………………..24

5.5.Installation…………………………………………………….26

CHAPTER 6

IMPLEMENTATION……………………………………………32

6.1.Sample Code…………………………………………………..32

6.2.Screen Captures……………………………………………….39

6.3.Firebase Analytics

CHAPTER 7

TESTING…………………………………………………………..55

7.1.Software Testing………………………………………………55

7.2.Black Box Testing……………………………………………55

7.3.White Box Testing……………………………………………55

7.4.Performance Testing………………………………………….55

7.5.Load Testing…………………………………………………..55
2
7.6. Manual Testing……………………………………………….55

7.7.Firebase TestLab

CHAPTER 8

RESULTS AND CHALLENGES…………………………………58

8.1.Results…………………………………………………………..58

8.2.Challenges……………………………………………………….58

CHAPTER 9

CONCLUSIONS AND FUTURE WORK…………………………59

9.1.Conclusion………………………………………………………..59

9.2.Scope for future work……………………………………………..59

9.3.Limitations…………………………………………………………59

BIBILOGRAPHY

2
CHAPTER 1
INTRODUCTION
1.1.About the project

The proliferations of internet and communication technologies,especially the online social networks have
rejuvenated how people interact and communicate with each other electronically.The applications such as
facebook,twitter,instragram and alike not only host the written and multimedia contents but also offer their
users to express their feelings ,emotions and sentiments about a topic subject or an issue online.On one
hand,this is greatf for users of social networking site to openly and freely contribute and respond to any
topic online other hand it create opportunities for people working in the health sector to get insight of what
might be happening at mental state of someone who reacted to a topic in a specific manner.In order to
provide such insight,machine learning techniques could potentially offer some unique features that can assist
in examining the unique pattern hidden in online communication and process them to reveal the mental
state(such as ‘happiness’,’sad-ness’,’anger’,’anxiety’,depression)among social networks users.Morever,there
is growing body of literature addressing the rule of social networks on the structure ofsocialrelationships
such as breakup ,mental illness(‘depression’,’anxiety’,’bipolar’etc),
Smoking and drinking relapse,sexual harassment and for suicide ideati.

1.2.Project overview

In this project we are detecting depression from users post, user can upload post in the form of text file,
image file or audio file, this project can help peoples who are in depression by sending motivated messages
to them. Now-a-days peoples are using online post services to interact with each other compare to human to
human interaction. So by analysing users post this application can detect depression and send motivation
messages to them. Administrator of this application will send motivation messages to all peoples who are in
depression. To detect depression we are using SVM (support vector machine) algorithm which analyse users
post and give result as negative or positive. If users express depression words in post then SVM detect it as a
negative post else positive post.

1.3.Existing System
 detecting depression from users post, user can upload post in the form of text file, image
file or audio file, this project can help peoples who are in depression by sending motivated
messages to them. Now-a-days peoples are using online post services to interact with each
other compare to human to human interaction.
 we aim to analyze Facebook data to detect any factors that may reflect the depression of
rel- evant Facebook’s users. Various machine learning techniques are employed for such
purpose. Considering the key objective of this study, the following are subsequent research
challenges addressed in paper.
 As users express their feeling as a post or comments in the Face-book platform, sometimes
their posts and comments refer to as emotional state such as ‘joy’, ‘sadness’, ‘fear’, ‘anger’,
or ‘surprise’ .

2
1.4.proposed System

 To implement this project we are using python Speech Recognition API which will read
text from audio files and then SVM will analyse that text to detect depression, user can also
upload images via post and python Tesseract OCR (Optical Character Recognition) API
can read text from uploaded image and then SVM will detect depression from that text,
User can upload post in text file also.

Advantages :

 Security
 Communcation

2
CHAPTER 2

SYSTEM OVERVIEW

2.1.Requirement Specification

This chapter provides the details of the project’s need based survey, system requirements, Hardware
Requirements, Software Requirements, and System Requirements.

2.1.1.Functional requirements

In software engineering, a functional requirement defines a system or its component.It describes


the functions a software must perform.A function is nothing but inputs,its behavior and outputs.It
can be a calculation,datamanupalation,business process,user interaction,or any other specific
functionality which defines what function a system is likely to perform.

Functional software requirements help you to capture the intended behavior of the system. This
behavior may be expressed as functions, services or tasks or which system is required to perform.

2.1.2.Non –Functional Requirements

A non-functional requirement defines the quality attribute of a software system. They


represent a set of standards used to judge the specific operation of a system. Example,
how fast does the website load?

A non-functional requirement is essential to ensure the usability and effectiveness of the


entire software system.Failing to meet non-functional requirements can result in systems
that fail to satisfy user needs.

2.2.System Specifications

2.2.1Hardware Requirements

• Operating System supported by


1. Windows 7
2. Windows XP
3 . Windows 8
• Processor – Pentium IV or higher
• RAM -- 256 MB
• Space on Hard Disk -- Minimum 512 MB

2
2.2.2Software Requirements

• For developing the Application


1. Python
2. Django
3. Mysql
4. Mysqlclient
5. WampServer 2.4
• Technologies and Languages used to Develop
-- Python

1.HOME PAGE:-

XML
JAVA

2.REGISTRATIONPAGE:-

XML
JAVA

3.LOGIN PAGE:-

XML
JAVA

4.BOOKINGS PAGE

XML
JAVA

5.REFERRALS PAGE

XML
JAVA

6.PROFILE PAGE

XML
JAVA

7.PREFERENCE PAGE

XML
JAVA

8.SP LOGIN PAGE

XML
JAVA

9.SP SIGN UP PAGE

XML
JAVA

10.SP BOOKING PAGE

XML
JAVA

2
CHAPTER 3

SYSTEM ANALYSIS AND DESIGN PHASE


.
3.1.Html

 HTML stands for Hyper Text Markup Language


 HTML is the standard markup language for creating Web pages
 HTML describes the structure of a Web page
 HTML consists of a series of elements
 HTML elements tell the browser how to display the content
 HTML elements label pieces of content such as "this is a heading", "thi is a
paragraph", "this is a link", etc.

3.2.Xml

 XML stands for eXtensible Markup Language


 XML is a markup language much like HTML
 XML was designed to store and transport data
 XML was designed to be self-descriptive
 XML is a W3C Recommendation

3.2.1.Xml Usage

A short list of XML usage says it all −


 XML can work behind the scene to simplify the creation of HTML documents for large web
sites.
 XML can be used to exchange the information between organizations and systems.
 XML can be used for offloading and reloading of databases.
 XML can be used to store and arrange the data, which can customize your data handling
needs.
 XML can easily be merged with style sheets to create almost any desired output.
 Virtually, any type of data can be expressed as an XML documents.

3.2.2.What is Markup

XML is a markup language that defines set of rules for encoding documents in a format that is both human-
readable and machine-readable. So what exactly is a markup language? Markup is information added to a
document that enhances its meaning in certain ways, in that it identifies the parts and how they relate to each
other. More specifically, a markup language is a set of symbols that can be placed in the text of a document
to demarcate and label the parts of that document.

3.2.3 Xml tags

Start tag:

2
The beginning of every non-empty XML element is marked by a start-tag. Following is an example of
start-tag −
<address>

End tag:

Every element that has a start tag should end with an end-tag. Following is an example of end-tag –
</address>

Note, that the end tags include a solidus ("/") before the name of an element.

Empty tag:

The text that appears between start-tag and end-tag is called content. An element which has no content is
termed as empty. An empty element can be represented in two ways as follows −
A start-tag immediately followed by an end-tag as shown below
<hr></hr>
A complete empty tag is shown below
<hr/>
Empty element tags may be used for any element which has no content.

3.3.INTRODUCTION

This chapter provides the design phase of the Application. To design the project, we use the UML
diagrams. The Unified Modelling Language (UML) is a general- purpose, developmental, modelling
language in the field of software engineering that is intended to provide a standard way to visualize the
design of a system.

2
3.4.USE CASE DIAGRAM

Fig 2.1 Use case Diagram

The use case diagram is used to represent all the functional use cases that are involved in the project.
The above diagram represents the main two actors in the project, they are
User

2
3.5.CLASS DIAGRAM

Fig 3.2 class diagram

The above mentioned class diagram represents the Chatbot system workflow model. This diagram has class
models with class names as
User
Admin
Home screen

2
3.6.SEQUENCE DIAGRAM

Fig 3.5 sequence diagram

The above diagram represents the sequence of flow of actions in the system.

2
3.7.ACTIVITY DIAGRAM

2
3.8.STATECHART DIAGRAM

2
3.9.DATA DESIGN

3.7.1Databases SQLite

Name

Online depression

Table 3.10.1 SQLite Database

3.7.2Tables

Name Description
Users Contains all the registered user details.
Upload posts All the registered service provider details.
Services Contains all the types of services available.

Table 3.10.2 List of Database Tables

3.10.CONCLUSION

In this paper, we tried to identify the presence of depression in Redditsocial media; and searched for
affective performance increase solutions of depression detection. We characterized a closer connection
between depression and a language usage by applying NLP and text classification techniques. We
identified a lexicon of words more common among the depressed accounts. According to our findings, the
language predictors of depression contained the words related to preoccupation with themselves, feelings of
sadness, anxiety, anger, hostility or suicidal thoughts, with a greater emphasis on the present and future.

2
CHAPTER 4
SYSTEM LOWLEVEL DESIGN

This chapter mainly provides the overview on modules of the application, objectives of the project and a
detailed project overview.

4.1.MODULES OF THE PROJECT

Admin Module: Administrator will login to application using username as ‘admin’ and password ‘admin’.
After login admin can view all registered users and all posts send by each users. Admin can send motivation
messages to all depressed users. All positive and negative depression users can also be seen in the form of
graph.
User Module: Users need to register with the application and then login to application to access various sub
modules such as
Search Friends: Using this module user can see all peoples register with the application
Upload Posts: Using this module user can upload post in various formats such as text file, image or audio
file. This application accepts only .WAV file format.
View Motivation Messages: Using this module users can view all motivation messages send by
administrator.

4.2.OBJECTIVES

To implement this project we are using python Speech Recognition API which will read text from audio
files and then SVM will analyse that text to detect depression, user can also upload images via post and
python Tesseract OCR (Optical Character Recognition) API can read text from uploaded image and then
SVM will detect depression from that text, User can upload post in text file also.

2
CHAPTER 5
SOFTWARE ENVIRONMENT

5.1.What is Python :-
Below are some facts about Python.

 Python is currently the most widely used multi-purpose, high-level programming language.

 Python allows programming in Object-Oriented and Procedural paradigms. Python programs


generally are smaller than other programming languages like Java.
 Programmers have to type relatively less and indentation requirement of the language,
makes them readable all the time. Python language is being used by almost all tech-giant
companies like – Google, Amazon, Facebook, Instagram, Dropbox, Uber… etc.
 The biggest strength of Python is huge collection of standard libraries.

5.2.Advantages of python:

 Presence of third-party modules


 Extensive support libraries (Numpy,pandas etc)
 Open source and community development
 Versatile, Easy to read, learn and write
 User-friendly data structures
 High-level language
 Object-oriented language
 Dynamically typed languages (No need to mention data type based on the value assigned, it takes
data type)
 Portable and Interactive
 Highly efficiency (pythons clean object-oriented design provides enhanced process control, and the
language is equipped with excellent text processing and integration capabilities, as well as its own
unit testing frame work, which makes it more efficient.)
 Internet of Things Opportunities
 Interpreted language
 Portable across operating systems

5.3.Applications:

 GUI based desktop applications


 Graphic design, image processing applications, Games, and Scientific/ computational
Applications
 Web frameworks and applications 
 Enterprise and Business applications
 Database Access

2
 Language and Software Development 
 Prototyping 
 Let’s see how Python dominates over other languages.

1. Extensive Libraries

 Python downloads with an extensive library and it contain code for various purposes like
regular expressions, documentation-generation, unit-testing, web browsers, threading,
databases, CGI, email, image manipulation, and more. So, we don’t have to write the complete
code for that manually.
2. Extensible

 As we have seen earlier, Python can be extended to other languages. You can write some of
your code in languages like C++ or C. This comes in handy, especially in projects.
3. Embeddable

 Complimentary to extensibility, Python is embeddable as well. You can put your Python code in
your source code of a different language, like C++. This lets us add scripting capabilities to our
code in the other language.
4. Improved Productivity

 The language’s simplicity and extensive libraries render programmers more productive than


languages like Java and C++ do. Also, the fact that you need to write less and get more things
done.
5. IOT Opportunities

 Since Python forms the basis of new platforms like Raspberry Pi, it finds the future bright for the
Internet Of Things. This is a way to connect the language with the real world.

6. Simple and Easy

 When working with Java, you may have to create a class to print ‘Hello World’. But in Python,
just a print statement will do. It is also quite easy to learn, understand, and code. This is why
when people pick up Python, they have a hard time adjusting to other more verbose languages
like Java.
7. Readable

 Because it is not such a verbose language, reading Python is much like reading English. This is
the reason why it is so easy to learn, understand, and code. It also does not need curly braces to
define blocks, and indentation is mandatory. This further aids the readability of the code.

2
8. Object-Oriented

 This language supports both the procedural and object-oriented programming paradigms.


While functions help us with code reusability, classes and objects let us model the real world. A
class allows the encapsulation of data and functions into one.
9. Free and Open-Source

 Like we said earlier, Python is freely available. But not only can you download Python for
free, but you can also download its source code, make changes to it, and even distribute it. It
downloads with an extensive collection of libraries to help you with your tasks.
10. Portable

 When you code your project in a language like C++, you may need to make some changes to it
if you want to run it on another platform. But it isn’t the same with Python. Here, you need
to code only once, and you can run it anywhere. This is called Write Once Run Anywhere
(WORA). However, you need to be careful enough not to include any system-dependent
features.
11. Interpreted

 Lastly, we will say that it is an interpreted language. Since statements are executed one by
one, debugging is easier than in compiled languages.

 Any doubts till now in the advantages of Python? Mention in the comment section.

Advantages of Python Over Other Languages

1. Less Coding

Almost all of the tasks done in Python requires less coding when the same task is done in other
languages. Python also has an awesome standard library support, so you don’t have to search for any
third-party libraries to get your job done. This is the reason that many people suggest learning Python
to beginners.

2. Affordable

Python is free therefore individuals, small companies or big organizations can leverage the free
available resources to build applications. Python is popular and widely used so it gives you better
community support.

The 2019 Github annual survey showed us that Python has overtaken Java in the most popular
programming language category.
2
3. Python is for Everyone

Python code can run on any machine whether it is Linux, Mac or Windows. Programmers need to learn
different languages for different jobs but with Python, you can professionally build web apps, perform
data analysis and machine learning, automate things, do web scraping and also build games and
powerful visualizations. It is an all-rounder programming language.

5.4.Disadvantages of Python

So far, we’ve seen why Python is a great choice for your project. But if you choose it, you should be
aware of its consequences as well. Let’s now see the downsides of choosing Python over another
language.

1. Speed Limitations

We have seen that Python code is executed line by line. But since Python is interpreted, it often results
in slow execution. This, however, isn’t a problem unless speed is a focal point for the project. In other
words, unless high speed is a requirement, the benefits offered by Python are enough to distract us from
its speed limitations.
2. Weak in Mobile Computing and Browsers

While it serves as an excellent server-side language, Python is much rarely seen on the client-side.
Besides that, it is rarely ever used to implement smartphone-based applications. One such application is
called Carbonnelle.
The reason it is not so famous despite the existence of Brython is that it isn’t that secure.

3. Design Restrictions

As you know, Python is dynamically-typed. This means that you don’t need to declare the type of
variable while writing the code. It uses duck-typing. But wait, what’s that? Well, it just means that if it
looks like a duck, it must be a duck. While this is easy on the programmers during coding, it can raise
run-time errors.

4. Underdeveloped Database Access Layers


Compared to more widely used technologies like JDBC (Java DataBase Connectivity) and ODBC
(Open DataBase Connectivity), Python’s database access layers are a bit underdeveloped.
Consequently, it is less often applied in huge enterprises.

2
5. Simple

No, we’re not kidding. Python’s simplicity can indeed be a problem. Take my example. I don’t do Java,
I’m more of a Python person. To me, its syntax is so simple that the verbosity of Java code seems
unnecessary.

This was all about the Advantages and Disadvantages of Python Programming Language

History of Python :
What do the alphabet and the programming language Python have in common? Right, both start with
ABC. If we are talking about ABC in the Python context, it's clear that the programming language ABC is
meant. ABC is a general-purpose programming language and programming environment, which had been
developed in the Netherlands, Amsterdam, at the CWI (Centrum Wiskunde &Informatica). The greatest
achievement of ABC was to influence the design of Python. Python was conceptualized in the late 1980s.
Guido van Rossum worked that time in a project at the CWI, called Amoeba, a distributed operating
system. In an interview with Bill Venners1, Guido van Rossum said: "In the early 1980s, I worked as an
implementer on a team building a language called ABC at Centrum voor Wiskunde en Informatica (CWI).
I don't know how well people know ABC's influence on Python. I try to mention ABC's influence because
I'm indebted to everything I learned during that project and to the people who worked on it."Later on in
the same Interview, Guido van Rossum continued: "I remembered all my experience and some of my
frustration with ABC. I decided to try to design a simple scripting language that possessed some of ABC's
better properties, but without its problems. So I started typing. I created a simple virtual machine, a simple
parser, and a simple runtime. I made my own version of the various ABC parts that I liked. I created a
basic syntax, used indentation for statement grouping instead of curly braces or begin-end blocks, and
developed a small number of powerful data types: a hash table (or dictionary, as we call it), a list, strings,
and numbers."

Python

Python is an interpreted high-level programming language for general-purpose


programming. Created by Guido van Rossum and first released in 1991, Python has a design philosophy
that emphasizes code readability, notably using significant whitespace.

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.

2
 Python is Interpreted − Python is processed at runtime by the interpreter. You do not need to compile your
program before executing it. This is similar to PERL and PHP.
 Python is Interactive − you can actually sit at a Python prompt and interact with the interpreter directly to
write your programs.
Python also acknowledges that speed of development is important. Readable and terse code is part of
this, and so is access to powerful constructs that avoid tedious repetition of code. Maintainability also
ties into this may be an all but useless metric, but it does say something about how much code you have
to scan, read and/or understand to troubleshoot problems or tweak behaviours. This speed of
development, the ease with which a programmer of other languages can pick up basic Python skills and
the huge standard library is key to another area where Python excels. All its tools have been quick to
implement, saved a lot of time, and several of them have later been patched and updated by people with
no Python background - without breaking.

5.5.Install Python Step-by-Step in Windows and Mac :

Python a versatile programming language doesn’t come pre-installed on your computer devices. Python
was first released in the year 1991 and until today it is a very popular high-level programming language. Its
style philosophy emphasizes code readability with its notable use of great whitespace.
The object-oriented approach and language construct provided by Python enables programmers to write
both clear and logical code for projects. This software does not come pre-packaged with Windows.

How to Install Python on Windows and Mac :

There have been several updates in the Python version over the years. The question is how to install
Python? It might be confusing for the beginner who is willing to start learning Python but this tutorial will
solve your query. The latest or the newest version of Python is version 3.7.4 or in other words, it is Python
3.
Note: The python version 3.7.4 cannot be used on Windows XP or earlier devices.

Before you start with the installation process of Python. First, you need to know about your System
Requirements. Based on your system type i.e. operating system and based processor, you must download
2
the python version. My system type is a Windows 64-bit operating system. So the steps below are to
install python version 3.7.4 on Windows 7 device or to install Python 3. Download the Python Cheatsheet
here.The steps on how to install Python on Windows 10, 8 and 7 are divided into 4 parts to help
understand better.

Download the Correct version into the system

Step 1: Go to the official site to download and install python using Google Chrome or any other web
browser. OR Click on the following link: https://www.python.org

Now, check for the latest and the correct version for your operating system

Step 2: Click on the Download Tab.

2
Step 3: You can either select the Download Python for windows 3.7.4 button in Yellow Color or you can
scroll further down and click on download with respective to their version. Here, we are downloading the
most recent python version for windows 3.7.4

Step 4: Scroll down the page until you find the Files option.

Step 5: Here you see a different version of python along with the operating system.

• To download Windows 32-bit python, you can select any one from the three options: Windows x86
embeddable zip file, Windows x86 executable installer or Windows x86 web-based installer.
•To download Windows 64-bit python, you can select any one from the three options: Windows x86-64
embeddable zip file, Windows x86-64 executable installer or Windows x86-64 web-based installer.
Here we will install Windows x86-64 web-based installer. Here your first part regarding which version of
python is to be downloaded is completed. Now we move ahead with the second part in installing python i.e.
Installation
Note: To know the changes or updates that are made in the version you can click on the Release Note
Option.

2
Installation of Python
Step 1: Go to Download and Open the downloaded python version to carry out the installation process.

Step 2: Before you click on Install Now, Make sure to put a tick on Add Python 3.7 to PATH.

Step 3: Click on Install NOW After the installation is successful. Click on Close.

2
With these above three steps on python installation, you have successfully and correctly installed Python.
Now is the time to verify the installation.

Note: The installation process might take a couple of minutes.

Verify the Python Installation


Step 1: Click on Start
Step 2: In the Windows Run Command, type “cmd”.

Step 3: Open the Command prompt option.


Step 4: Let us test whether the python is correctly installed. Type python –V and press Enter.

2
Step 5: You will get the answer as 3.7.4
Note: If you have any of the earlier versions of Python already installed. You must first uninstall the earlier
version and then install the new one. 
Check how the Python IDLE works
Step 1: Click on Start
Step 2: In the Windows Run command, type “python idle”.

Step 3: Click on IDLE (Python 3.7 64-bit) and launch the program
Step 4: To go ahead with working in IDLE you must first save the file. Click on File > Click on Save

Step 5: Name the file and save as type should be Python files. Click on SAVE. Here I have named the files
as Hey World.
Step 6: Now for e.g. enter print

2
CHAPTER 6
IMPLEMENTATION
6.1.Sample Code

XML Code for Bookings page

<?xml version="1.0" encoding="utf-8"?>


<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@color/colorTextHint"
android:gravity="center"
android:orientation="vertical">

<android.support.v7.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bookings"
android:textSize="20sp" />

<android.support.v7.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/text_hello" />

<android.support.v7.widget.AppCompatTextView
android:id="@+id/textViewName"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</android.support.v7.widget.LinearLayoutCompat>

<android.support.v7.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="16dp"
android:paddingTop="5dp"
android:text="Bookings"
android:textColor="@android:color/black" />

<ScrollView android:id="@+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/spinner1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="562dp"
android:layout_marginBottom="200dp"
android:orientation="vertical" >

<ListView

2
android:id="@+id/listView1"
android:layout_width="wrap_content"
android:layout_height="600dp"
android:layout_marginLeft="0dp" >
</ListView>

</LinearLayout>
</ScrollView>

</LinearLayout>

6.1.2.Java Code for Bookings page

package com.example.spaceimpactor.houser.fragment;

import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v4.widget.NestedScrollView;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.AppCompatTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

public class ProfileFragmentextends Fragment implements View.OnClickListener {

private NestedScrollViewnestedScrollView;
private TextInputLayouttextInputLayoutName;
private TextInputLayouttextInputLayoutPhone;
private TextInputLayouttextInputLayoutEmail;
private TextInputLayouttextInputLayoutPassword;
private TextInputLayouttextInputLayoutConfirmPassword;

private TextInputEditTexttextInputEditTextName;
private TextInputEditTexttextInputEditTextPhone;
private TextInputEditTexttextInputEditTextEmail;
private TextInputEditTexttextInputEditTextPassword;
private TextInputEditTexttextInputEditTextConfirmPassword;

private AppCompatButtonappCompatButtonRegister;

private InputValidationinputValidation;
private DatabaseHelperdatabaseHelper;
private User user;

2
EditTextid,ps,em,mb;
Button sub;
SQlite database db
Textviewaa

private static final String TAG = MainActivity.class.getSimpleName();


private TextViewtxtDetails;
private EditTextinputName, inputEmail;
private Button btnSave;
private DatabaseReferencemFirebaseDatabase;
private FirebaseDatabasemFirebaseInstance;

private String userId;

private Button btnChangeEmail, btnChangePassword, btnSendResetEmail, btnRemoveUser,


changeEmail, changePassword, sendEmail, remove, signOut;

private EditTextoldEmail, newEmail, password, newPassword;


private ProgressBarprogressBar;
private FirebaseAuth.AuthStateListenerauthListener;
private FirebaseAuthauth;

@Override
public View onCreateView(LayoutInflaterinflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View myView = inflater.inflate(R.layout.fragment_profile, container, false);
// appCompatButtonRegister = (AppCompatButton) myView.findViewById(R.id.appCompatButtonRegister);
// appCompatButtonRegister.setOnClickListener(this);
return myView;

2
6.1.3.Java Code for Profile Fragment

package com.example.spaceimpactor.houser.fragment;

import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v4.widget.NestedScrollView;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.AppCompatTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

public class ProfileFragmentextends Fragment implements View.OnClickListener {

private NestedScrollViewnestedScrollView;
EditTextid,ps,em,mb;
Button sub;
SQLiteDatabasedb;
TextViewaaa;

private static final String TAG = MainActivity.class.getSimpleName();


private TextViewtxtDetails;
private EditTextinputName, inputEmail;
private Button btnSave;
private DatabaseReferencemFirebaseDatabase;
private FirebaseDatabasemFirebaseInstance;

private String userId;

private Button btnChangeEmail, btnChangePassword, btnSendResetEmail, btnRemoveUser,


changeEmail, changePassword, sendEmail, remove, signOut;

private EditTextoldEmail, newEmail, password, newPassword;


private ProgressBarprogressBar;
private FirebaseAuth.AuthStateListenerauthListener;
private FirebaseAuthauth;

@Override
public View onCreateView(LayoutInflaterinflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View myView = inflater.inflate(R.layout.fragment_profile, container, false);
// appCompatButtonRegister = (AppCompatButton) myView.findViewById(R.id.appCompatButtonRegister);
// appCompatButtonRegister.setOnClickListener(this);
return myView;
EditTextid,ps,em,mb;

2
Button sub;
SQLiteDatabasedb;
TextViewaaa;

private static final String TAG = MainActivity.class.getSimpleName();


private TextViewtxtDetails;
private EditTextinputName, inputEmail;
private Button btnSave;
private DatabaseReferencemFirebaseDatabase;
private FirebaseDatabasemFirebaseInstance;

private String userId;

private Button btnChangeEmail, btnChangePassword, btnSendResetEmail, btnRemoveUser,


changeEmail, changePassword, sendEmail, remove, signOut;

private EditTextoldEmail, newEmail, password, newPassword;


private ProgressBarprogressBar;
private FirebaseAuth.AuthStateListenerauthListener;
private FirebaseAuthauth;
@Override
public View onCreateView(LayoutInflaterinflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View myView = inflater.inflate(R.layout.fragment_profile, container, false);
// appCompatButtonRegister = (AppCompatButton) myView.findViewById(R.id.appCompatButtonRegister);
// appCompatButtonRegister.setOnClickListener(this);
return myView;
6.1.3 XML Code for Profile Fragment

<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/nestedScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="20dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="0dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"

android:text="Update your Profile"


android:textColor="@android:color/black"
android:textStyle="bold"
android:textSize="30sp"
android:layout_marginBottom="70dp"
android:gravity="center"/>

<EditText android:id="@+id/old_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Confirm Email"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true" />

<EditText
android:id="@+id/new_email"

2
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="New Email"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true" />

<EditText android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:hint="@string/hint_password"
android:imeActionId="@+id/login"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
tools:ignore="InvalidImeActionId" />

<EditText
android:id="@+id/newPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:hint="New Password"
android:imeActionId="@+id/login"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
tools:ignore="InvalidImeActionId" />

<Button
android:id="@+id/send"
style="?android:textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@android:color/black"
android:text="Send"
android:textColor="@android:color/white"
android:textStyle="bold"
android:layout_gravity="end"/>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="30dp"
android:layout_height="30dp"
android:visibility="gone" />

2
<Button
android:id="@+id/remove"
style="?android:textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@color/colorPrimaryDark"
android:text="Remove"
android:textColor="@android:color/white"
android:textStyle="bold" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
android:inputType="textCapWords"
android:maxLines="1" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:inputType="textEmailAddress"
android:maxLines="1" />

</android.support.design.widget.TextInputLayout>

2
6.2.Screen Captures

User Login Screen:

Now deploy code in DJANGO and start server and run in browser to get below screen

2
pa
In above screen click on ‘Register Here’ link to add new user to application

After register will get below confirmation screen

2
pa

Now click on ‘User’ link to login as ‘user’

2
pa

After login will get below screen

2
pa

In the above screen click ‘search Friends’link to view all users registered with the application.

2
pa

Now click on ‘Upload Post’ link to upload post files such above screen I am uploading one recording file, after upload
will get below message from recording data

2
pa

In above screen its says uploaded file contains message which indicate user is happy and gave positive recording. In
below screen I am uploading one image which contains depress negative message

2
pa

2
pa

In above screen in title image file name is ‘smallthumb-7’ and it contains depress negative message and I will upload
same image to application and see results

2
pa

In above screen we can see I am uploading same image and below are is the output screen

2
pa

In above screen message is negative and we can say user is depressed. Similarly click on ‘View Motivated Post’ link
to get admin message if he posted otherwise message will mark as ‘Pending’

In above screen we can see this user uploaded two files one is recording and other one is image and both file data we
can see as post data column and depression result as positive or negative also we can see. Admin has not sent any
motivated post so the field is marked as ‘Pending’. Now logout and login as ‘admin’.

2
pa

After login we can get below admin screen

In above screen admin can click on ‘View Users’ to view all users list

2
pa

Similarly admin can click on ‘View Depression Post’ to view all post in graph and text format

2
pa

In above graph we can see total depress and non-depress users, see below screen for all posts from all users

Similarly admin can click on ‘Send Motivated Post’ link to send motivated messages to users. While
sending messages admin has to enter username and post time. Post time he can copy from above screen

2
pa

After sending motivated messages will get below screen

2
pa

Now admin can click on ‘View Motivated Post’ link to view all motivated messages sent by him

2
pa

CHAPTER 7

TESTING
7.1.Software Testing

Software testing is the process of validating and verifying that a software applicationmeets the technical
requirements which are involved in its desig6.n and development. It is alsoused to uncover any defects/bugs
that exist in the application. It assures the quality of thesoftware. There are many types of testing software
viz., manual testing, unit testing, black box testing, performance testing, stress testing, regression testing,
white box testing etc. Among theseperformance testing and load testing are the most important one for an
android application and nextsections deal with some of these types.

7.2.Black box Testing

Black box testing treats the software as a "black box"—without any knowledge of internal implementation.
Black box testing methods include equivalence partitioning, boundary value analysis, all-pairs testing, fuzz
testing, model-based testing, traceability matrix, exploratory testing,and specification-based testing.

7.3.white box Testing

White box testing is when the tester has access to the internal data structures and algorithms including the
code that implement these.

7.4.Performance Testing
Performance testing is executed to determine how fast a system or sub-system performsunder a particular
workload. It can also serve to validate and verify other quality attributes of thesystem such as scalability,
reliability and resource usage.

7.5.Load Testing

Load testing is primarily concerned with testing that can continue to operate underspecific load, whether that
is large quantities of data or a large number of users.

7.6.Manual Testing

Manual Testing is the process of manually testing software for defects. Functionality of this application is
manually tested to ensure the correctness. Few examples of test case for Manual Testing are discussed later
in this chapter.

2
pa

Test Case 1

Test Case Name Empty login fields testing

Description In the login screen if the username and password fields are empty

Output Login fails showing an alert box asking to enter username and
password.

Table 6:1 Test Case for Empty Login Fields

Figure 6-1 Test Case for Empty Login Fields

Test Case 2

Test Case Name Wrong login fields testing

Description A unique username and password are set by administrator. On entering


wrong username or password gives.
Output Login fails showing an alert box username or password
incorrect.

Table 6:2 Test Case for Wrong Login Fields

2
pa

Figure 6-2 Test Case for Wrong Login Fields

Test Case 3
Test Case Name User Signup Fails.

Description User signup need to provide all data.

Output Signup Fails and an alert message appears asking to enter valid email
and name.

Table 6:3 Test Case for Signup fail

2
CHAPTER 8

RESULTS AND CHALLENGES


8.1 Results

The current android application is developed using Xml, Java, SQL with Firebase connectivity. It can be
used by every individual who are in a need of fulfilling their household services.

At the time of submission of my application was capable of doing the following:


• Displaying thehome screen with different fragments.
• Authentication of user by using login screen using Firebase.
• Home screen to display based on user or service provider.
• After successful login of user, they can choose the service and book a slot of their particular service provider
from the displayed list.
• Add, update, view, delete the user details.
• After successful login of service provider, they can view all the bookings that are booked by the users and can
attend them one by one.
• Service provider can also set his preferences to not available, if he’s too busy or many users had already
booked him.
• Service provider has the ability to change their particular radius of location for servicing.
• He can set up to 10 km radius.
• Logout and end the session.

8.2.Challenges
• Understanding the connections of SQLite Database is a tricky part and confusing when dealing with multiple
tables within a database.
• Making exact orientation API design levels was a difficult task as there are many types of devices like
desktop, tablet, mobile with varying screen size and resolutions.
• Implementing synchronization with Firebasewas a challenging task.
• Learning different technologies and frameworks with little guidance.

58
CHAPTER 9
CONCLUSION AND FUTURE WORK

Conclusion
In this paper, we tried to identify the presence of depression in Reddit social media; and searched
for affective performance increase solutions of depression detection. We characterized a closer
connection between depression and a language usage by applying NLP and text classification
techniques. We identified a lexicon of words more common among the depressed accounts.
According to our findings, the language predictors of depression contained the words related to
preoccupation with themselves, feelings of sadness, anxiety, anger, hostility or suicidal thoughts,
with a greater emphasis on the present and future

Scope for future work


The best feature among the single feature sets is bigram; with SVM classifier it can detect
depression with 80% accuracy and 0.79 F1 score. Considering LIWC and LDA features, LIWC
outperformed topic models generated by LDA. 

 
Limitations

T. Fabian, “Online depression detection in Proc. Comput. Inf. Syst. Ind. Manage. Appl., Jun.
2008, pp. 165170.

59
BIBLIOGRAPHY

Code snippets for any errors http://stackoverflow.com/

Android Development Guide https://www.udemy.com/android

Xml and Layout Guide https://www.androidhive.com/

Connecting to Firebase Docs https://firebase.google.com

Software Testing http://en.wikipedia.org/wiki/Software_testing

Manual Testing http://en.wikipedia.org/wiki/Manual_testing

Performance Testing http://en.wikipedia.org/wiki/Software_performance_testing

60

You might also like