Views
No views yet
neulab/omnitab-large-1024shot (based on BART architecture) is initialized with microsoft/tapex-large and continuously pretrained on natural and synthetic data (SQL2NL model trained in the 1024-shot setting).1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2import pandas as pd
3
4tokenizer = AutoTokenizer.from_pretrained("neulab/omnitab-large-1024shot")
5model = AutoModelForSeq2SeqLM.from_pretrained("neulab/omnitab-large-1024shot")
6
7data = {
8 "year": [1896, 1900, 1904, 2004, 2008, 2012],
9 "city": ["athens", "paris", "st. louis", "athens", "beijing", "london"]
10}
11table = pd.DataFrame.from_dict(data)
12
13query = "In which year did beijing host the Olympic Games?"
14encoding = tokenizer(table=table, query=query, return_tensors="pt")
15
16outputs = model.generate(**encoding)
17
18print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
19# [' 2008']1@inproceedings{jiang-etal-2022-omnitab,
2 title = "{O}mni{T}ab: Pretraining with Natural and Synthetic Data for Few-shot Table-based Question Answering",
3 author = "Jiang, Zhengbao and Mao, Yi and He, Pengcheng and Neubig, Graham and Chen, Weizhu",
4 booktitle = "Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies",
5 month = jul,
6 year = "2022",
7}