example code added
Browse files
README.md
CHANGED
@@ -62,20 +62,16 @@ model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
|
|
62 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
63 |
|
64 |
text_to_summarize = """
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
The site added that naps allow for "more efficient and fulfilling work". The website stated that napping
|
76 |
-
reduces drowsiness, and improves ingenuity and creativeness. The designers offered some advice for an effective snooze.
|
77 |
-
The optimal time is 15 to 20 minutes, and all naps should take place before 3 p.m. In addition, you should not lie down
|
78 |
-
as this leads to deep sleep."""
|
79 |
|
80 |
pipe = pipeline("summarization",model = model, tokenizer=tokenizer)
|
81 |
print(pipe(text_to_summarize)[0]["summary_text"])
|
|
|
62 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
63 |
|
64 |
text_to_summarize = """
|
65 |
+
The koala is regarded as the epitome of cuddliness. However, animal lovers
|
66 |
+
will be saddened to hear that this lovable marsupial has been moved to the
|
67 |
+
endangered species list. The Australian Koala Foundation estimates there are
|
68 |
+
somewhere between 43,000-100,000 koalas left in the wild. Their numbers have
|
69 |
+
been dwindling rapidly due to disease, loss of habitat, bushfires, being hit
|
70 |
+
by cars, and other threats. Stuart Blanch from the World Wildlife Fund in
|
71 |
+
Australia said: "Koalas have gone from no listing to vulnerable to endangered
|
72 |
+
within a decade. That is a shockingly fast decline." He added that koalas risk
|
73 |
+
"sliding toward extinction"
|
74 |
+
"""
|
|
|
|
|
|
|
|
|
75 |
|
76 |
pipe = pipeline("summarization",model = model, tokenizer=tokenizer)
|
77 |
print(pipe(text_to_summarize)[0]["summary_text"])
|