Downloads · 30 days
97
3% of all-time downloads
razent/spbert-mlm-base
spbert-mlm-base is a question answering model from razent. Use it when the input is a question plus a passage. It is set up for transformers.
Paper: SPBERT: An Efficient Pre-training BERT on SPARQL Queries for Question Answering over Knowledge Graphs Authors: Hieu Tran, Long Phan, James Anibal, Binh T. Nguyen, Truong-Son Nguyen For more details, do check ou…
Downloads · 30 days
97
3% of all-time downloads
All-time downloads
3.7K
Public
Repo size
1.8 GB
Likes
1
Public
Click a slice to open those files.
.h5524 MB · 38%
From the Hugging Face model README
Paper: SPBERT: An Efficient Pre-training BERT on SPARQL Queries for Question Answering over Knowledge Graphs Authors: Hieu Tran, Long Phan, James Anibal, Binh T. Nguyen, Truong-Son Nguyen
For more details, do check out our Github repo. Here is an example in Pytorch:
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained('razent/spbert-mlm-base')
model = AutoModel.from_pretrained("razent/spbert-mlm-base")
text = "select * where brack_open var_a var_b var_c sep_dot brack_close"
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
or Tensorflow
from transformers import AutoTokenizer, TFAutoModel
tokenizer = AutoTokenizer.from_pretrained('razent/spbert-mlm-base')
model = TFAutoModel.from_pretrained("razent/spbert-mlm-base")
text = "select * where brack_open var_a var_b var_c sep_dot brack_close"
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
@misc{tran2021spbert,
title={SPBERT: An Efficient Pre-training BERT on SPARQL Queries for Question Answering over Knowledge Graphs},
author={Hieu Tran and Long Phan and James Anibal and Binh T. Nguyen and Truong-Son Nguyen},
year={2021},
eprint={2106.09997},
archivePrefix={arXiv},
primaryClass={cs.CL}
}