Sa-m commited on
Commit
529eea1
1 Parent(s): ceaaa2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -16,7 +16,7 @@ from nltk.tokenize import word_tokenize
16
  from nltk.probability import FreqDist
17
  from cleantext import clean
18
  import textract
19
- #import urllib.request
20
  import nltk.corpus
21
  from nltk.text import Text
22
  import io
@@ -174,17 +174,17 @@ def getAnalysis(score):
174
  else:
175
  return 'Positive'
176
 
177
- #url = "http://library.bjp.org/jspui/bitstream/123456789/2988/1/BJP-Election-english-2019.pdf"
178
- #path_input = "./Bjp_Manifesto_2019.pdf'"
179
- #urllib.request.urlretrieve(url, filename=path_input)
180
 
181
- #url="https://drive.google.com/uc?id=1BLCiy_BWilfVdrUH8kbO-44DJevwO5CG&export=download"
182
- #path_input = "./Aap_Manifesto_2019.pdf"
183
- #urllib.request.urlretrieve(url, filename=path_input)
184
 
185
- #url="https://drive.google.com/uc?id=1HVZvTtYntl0YKLnE0cwu0CvAIRhXOv60&export=download"
186
- #path_input = "./Congress_Manifesto_2019.pdf"
187
- #urllib.request.urlretrieve(url, filename=path_input)
188
 
189
  def analysis(Manifesto,Search):
190
  raw_party = Parsing(Manifesto)
@@ -246,7 +246,7 @@ plot2=gr.outputs.Image(label='Subjectivity Analysis')
246
  plot3=gr.outputs.Image(label='Word Cloud')
247
  plot4=gr.outputs.Image(label='Frequency Distribution')
248
 
249
- io=gr.Interface(fn=analysis, inputs=[filePdf,Search_txt], outputs=[text,mfw,plot1,plot2,plot3,plot4], title='Manifesto Analysis',examples=[['manifestos/Bjp_Manifesto_2019.pdf','development'],['manifestos/Aap_Manifesto_2019.pdf','delhi'],['manifestos/Congress_Manifesto_2019.pdf','safety']])
250
  io.launch(debug=False,share=True)
251
  #,examples=[['./Bjp_Manifesto_2019.pdf','india'],['./Aap_Manifesto_2019.pdf',],['./Congress_Manifesto_2019.pdf',]]
252
 
 
16
  from nltk.probability import FreqDist
17
  from cleantext import clean
18
  import textract
19
+ import urllib.request
20
  import nltk.corpus
21
  from nltk.text import Text
22
  import io
 
174
  else:
175
  return 'Positive'
176
 
177
+ url = "http://library.bjp.org/jspui/bitstream/123456789/2988/1/BJP-Election-english-2019.pdf"
178
+ path_input = "./Bjp_Manifesto_2019.pdf'"
179
+ urllib.request.urlretrieve(url, filename=path_input)
180
 
181
+ url="https://drive.google.com/uc?id=1BLCiy_BWilfVdrUH8kbO-44DJevwO5CG&export=download"
182
+ path_input = "./Aap_Manifesto_2019.pdf"
183
+ urllib.request.urlretrieve(url, filename=path_input)
184
 
185
+ url="https://drive.google.com/uc?id=1HVZvTtYntl0YKLnE0cwu0CvAIRhXOv60&export=download"
186
+ path_input = "./Congress_Manifesto_2019.pdf"
187
+ urllib.request.urlretrieve(url, filename=path_input)
188
 
189
  def analysis(Manifesto,Search):
190
  raw_party = Parsing(Manifesto)
 
246
  plot3=gr.outputs.Image(label='Word Cloud')
247
  plot4=gr.outputs.Image(label='Frequency Distribution')
248
 
249
+ io=gr.Interface(fn=analysis, inputs=[filePdf,Search_txt], outputs=[text,mfw,plot1,plot2,plot3,plot4], title='Manifesto Analysis',examples=[['./Bjp_Manifesto_2019.pdf','development'],['./Aap_Manifesto_2019.pdf','delhi'],['./Congress_Manifesto_2019.pdf','safety']])
250
  io.launch(debug=False,share=True)
251
  #,examples=[['./Bjp_Manifesto_2019.pdf','india'],['./Aap_Manifesto_2019.pdf',],['./Congress_Manifesto_2019.pdf',]]
252