You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Llama-KGQA

Llama-KGQA is a fine-tuned model designed for question answering (QA) over knowledge graphs (KGs). This model translates natural language (NL) questions into SPARQL queries, enabling efficient querying of structured knowledge bases like DBpedia and Wikidata.

Model Overview

  • Base Model: The fine-tuning is performed on Meta-Llama-3-8B-Instruct model with 6 epochs.
  • Dataset: The model was fine-tuned using the QALD benchmark datasets, this version is trained on QALD-9-plus-DBpedia.
  • Objective: Enable natural language interfaces to query knowledge graphs.

Usage

You can use the translate.py script provided in the GitHub repository.

python translate.py "[NATURAL_LANGUAGE_QUESTION]"

Example:

python translate.py "What is the capital of France?"

Example Output

Input:

What is the capital of France?

Output:

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX res: <http://dbpedia.org/resource/>
SELECT DISTINCT?uri WHERE {
res:France dbo:capital?uri
}

Fine-Tuning

If you would like to fine-tune the model on your own dataset, you can use the main_llama_kgqa.py script provided in the GitHub repository.

Evaluation

The model has been evaluated on QALD-9-plus-DBpedia and QALD-10-Wikidata datasets. Detailed results can be found in the GitHub repository.

License

This model is licensed under the MIT License. See the GitHub repository for more details.


Downloads last month
0
Safetensors
Model size
8.03B params
Tensor type
FP16
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for Mecharnia/Llama-KGQA

Finetuned
(527)
this model

Dataset used to train Mecharnia/Llama-KGQA