Skip to content

Commit b1dce66

Browse files
committed
done
1 parent 956baf7 commit b1dce66

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Extractive Text Summarization/summary.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,23 @@ def main(text):
132132
# Generate summary
133133
summary = summarizer.summarize(text)
134134

135-
print(summary)
135+
print("Summary : ")
136+
print(summary['summary'])
137+
138+
139+
print("------\n")
140+
141+
print("Key Points : ")
142+
for i,j in enumerate(summary["key_points"]):
143+
print(f"{i+1}. {j}")
144+
145+
print("------")
146+
136147

137148

138149
if __name__ == "__main__":
139-
main()
150+
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.
151+
152+
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.
153+
154+
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.""")

0 commit comments

Comments
 (0)