Skip to content

Commit

Permalink
v1.002
Browse files Browse the repository at this point in the history
  • Loading branch information
gachouchani1999 committed Sep 19, 2021
1 parent 4f49616 commit b1627c7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn wsgi:app
15 changes: 14 additions & 1 deletion flaskr/doc_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,24 @@ def summarize_heading(heading_text):
sentence_weight[sentence] = word_frequencies[word_weight]
sentence_weight[sentence] = sentence_weight[sentence]
select_length = 2

summary = nlargest(select_length, sentence_weight, key= sentence_weight.get)

return summary


def find_title(heading_text):
tokens = word_tokenize(heading_text)
word_frequencies = {}
for word in tokens :
if word.lower() not in stop_words and word.lower() not in punctuation:
if word not in word_frequencies.keys():
word_frequencies[word] =1
else:
word_frequencies[word] += 1
max_freq = max(word_frequencies.values())
return (list(word_frequencies.keys())[list(word_frequencies.values()).index(max_freq)])




Expand Down
4 changes: 3 additions & 1 deletion flaskr/doc_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ def final_create(theme,filename):


a = doc_analyzer.summarize_heading(par.text)

headings.append(a)
title_headings.append(str(i))
title_headings.append("Page " + i)

filename_new = filename[:filename.find('.')].title()

pptxcreator.create_slides(theme,filename_new,title_headings,headings)
Expand Down
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit b1627c7

Please sign in to comment.