Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Last active October 17, 2022 15:31
Show Gist options
  • Save Abhayparashar31/1e5920a4c077db680e0fea352f83e4a6 to your computer and use it in GitHub Desktop.
Save Abhayparashar31/1e5920a4c077db680e0fea352f83e4a6 to your computer and use it in GitHub Desktop.
def get_key(val):
for key, value in sentences_score.items():
if val == value:
return key
key = get_key(max(sentences_score.values()))
summary = heapq.nlargest(n,sentences_score,key=sentences_score.get) ## n=3
print(" ".join(summary))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment