byeongal commited on
Commit
451a1bf
1 Parent(s): 7945914

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -1
README.md CHANGED
@@ -23,6 +23,7 @@ The Authors’ code can be found here:
23
  https://github.com/pytorch/fairseq/tree/master/examples/bart
24
 
25
  ## Usage
 
26
  ```python
27
  from transformers import PreTrainedTokenizerFast, BartForConditionalGeneration
28
 
@@ -31,7 +32,7 @@ tokenizer = PreTrainedTokenizerFast.from_pretrained("ainize/bart-base-cnn")
31
  model = BartForConditionalGeneration.from_pretrained("ainize/bart-base-cnn")
32
 
33
  # Encode Input Text
34
- input_text = '(CNN) -- South Korea launched an investigation Tuesday into reports of toxic chemicals being dumped at a former U.S. military base, the Defense Ministry said. The tests follow allegations of American soldiers burying chemicals on Korean soil. The first tests are being carried out by a joint military, government and civilian task force at the site of what was Camp Mercer, west of Seoul. "Soil and underground water will be taken in the areas where toxic chemicals were allegedly buried," said the statement from the South Korean Defense Ministry. Once testing is finished, the government will decide on how to test more than 80 other sites -- all former bases. The alarm was raised this month when a U.S. veteran alleged barrels of the toxic herbicide Agent Orange were buried at an American base in South Korea in the late 1970s. Two of his fellow soldiers corroborated his story about Camp Carroll, about 185 miles (300 kilometers) southeast of the capital, Seoul. "We\'ve been working very closely with the Korean government since we had the initial claims," said Lt. Gen. John Johnson, who is heading the Camp Carroll Task Force. "If we get evidence that there is a risk to health, we are going to fix it." A joint U.S.- South Korean investigation is being conducted at Camp Carroll to test the validity of allegations. The U.S. military sprayed Agent Orange from planes onto jungles in Vietnam to kill vegetation in an effort to expose guerrilla fighters. Exposure to the chemical has been blamed for a wide variety of ailments, including certain forms of cancer and nerve disorders. It has also been linked to birth defects, according to the Department of Veterans Affairs. Journalist Yoonjung Seo contributed to this report.'
35
  input_ids = tokenizer.encode(input_text, return_tensors="pt")
36
 
37
  # Generate Summary Text Ids
@@ -48,3 +49,6 @@ summary_text_ids = model.generate(
48
  # Decoding Text
49
  print(tokenizer.decode(summary_text_ids[0], skip_special_tokens=True))
50
  ```
 
 
 
 
23
  https://github.com/pytorch/fairseq/tree/master/examples/bart
24
 
25
  ## Usage
26
+ ### Python Code
27
  ```python
28
  from transformers import PreTrainedTokenizerFast, BartForConditionalGeneration
29
 
 
32
  model = BartForConditionalGeneration.from_pretrained("ainize/bart-base-cnn")
33
 
34
  # Encode Input Text
35
+ input_text = '(CNN) -- South Korea launched an investigation Tuesday into reports of toxic chemicals being dumped at a former U.S. military base, the Defense Ministry said. The tests follow allegations of American soldiers burying chemicals on Korean soil. The first tests are being carried out by a joint military, government and civilian task force at the site of what was Camp Mercer, west of Seoul. "Soil and underground water will be taken in the areas where toxic chemicals were allegedly buried," said the statement from the South Korean Defense Ministry. Once testing is finished, the government will decide on how to test more than 80 other sites -- all former bases. The alarm was raised this month when a U.S. veteran alleged barrels of the toxic herbicide Agent Orange were buried at an American base in South Korea in the late 1970s. Two of his fellow soldiers corroborated his story about Camp Carroll, about 185 miles (300 kilometers) southeast of the capital, Seoul. "We\\'ve been working very closely with the Korean government since we had the initial claims," said Lt. Gen. John Johnson, who is heading the Camp Carroll Task Force. "If we get evidence that there is a risk to health, we are going to fix it." A joint U.S.- South Korean investigation is being conducted at Camp Carroll to test the validity of allegations. The U.S. military sprayed Agent Orange from planes onto jungles in Vietnam to kill vegetation in an effort to expose guerrilla fighters. Exposure to the chemical has been blamed for a wide variety of ailments, including certain forms of cancer and nerve disorders. It has also been linked to birth defects, according to the Department of Veterans Affairs. Journalist Yoonjung Seo contributed to this report.'
36
  input_ids = tokenizer.encode(input_text, return_tensors="pt")
37
 
38
  # Generate Summary Text Ids
 
49
  # Decoding Text
50
  print(tokenizer.decode(summary_text_ids[0], skip_special_tokens=True))
51
  ```
52
+
53
+ ### API
54
+ You can experience this model through [ainize](https://ainize.ai/gkswjdzz/summarize-torchserve?branch=main).