saadob12 commited on
Commit
4c9b597
1 Parent(s): b9f5b00

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -34
README.md CHANGED
@@ -38,27 +38,27 @@ The input prompt template consists of the `title, x-y labels, and x-y values`.
38
  Before every input to the model, append `C2T:`.
39
 
40
  ```python
41
- from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
42
-
43
- tokenizer = AutoTokenizer.from_pretrained("saadob12/t5_C2T_big")
44
- model = AutoModelForSeq2SeqLM.from_pretrained("saadob12/t5_C2T_big")
45
-
46
- data = 'Breakdown of coronavirus (COVID-19) deaths in South Korea as of March 16, 2020\n' \
47
- 'by chronic disease x-y labels\n' \
48
- 'Response - Share of cases, x-y values Circulatory system disease* 62.7%, ' \
49
- 'Endocrine and metabolic diseases** 46.7%, Mental illness*** 25.3%, ' \
50
- 'Respiratory diseases*** 24%, Urinary and genital diseases 14.7%, Cancer 13.3%, ' \
51
- 'Nervous system diseases 4%, Digestive system diseases 2.7%, Blood and hematopoietic diseases 1.3%' \
52
-
53
- prefix = 'C2T: '
54
- tokens = tokenizer.encode(prefix + data, truncation=True, padding='max_length', return_tensors='pt')
55
- generated = model.generate(tokens, num_beams=4, max_length=256)
56
- tgt_text = tokenizer.decode(generated[0], skip_special_tokens=True, clean_up_tokenization_spaces=True)
57
- summary = tgt_text.strip('[]""')
58
- # Summary:
59
- #As of March 16, 2020, around 62.7% of COVID-19 deaths in South Korea were related to circulatory system diseases.
60
- #Other chronic diseases include endocrine and metabolic diseases, mental illness, and cancer.
61
- #South Korea confirmed 30,017 infection cases, including 501 deaths.
62
  ```
63
  # Intended Use and Limitations
64
  You can use the model to generate summaries of data files.
@@ -85,19 +85,19 @@ May or may not generate an **okay** summary at best for the following kind of da
85
  # Citation
86
  Kindly cite the work. Thank you.
87
  ```
88
- @inproceedings{obaid-ul-islam-etal-2023-tackling,
89
- title = {Tackling Hallucinations in Neural Chart Summarization},
90
- author = {Obaid ul Islam, Saad and Škrjanec, Iza and Dusek, Ondrej and Demberg, Vera},
91
- booktitle = {Proceedings of the 16th International Natural Language Generation Conference},
92
- month = sep,
93
- year = {2023},
94
- address = {Prague, Czechia},
95
- publisher = {Association for Computational Linguistics},
96
- url = {https://aclanthology.org/2023.inlg-main.30},
97
- doi = {10.18653/v1/2023.inlg-main.30},
98
- pages = {414--423},
99
- abstract = {Hallucinations in text generation occur when the system produces text that is not grounded in the input. In this work, we tackle the problem of hallucinations in neural chart summarization. Our analysis shows that the target side of chart summarization training datasets often contains additional information, leading to hallucinations. We propose a natural language inference (NLI) based method to preprocess the training data and show through human evaluation that our method significantly reduces hallucinations. We also found that shortening long-distance dependencies in the input sequence and adding chart-related information like title and legends improves the overall performance.}
100
- }
101
 
102
  ```
103
 
 
38
  Before every input to the model, append `C2T:`.
39
 
40
  ```python
41
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
42
+
43
+ tokenizer = AutoTokenizer.from_pretrained("saadob12/t5_C2T_big")
44
+ model = AutoModelForSeq2SeqLM.from_pretrained("saadob12/t5_C2T_big")
45
+
46
+ data = 'Breakdown of coronavirus (COVID-19) deaths in South Korea as of March 16, 2020\n' \
47
+ 'by chronic disease x-y labels\n' \
48
+ 'Response - Share of cases, x-y values Circulatory system disease* 62.7%, ' \
49
+ 'Endocrine and metabolic diseases** 46.7%, Mental illness*** 25.3%, ' \
50
+ 'Respiratory diseases*** 24%, Urinary and genital diseases 14.7%, Cancer 13.3%, ' \
51
+ 'Nervous system diseases 4%, Digestive system diseases 2.7%, Blood and hematopoietic diseases 1.3%' \
52
+
53
+ prefix = 'C2T: '
54
+ tokens = tokenizer.encode(prefix + data, truncation=True, padding='max_length', return_tensors='pt')
55
+ generated = model.generate(tokens, num_beams=4, max_length=256)
56
+ tgt_text = tokenizer.decode(generated[0], skip_special_tokens=True, clean_up_tokenization_spaces=True)
57
+ summary = tgt_text.strip('[]""')
58
+ # Summary:
59
+ #As of March 16, 2020, around 62.7% of COVID-19 deaths in South Korea were related to circulatory system diseases.
60
+ #Other chronic diseases include endocrine and metabolic diseases, mental illness, and cancer.
61
+ #South Korea confirmed 30,017 infection cases, including 501 deaths.
62
  ```
63
  # Intended Use and Limitations
64
  You can use the model to generate summaries of data files.
 
85
  # Citation
86
  Kindly cite the work. Thank you.
87
  ```
88
+ @inproceedings{obaid-ul-islam-etal-2023-tackling,
89
+ title = {Tackling Hallucinations in Neural Chart Summarization},
90
+ author = {Obaid ul Islam, Saad and Škrjanec, Iza and Dusek, Ondrej and Demberg, Vera},
91
+ booktitle = {Proceedings of the 16th International Natural Language Generation Conference},
92
+ month = sep,
93
+ year = {2023},
94
+ address = {Prague, Czechia},
95
+ publisher = {Association for Computational Linguistics},
96
+ url = {https://aclanthology.org/2023.inlg-main.30},
97
+ doi = {10.18653/v1/2023.inlg-main.30},
98
+ pages = {414--423},
99
+ abstract = {Hallucinations in text generation occur when the system produces text that is not grounded in the input. In this work, we tackle the problem of hallucinations in neural chart summarization. Our analysis shows that the target side of chart summarization training datasets often contains additional information, leading to hallucinations. We propose a natural language inference (NLI) based method to preprocess the training data and show through human evaluation that our method significantly reduces hallucinations. We also found that shortening long-distance dependencies in the input sequence and adding chart-related information like title and legends improves the overall performance.}
100
+ }
101
 
102
  ```
103