- Before conduct the unsupervised triple linking, you need to prepare a bert-like pre-trained model (BERT, SimCSE, BGE) as the textual encoder and change the
base_model
variable in the scripts. - Run the scripts
triple_bge.py
andquestion_bge.py
to encode the triples and questions using semantic embeddings and run the scriptretrieve_relative_triple.py
to retrive the top-K relative knowledge for each question.
The format of the question data in question_bge.py
is the same as the data sample in data/
and we provide a KG data sample for reference.