Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit d847df7

Browse files
Merge pull request #234 from asiskumarroy/master
Fake news detection web application
2 parents 5bde7e0 + ce75189 commit d847df7

File tree

19 files changed

+1093
-0
lines changed

19 files changed

+1093
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#### **Flask web application **
2+
3+
This is a web application built in flask to detect if a given news
4+
article based on the 2016 US presidential election is real or
5+
fake.
6+
7+
The web application uses NLP techniques to check the reality
8+
of the news article.
9+
10+
The fake-news folder contains the data on which the machine
11+
learning model that predicts the fake news is trained.
12+
13+
To test the model you can simply pick data from the fake-news
14+
folder and give it as input(screenshots can be referred) and
15+
the model will predict the output.
16+
17+
#### _Link to data_
18+
The dataset can be downloaded from the following url
19+
https://www.kaggle.com/c/fake-news/data
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
alabaster==0.7.12
2+
altgraph==0.17
3+
anaconda-client==1.7.2
4+
anaconda-navigator==1.9.7
5+
anaconda-project==0.8.3
6+
asn1crypto==1.0.1
7+
astroid==2.3.1
8+
astropy==3.2.1
9+
atomicwrites==1.3.0
10+
attrs==19.2.0
11+
Babel==2.7.0
12+
backcall==0.1.0
13+
backports.functools-lru-cache==1.5
14+
backports.os==0.1.1
15+
backports.shutil-get-terminal-size==1.0.0
16+
backports.tempfile==1.0
17+
backports.weakref==1.0.post1
18+
beautifulsoup4==4.8.0
19+
bitarray==1.0.1
20+
bkcharts==0.2
21+
bleach==3.1.0
22+
bokeh==1.3.4
23+
boto==2.49.0
24+
Bottleneck==1.2.1
25+
CacheControl==0.12.6
26+
cachetools==4.1.1
27+
certifi==2019年9月11日
28+
cffi==1.12.3
29+
chardet==3.0.4
30+
Click==7.0
31+
cloudpickle==1.2.2
32+
clyent==1.2.2
33+
colorama==0.4.1
34+
comtypes==1.1.7
35+
conda==4.7.12
36+
conda-build==3.18.9
37+
conda-package-handling==1.6.0
38+
conda-verify==3.4.2
39+
contextlib2==0.6.0
40+
cryptography==2.7
41+
cycler==0.10.0
42+
Cython==0.29.13
43+
cytoolz==0.10.0
44+
dask==2.5.2
45+
decorator==4.4.0
46+
defusedxml==0.6.0
47+
distributed==2.5.2
48+
docutils==0.15.2
49+
entrypoints==0.3
50+
et-xmlfile==1.0.1
51+
fastcache==1.1.0
52+
filelock==3.0.12
53+
firebase-admin==4.3.0
54+
Flask==1.1.1
55+
Flask-SQLAlchemy==2.4.3
56+
fsspec==0.5.2
57+
future==0.17.1
58+
gevent==1.4.0
59+
glob2==0.7
60+
google-api-core==1.21.0
61+
google-api-python-client==1.10.0
62+
google-auth==1.19.1
63+
google-auth-httplib2==0.0.4
64+
google-cloud-core==1.3.0
65+
google-cloud-firestore==1.8.1
66+
google-cloud-storage==1.29.0
67+
google-resumable-media==0.5.1
68+
googleapis-common-protos==1.52.0
69+
greenlet==0.4.15
70+
grpcio==1.30.0
71+
h5py==2.9.0
72+
HeapDict==1.0.1
73+
html5lib==1.0.1
74+
httplib2==0.18.1
75+
idna==2.8
76+
imageio==2.6.0
77+
imagesize==1.1.0
78+
importlib-metadata==0.23
79+
ipykernel==5.1.2
80+
ipython==7.8.0
81+
ipython-genutils==0.2.0
82+
ipywidgets==7.5.1
83+
isort==4.3.21
84+
itsdangerous==1.1.0
85+
jdcal==1.4.1
86+
jedi==0.15.1
87+
Jinja2==2.10.3
88+
joblib==0.13.2
89+
json5==0.8.5
90+
jsonschema==3.0.2
91+
jupyter==1.0.0
92+
jupyter-client==5.3.3
93+
jupyter-console==6.0.0
94+
jupyter-core==4.5.0
95+
jupyterlab==1.1.4
96+
jupyterlab-server==1.0.6
97+
keyring==18.0.0
98+
kiwisolver==1.1.0
99+
lazy-object-proxy==1.4.2
100+
libarchive-c==2.8
101+
llvmlite==0.29.0
102+
locket==0.2.0
103+
lxml==4.4.1
104+
MarkupSafe==1.1.1
105+
matplotlib==3.1.1
106+
mccabe==0.6.1
107+
menuinst==1.4.16
108+
mistune==0.8.4
109+
mkl-fft==1.0.14
110+
mkl-random==1.1.0
111+
mkl-service==2.3.0
112+
mock==3.0.5
113+
more-itertools==7.2.0
114+
mpmath==1.1.0
115+
msgpack==0.6.1
116+
multipledispatch==0.6.0
117+
mysql-connector-python==8.0.21
118+
mysqlclient==1.4.6
119+
navigator-updater==0.2.1
120+
nbconvert==5.6.0
121+
nbformat==4.4.0
122+
networkx==2.3
123+
nltk==3.4.5
124+
nose==1.3.7
125+
notebook==6.0.1
126+
numba==0.45.1
127+
numexpr==2.7.0
128+
numpy==1.16.5
129+
numpydoc==0.9.1
130+
olefile==0.46
131+
openpyxl==3.0.0
132+
packaging==19.2
133+
pandas==0.25.1
134+
pandocfilters==1.4.2
135+
parso==0.5.1
136+
partd==1.0.0
137+
path.py==12.0.1
138+
pathlib2==2.3.5
139+
patsy==0.5.1
140+
pefile==2019年4月18日
141+
pep8==1.7.1
142+
pickleshare==0.7.5
143+
Pillow==6.2.0
144+
pkginfo==1.5.0.1
145+
pluggy==0.13.0
146+
ply==3.11
147+
prometheus-client==0.7.1
148+
prompt-toolkit==2.0.10
149+
protobuf==3.12.2
150+
psutil==5.6.3
151+
py==1.8.0
152+
pyasn1==0.4.8
153+
pyasn1-modules==0.2.8
154+
pycodestyle==2.5.0
155+
pycosat==0.6.3
156+
pycparser==2.19
157+
pycrypto==2.6.1
158+
pycurl==7.43.0.3
159+
pyflakes==2.1.1
160+
Pygments==2.4.2
161+
PyInstaller==3.6
162+
pylint==2.4.2
163+
pyodbc==4.0.27
164+
pyOpenSSL==19.0.0
165+
pyparsing==2.4.2
166+
pyreadline==2.1
167+
pyrsistent==0.15.4
168+
PySocks==1.7.1
169+
pytest==5.2.1
170+
pytest-arraydiff==0.3
171+
pytest-astropy==0.5.0
172+
pytest-doctestplus==0.4.0
173+
pytest-openfiles==0.4.0
174+
pytest-remotedata==0.3.2
175+
python-dateutil==2.8.0
176+
pytz==2019.3
177+
PyWavelets==1.0.3
178+
pywin32==223
179+
pywin32-ctypes==0.2.0
180+
pywinpty==0.5.5
181+
PyYAML==5.1.2
182+
pyzmq==18.1.0
183+
QtAwesome==0.6.0
184+
qtconsole==4.5.5
185+
QtPy==1.9.0
186+
requests==2.22.0
187+
rope==0.14.0
188+
rsa==4.6
189+
ruamel-yaml==0.15.46
190+
scikit-image==0.15.0
191+
scikit-learn==0.21.3
192+
scipy==1.3.1
193+
seaborn==0.9.0
194+
Send2Trash==1.5.0
195+
simplegeneric==0.8.1
196+
singledispatch==3.4.0.3
197+
six==1.12.0
198+
snowballstemmer==2.0.0
199+
sortedcollections==1.1.2
200+
sortedcontainers==2.1.0
201+
soupsieve==1.9.3
202+
Sphinx==2.2.0
203+
sphinxcontrib-applehelp==1.0.1
204+
sphinxcontrib-devhelp==1.0.1
205+
sphinxcontrib-htmlhelp==1.0.2
206+
sphinxcontrib-jsmath==1.0.1
207+
sphinxcontrib-qthelp==1.0.2
208+
sphinxcontrib-serializinghtml==1.1.3
209+
sphinxcontrib-websupport==1.1.2
210+
spyder==3.3.6
211+
spyder-kernels==0.5.2
212+
SQLAlchemy==1.3.9
213+
statsmodels==0.10.1
214+
stopwords==0.1.3
215+
sympy==1.4
216+
tables==3.5.2
217+
tblib==1.4.0
218+
terminado==0.8.2
219+
testpath==0.4.2
220+
toolz==0.10.0
221+
tornado==6.0.3
222+
tqdm==4.36.1
223+
traitlets==4.3.3
224+
unicodecsv==0.14.1
225+
uritemplate==3.0.1
226+
urllib3==1.24.2
227+
wcwidth==0.1.7
228+
webencodings==0.5.1
229+
Werkzeug==0.16.0
230+
widgetsnbextension==3.5.1
231+
win-inet-pton==1.1.0
232+
win-unicode-console==0.5
233+
wincertstore==0.2
234+
wrapt==1.11.2
235+
xlrd==1.2.0
236+
XlsxWriter==1.2.1
237+
xlwings==0.15.10
238+
xlwt==1.3.0
239+
zict==1.0.0
240+
zipp==0.6.0
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from flask import Flask, request, render_template
2+
from sklearn.externals import joblib
3+
from feature import *
4+
5+
6+
pipeline = joblib.load('pipeline.sav')
7+
8+
app = Flask(__name__)
9+
10+
@app.route('/')
11+
def home():
12+
return render_template('index.html')
13+
14+
15+
@app.route('/api',methods=['POST'])
16+
def get_delay():
17+
18+
result=request.form
19+
query_title = result['title']
20+
query_author = result['author']
21+
query_text = result['maintext']
22+
print(query_text)
23+
query = get_all_query(query_title, query_author, query_text)
24+
##user_input = {'query':query}
25+
pred = pipeline.predict(query)
26+
print(pred)
27+
dic = {1:'real',0:'fake'}
28+
return f'<html><body><h1>{dic[pred[0]]}</h1> <form action="/"> <button type="submit">back </button> </form></body></html>'
29+
30+
31+
if __name__ == '__main__':
32+
app.run(port=8080, debug=True)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /