From b1dce66857b8cc3a0bcbdfa61ba1769d7966b9bd Mon Sep 17 00:00:00 2001 From: one-Alive Date: Thu, 7 Nov 2024 13:29:50 +0530 Subject: [PATCH] done --- Extractive Text Summarization/summary.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Extractive Text Summarization/summary.py b/Extractive Text Summarization/summary.py index 9272342..7677aa1 100644 --- a/Extractive Text Summarization/summary.py +++ b/Extractive Text Summarization/summary.py @@ -132,8 +132,23 @@ def main(text): # Generate summary summary = summarizer.summarize(text) - print(summary) + print("Summary : ") + print(summary['summary']) + + + print("------\n") + + print("Key Points : ") + for i,j in enumerate(summary["key_points"]): + print(f"{i+1}. {j}") + + print("------") + if __name__ == "__main__": - main() + main("""NLP is a subfield of computer science and artificial intelligence concerned with interactions between computers and human (natural) languages. It is used to apply machine learning algorithms to text and speech. + +For example, we can use NLP to create systems like speech recognition, document summarization, machine translation, spam detection, named entity recognition, question answering, autocomplete, predictive typing and so on. + +Nowadays, most of us have smartphones that have speech recognition. These smartphones use NLP to understand what is said. Also, many people use laptops which operating system has a built-in speech recognition.""")