saadob12 commited on
Commit
fb6aeef
1 Parent(s): d5eeb99

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -0
README.md CHANGED
@@ -3,6 +3,20 @@
3
 
4
  **Gitlab Link for the data**: https://gitlab.com/bottle_shop/snlg/chart/autochart
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  # Limitations
7
  You can use the model to generate summaries of data files.
8
  Works well for general statistics like the following:
 
3
 
4
  **Gitlab Link for the data**: https://gitlab.com/bottle_shop/snlg/chart/autochart
5
 
6
+ # Example use:
7
+ ```
8
+ tokenizer = AutoTokenizer.from_pretrained(saadob12/t5_C2T_autochart)
9
+ model = AutoModelForSeq2SeqLM.from_pretrained(saadob12/t5_C2T_autochart)
10
+
11
+ data = 'Trade statistics of Qatar with developing economies in North Africa bar_chart Year-Trade with economies of Middle East & North Africa(%)(Merchandise exports,Merchandise imports) x-y1-y2 values 2000 0.591869968616745 3.59339030672154 , 2001 0.53415012207203 3.25371165779341 , 2002 3.07769793440318 1.672796364224 , 2003 0.6932513078579471 1.62522475477827 , 2004 1.17635914189321 1.80540331396412'
12
+
13
+ prefix = 'C2T: '
14
+ tokens = tokenizer.encode(prefix + data, truncation=True, padding='max_length', return_tensors='pt')
15
+ generated = model.generate(tokens, num_beams=4, max_length=256)
16
+ tgt_text = tokenizer.decode(generated[0], skip_special_tokens=True, clean_up_tokenization_spaces=True)
17
+ summary = str(tgt_text).strip('[]""')
18
+ #Summary: This barchart shows the number of trade statistics of qatar with developing economies in north africa from 2000 through 2004. The unit of measurement in this graph is Trade with economies of Middle East & North Africa(%) as shown on the y-axis. The first group data denotes the change of Merchandise exports. There is a go up and down trend of the number. The peak of the number is found in 2002 and the lowest number is found in 2001. The changes in the number may be related to the conuntry's national policies. The second group data denotes the change of Merchandise imports. There is a go up and down trend of the number. The number in 2000 being the peak, and the lowest number is found in 2003. The changes in the number may be related to the conuntry's national policies.
19
+ ```
20
  # Limitations
21
  You can use the model to generate summaries of data files.
22
  Works well for general statistics like the following: