Views
No views yet
AdapterHub/bert-base-uncased-pf-boolq for bert-base-uncased1onnx_path = hf_hub_download(repo_id='UKP-SQuARE/bert-base-uncased-pf-boolq-onnx', filename='model.onnx') # or model_quant.onnx for quantization
2onnx_model = InferenceSession(onnx_path, providers=['CPUExecutionProvider'])
3
4context = 'English orthography typically represents vowel sounds with the five conventional vowel letters ⟨a, e, i, o, u⟩, as well as ⟨y⟩, which may also be a consonant depending on context. However, outside of abbreviations, there are a handful of words in English that do not have vowels, either because the vowel sounds are not written with vowel letters or because the words themselves are pronounced without vowel sounds'.
5question = 'can there be a word without a vowel'
6tokenizer = AutoTokenizer.from_pretrained('UKP-SQuARE/bert-base-uncased-pf-boolq-onnx')
7
8inputs = tokenizer(question, context, padding=True, truncation=True, return_tensors='np')
9inputs = {key: np.array(inputs[key], dtype=np.int64) for key in inputs}
10outputs = onnx_model.run(input_feed=dict(inputs), output_names=None)1@inproceedings{poth-etal-2021-pre,
2 title = "{W}hat to Pre-Train on? {E}fficient Intermediate Task Selection",
3 author = {Poth, Clifton and
4 Pfeiffer, Jonas and
5 R{"u}ckl{'e}, Andreas and
6 Gurevych, Iryna},
7 booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",
8 month = nov,
9 year = "2021",
10 address = "Online and Punta Cana, Dominican Republic",
11 publisher = "Association for Computational Linguistics",
12 url = "https://aclanthology.org/2021.emnlp-main.827",
13 pages = "10585--10605",
14}