Rahmat82 commited on
Commit
186c753
·
verified ·
1 Parent(s): 3571e83

example code added

Browse files
Files changed (1) hide show
  1. README.md +10 -14
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
- If you ever feel the need to sleep while standing, a company in Japan has catered to your needs.
66
- The Koyoju Plywood Corporation on Japan's northernmost island of Hokkaido has unveiled the "Giraffenap" booth.
67
- This ingenious cubicle allows the user to sleep in a vertical position. It will allow office workers and
68
- commuters to catch forty winks without the need for a bed. The designers say a 20-minute nap improves mental
69
- performance and increases productivity by reducing fatigue. It also boosts concentration and aids memory retention.
70
- The Giraffenap pods come in two designs the futuristic-looking 'Spacia' and the lattice wood 'Forest'.
71
- They will go on sale in December at an expected price of around $20,000. The Giraffenap website says there is a need
72
- to refresh while at work. It says: "It's so common these days to work non-stop without an opportunity to properly
73
- recover from physical fatigue or stress, often resulting in unwanted sleepiness during the day.
74
- Now it's time to break the stereotype that nodding off on the job is a sign of boredom or laziness."
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"])