Skip to content

Commit

Permalink
mmmmmm
Browse files Browse the repository at this point in the history
  • Loading branch information
byronbenharris committed Sep 19, 2021
1 parent 1bcfb86 commit 2cb01ee
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions flaskr/doc_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ 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






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)])

0 comments on commit 2cb01ee

Please sign in to comment.