Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Created October 17, 2022 15:28
Show Gist options
  • Save Abhayparashar31/b0bb0f1b83c8fd5d424654ce23a51546 to your computer and use it in GitHub Desktop.
Save Abhayparashar31/b0bb0f1b83c8fd5d424654ce23a51546 to your computer and use it in GitHub Desktop.
sentences_score = {}
for sentence in sent_tokens:
for word in word_tokenize(sentence):
if word in word_frequency.keys():
if (len(sentence.split(" "))) <30:
if sentence not in sentences_score.keys():
sentences_score[sentence] = word_frequency[word]
else:
sentences_score[sentence] += word_frequency[word]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment