Create main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
|
| 3 |
+
summarizer = pipeline("summarization")
|
| 4 |
+
|
| 5 |
+
def get_summary(text, max_length=200, min_length=50):
|
| 6 |
+
summary = summarizer(text, max_length, min_length, do_sample=Flase)
|
| 7 |
+
return summary
|
| 8 |
+
|
| 9 |
+
for i in range(10):
|
| 10 |
+
my_input = input("Enter the text to summerize: ")
|
| 11 |
+
output = get_summary(my_input)
|
| 12 |
+
print(my_output)
|
| 13 |
+
|