Commit a08249eb authored by MONIKA SROHA's avatar MONIKA SROHA

adding fies

parents
This diff is collapsed.
GIT Link:https://git.cse.iitb.ac.in/monikasroha/CS699_Research_Paper_Easy_Access
Project Name: Research Paper Easy Access
Team Name: Learners
Members:
Name:Deepti Mittal Roll No:193050025
Name:Swaril Singhal Roll No:193050039
Name:Monika Sroha Roll No:193050087
Motivation:
Whenever a student wants to read a paper on the particular topic published by a faculty, he/she has to go through a bunch of paper list to figure out which paper to read. It seems like a hectic thing or somewhat irritating! Research Paper Easy Access will take the URL of faculty as input and display the top 50 words on which faculty has worked the most. On clicking a particular word, list of pdf which contains that word will appear. Now, You can easily access the papers!!
Hosting from Developer Documentation:
1. Inside source folder, Go to papers folder.
2. Open the terminal.
3. type the command: python3 manage.py runserver
4. Now Open a browser and run localhost:8000.
5. Type URL and word cloud will be generated.
All of these commands have been specified over the main page of the developer documented pdf provided in developer.pdf.
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
## Documentation of main function
# @brief This function is used to set your settings.py file as default setting and the command is run from command line otherwise raise an error
# @brief NO paramerts passed
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'papers.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
"""
Django settings for papers project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
## Documentation for the base directory path
# @brief It specifies the base path of the all files and folders of a project.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
## Documentation for security key
# @brief Security key to be kept private when code used in production!!
SECRET_KEY = '-w-mk58zgjk*y=t61muzzrd+*e)7%+20j__!4_=lh(6^*@)42n'
# SECURITY WARNING: don't run with debug turned on in production!
## Documentation for security about DEBUG
# @brief to show the error status while development. Never use debug as true when used in production.
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
## To define Installed apps
# @brief mentioning of all applications used, developer need to add his own project into it. In OUr case we added 'research paper'
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'research_papers',
'crispy_forms'
]
CRISPY_TEMPLATE_PACK = 'bootstrap4'
#'django.contrib.staticfiles'
## To add the middleware required.
# @brief for our development No need of any change, it was already initialised.
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
## Documentation for ROOT_URLconfig
# @brief to specify the path for urls file where the urlpatterns are being added.
ROOT_URLCONF = 'papers.urls'
## Documentation for Templates
# @brief to specify the templates which has to be set to run the project.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'papers.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
## Password validation
# @brief It is used for password validation. Not required in Our case.
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
## for specifying the language code
LANGUAGE_CODE = 'en-us'
## to specify the different parameters for setting of time zone for server
TIME_ZONE = 'UTC'
## to specify the time zone for server
USE_I18N = True
## to specify the different parameters for setting of time zone for server
USE_L10N = True
## to specify the different parameters for setting of time zone for server
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
#STATICFILES_DIRS = (os.path.join( os.path.dirname( __file__ ), 'static' ),)
## Documentation for static file directory path
# @brief It is set to create a folder in base directory to store all the static files to be used such as images etc.
STATICFILES_DIRS = (os.path.join( BASE_DIR, 'static' ),)
## Documentation for static file finders
# @brief set to search for existence of any static files in project folder to be added
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',)
STATIC_URL = '/static/'
#STATIC_ROOT = '/path/to/copy/files/to'
#STATIC_ROOT = os.path.join( os.path.dirname( BASE_DIR ), 'static_cdn' )
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
"""papers URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('research_papers.urls')),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
"""
WSGI config for papers project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'papers.settings')
application = get_wsgi_application()
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class ResearchPapersConfig(AppConfig):
name = 'research_papers'
from django import forms
class MyForm(forms.Form):
URL = forms.CharField(label='URL ', widget=forms.TextInput(attrs={'placeholder': 'Enter URL'}))
from django.db import models
# Create your models here.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Research Papers Easy Access</title>
</head>
<body>
URL entered: <strong>{{ URL }}</strong><br><br>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Research Papers Easy Access</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<style>
div{
background: transparent;
}
body
{
background-image: url("https://extraconfidencial.com/wp-content/uploads/2019/09/asistentes-virtuales.jpg");
background-position: top;
background-repeat: no-repeat;
background-size: cover; !important
background-color: #cccccc;
}
.content
{
position: absolute;
background: rgb(0,0,0);
background: rgba(0,0,0,0.5);
color: #f1f1f1;
width: 100%;
padding: 20px;
bottom: 30%;
}
span{background-color: #cccccc; !important}
</style>
</head>
<body>
<center>
<div class="content">
<span>
<h1 class="display-3" font="">Research Paper Easy Access</h1>
<form action="/thankyou/" method="post">
{% csrf_token %}
<table>
{{form.as_table}}
</table>
<br>
<input type="submit" class="btn btn-outline-light" value="Submit" />
</form>
</span>
</div>
</center>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Thank You</title>
</head>
<body bgcolor = "#d6cbd3">
<h2>Response Entered by you:</h2>
<form method="post">
URL entered: <strong>{{ URL }}</strong><br><br>
<script type="text/javascript">
var word_list_display = {{ word_list_display|safe }}
var word_count_display = {{ word_count_display|safe }}
var most_occur_file_map = {{ most_occur_file_map|safe }}
var pdf_name_list = {{ pdf_name_list|safe }}
var pdf_url_list = {{ pdf_url_list|safe }}
var most_occur_file_map_len = {{ most_occur_file_map_len|safe }}
function links(word, size, file, len, pdfname, urls,i) {
var a = document.createElement('a');
var b = document.createElement('br');
// Create the text node for anchor element.
var link = document.createTextNode(word);
// Append the text node to anchor element.
a.appendChild(link);
// Set the title.
a.title = word;
// Set the href property.
a.href = "javascript:func('"+file+"','"+len+"', '"+pdfname+"','"+urls+"');";
// Append the anchor element to the body.
a.style.fontSize = "1.0em";
var size1 = (0.002 * size);
//document.write(size1)
a.style.marginLeft = "100px";
a.style.fontSize = parseFloat(a.style.fontSize) + size1 + "em";
document.body.appendChild(a);
if(i%5==0)
document.body.appendChild(b);
}
function func(file, len, pdfname, urls) {
document.write("<center><b><u>");
document.write("List of PDFs <br />");
document.write("</u></b></center>");
document.body.style.backgroundColor = "#daebe8";
var file1 = file.split(',');
var pdfname1 = pdfname.split(',');
var urls1 = urls.split(',');
for(i=0; i<len; i++)
{
var a = document.createElement('a');
var b = document.createElement('br');
// Create the text node for anchor element.
var x = parseInt(file1[i]);
//document.write(x);
var link = document.createTextNode(pdfname1[x]);
// Append the text node to anchor element.
a.appendChild(link);
a.target= "_blank";
// Set the title.
a.title = pdfname1[x];
// Set the href property.
a.href = urls1[x];
// Append the anchor element to the body.
document.body.appendChild(a);
document.body.appendChild(b);
}
}
for (i=0;i<{{ x }};i++)
{
links(word_list_display[i],word_count_display[i], most_occur_file_map[word_list_display[i]], most_occur_file_map_len[word_list_display[i]], pdf_name_list, pdf_url_list,i );
}
</script>
</form>
</body>
</html>
from django.test import TestCase
# Create your tests here.
from django.urls import path
from research_papers import views
#from django.contrib.staticfiles.urls import staticfiles_urlpatterns
#from django.contrib.staticfiles.urls import staticfiles_urlpatterns
##Documentation for urlpatterns to specify the URL to be visited.
# @brief It is used to set the path for setting the pages or adding the pages in the project. it is setting the redirect of the first page to the page ("thankyou page) to result the output.
urlpatterns = [
path('', views.research_papers),
path('thankyou/', views.research_papers),
]
a
able
about
above
abst
accordance
according
accordingly
across
act
actually
added
adj
affected
affecting
affects
after
afterwards
again
against
ah
all
almost
alone
along
already
also
although
always
am
among
amongst
an
and
announce
another
any
anybody
anyhow
anymore
anyone
anything
anyway
anyways
anywhere
apparently
approximately
are
aren
arent
arise
around
as
aside
ask
asking
at
auth
available
away
awfully
b
back
be
became
because
become
becomes
becoming
been
before
beforehand
begin
beginning
beginnings
begins
behind
being
believe
below
beside
besides
between
beyond
biol
both
brief
briefly
but
by
c
ca
came
can
cannot
can't
cause
causes
certain
certainly
co
com
come
comes
contain
containing
contains
could
couldnt
d
date
did
didn't
different
do
does
doesn't
doing
done
don't
down
downwards
due
during
e
each
ed
edu
effect
eg
eight
eighty
either
else
elsewhere
end
ending
enough
especially
et
et-al
etc
even
ever
every
everybody
everyone
everything
everywhere
ex
except
f
far
few
ff
fifth
first
five
fix
followed
following
follows
for
former
formerly
forth
found
four
from
further
furthermore
g
gave
get
gets
getting
give
given
gives
giving
go
goes
gone
got
gotten
h
had
happens
hardly
has
hasn't
have
haven't
having
he
hed
hence
her
here
hereafter
hereby
herein
heres
hereupon
hers
herself
hes
hi
hid
him
himself
his
hither
home
how
howbeit
however
hundred
i
id
ie
if
i'll
im
immediate
immediately
importance
important
in
inc
indeed
index
information
instead
into
invention
inward
is
isn't
it
itd
it'll
its
itself
i've
j
just
k
keep keeps
kept
kg
km
know
known
knows
l
largely
last
lately
later
latter
latterly
least
less
lest
let
lets
like
liked
likely
line
little
'll
look
looking
looks
ltd
m
made
mainly
make
makes
many
may
maybe
me
mean
means
meantime
meanwhile
merely
mg
might
million
miss
ml
more
moreover
most
mostly
mr
mrs
much
mug
must
my
myself
n
na
name
namely
nay
nd
near
nearly
necessarily
necessary
need
needs
neither
never
nevertheless
new
next
nine
ninety
no
nobody
non
none
nonetheless
noone
nor
normally
nos
not
noted
nothing
now
nowhere
o
obtain
obtained
obviously
of
off
often
oh
ok
okay
old
omitted
on
once
one
ones
only
onto
or
ord
other
others
otherwise
ought
our
ours
ourselves
out
outside
over
overall
owing
own
p
page
pages
part
particular
particularly
past
per
perhaps
placed
please
plus
poorly
possible
possibly
potentially
pp
predominantly
present
previously
primarily
probably
promptly
proud
provides
put
pushpak
bhattacharya
q
que
quickly
quite
qv
r
ran
rather
rd
re
readily
really
recent
recently
ref
refs
regarding
regardless
regards
related
relatively
research
respectively
resulted
resulting
results
right
run
s
said
same
saw
say
saying
says
sec
section
see
seeing
seem
seemed
seeming
seems
seen
self
selves
sent
sentences
sentence
in-
features
tion
seven
several
shall
she
shed
she'll
shes
should
shouldn't
show
showed
shown
showns
shows
significant
significantly
similar
similarly
since
six
slightly
so
some
somebody
somehow
someone
somethan
something
sometime
sometimes
somewhat
somewhere
soon
sorry
specifically
specified
specify
specifying
still
stop
strongly
sub
substantially
successfully
such
sufficiently
suggest
sup
sure
t
take
taken
taking
based
tell
tends
total
high
low
th
than
thank
thanks
thanx
that
that'll
thats
that've
the
their
theirs
them
themselves
then
thence
there
thereafter
thereby
thered
therefore
therein
there'll
thereof
therere
theres
thereto
thereupon
there've
these
they
theyd
they'll
theyre
they've
think
this
those
thou
though
thoughh
thousand
throug
through
throughout
thru
thus
til
tip
to
together
too
took
toward
towards
tried
tries
truly
try
trying
ts
twice
two
u
un
under
unfortunately
unless
unlike
unlikely
until
unto
up
upon
ups
us
use
used
useful
usefully
usefulness
uses
using
usually
v
value
various
've
very
via
viz
vol
vols
vs
w
want
wants
was
wasnt
way
we
wed
welcome
we'll
went
were
werent
we've
what
whatever
what'll
whats
when
whence
whenever
where
whereafter
whereas
whereby
wherein
wheres
whereupon
wherever
whether
which
while
whim
whither
who
whod
whoever
whole
who'll
whom
whomever
whos
whose
why
widely
willing
wish
with
within
without
wont
words
world
would
wouldnt
www
x
y
yes
yet
you
youd
you'll
your
youre
yours
yourself
yourselves
you've
z
zero
&
1
2
3
4
5
6
7
8
9
0
proposed
/
*
-
+
.
!
@
#
$
%
^
(
)
{
}
[
]
\
'
"
;
:
<
>
?
_
=
'cos
'd
'm
're
ago
ahead
aren't
backward
backwards
beneath
couldn't
despite
forward
hadn't
however
I
inside
inspite
mayn't
mightn't
mine
mustn't
needn't
oughtn't
seldom
shan't
till
usedn't
usen't
wasn't
well
weren't
will
won't
wouldn't
's
't
n't
corporation
corp
corp.
llc
inc.
ltd.
llp
llp.
plc
plc.
!!
?!
??
!?
`
``
''
-lrb-
-rrb-
-lsb-
-rsb-
,
..
...
address
advance
advanced
al
application
approach
area
aspect
book
cant
century
circa
collected
collection
compared
concept
condition
conference
consider
considered
consist
consisted
contemporary
contribution
course
criticism
critique
currently
das
de
demonstrate
demonstrated
der
detail
development
die
difficult
discuss
discussed
early
easily
easy
edited
edition
editor
een
el
elementary
en
essay
essential
evaluation
example
exercise
finally
foundation
global
good
guide
handbook
happen
happened
held
het
illustrated
impact
implication
including
influence
intermediate
international
introduce
introduction
introductory
investigating
investigation
involving
issue
iv
ix
journal
kind
kingdom
la
le
lecture
lecture notes
library
lo
main
making
manual
method
modern
monograph
num
number
organisation
original
outline
outlined
overview
pamphlet
paper
paperback
party
perspective
possibility
practical
practice
presented
previous
principle
problem
proceeding
process
project
publication
published
publisher
reader
reading
reference
relating
report
respect
review
role
selected
seminar
series
service
short
simple
source
sourcebook
special
state of the art
studies
study
subject
suggested
suitable
supplement
survey
system
technique
text
theme
theories
theory
today
tomorrow
topic
und
understand
united
up to date
view
volume
workbook
year
documents
logs
2003
fig
called
state
based
failure
processing
2008
proof
corpus
work
sentence
dependent
performance
co-occurence
2010
character
relation
derications
entry
rules
node
table
features
theorem
function3size
cases
proof
>
ax
clearly
bound
claim
fact
define
coefficient
v1
programs
definition
gcid48
cid48
defined
cases
m2
0
22
basis
assume
exists
find
smaller
individual
version
or
idea
recall
project
nonzero
c1
x2
u2
v3
construction
base
blue
science
concentration
questions
categories
m2
To run the Source:
1. Inside source folder, Go to papers folder.
2. Open the terminal.
3. type the command: python3 manage.py runserver
4. Now Open a browser and run localhost:8000.
5. Type URL and word cloud will be generated.
Example:
Open the terminal inside paper folder:
python3 manage.py runserver
Open a new window in browser and run localhost on port 8000.
In the page , type URL in the given input box.
Ex: https://www.cse.iitb.ac.in/~varsha/
A word cloud will be shown on the page. Click on the desired word to display the list of pdf's. to read the desired pdf, click it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment