Go to file
DaniG2106 a295bc6657 full KG from HF + simple Graph Search 2024-07-24 12:16:37 +02:00
GraphEditingTool full KG from HF + simple Graph Search 2024-07-24 12:16:37 +02:00
Hugging2Graph full KG from HF + simple Graph Search 2024-07-24 12:16:37 +02:00
RDF_GPT_TOOL RDF Integration into provider node 2024-05-10 13:09:25 +02:00
.DS_Store full KG from HF + simple Graph Search 2024-07-24 12:16:37 +02:00
Readme.md Update Readme.md 2024-05-10 13:34:46 +02:00
question2sparql.py improved graph querying 2024-07-19 08:34:55 +02:00
requirements.txt added question2sparql.py -> takes a .ttl graph and a natural language query and generates a SPARQL query that can be executed on the graph (generated queries still unstable) 2024-07-18 16:15:12 +02:00

Readme.md

RDF_GPT_Tool README

Overview

RDF_GPT_Tool is a Python-based toolkit for interacting with RDF (Resource Description Framework) data and utilizing OpenAI's GPT models. It includes two primary components: RDF_Tool.py for graph operations and a GPT-powered question-answering module.

RDF_Tool.py

RDF_Tool.py is a graphical tool for managing RDF data. It allows users to perform various operations on RDF graphs in a visual manner. Key features include:

  • Node Management: Add, delete, and modify nodes within the RDF graph.
  • Graph Visualization: Interactive display of the RDF graph.
  • File Input: Takes .ttl (Turtle) files as input for RDF data.

Question-Answering Module

This module leverages OpenAI's GPT models to answer questions based on the RDF graph data. It selects appropriate models from the graph to fulfill the user's query. The module can be used in two ways:

  1. GUI Mode: Run gui.py for a graphical interface.
  2. Command Line Mode: Direct execution of the main method.

Installation

  1. Ensure Python is installed on your system.
  2. Clone the repository or download the source code.
  3. Install required dependencies (if any are listed).

Usage

Running RDF_Tool.py

To use the graph tool, simply start RDF_Tool.py and load your .ttl file. The GUI will provide options for node management and visualization.

Using the Question-Answering Module

GUI Mode

Run gui.py to start the graphical interface. Enter your question in the provided field, and the system will process it using the RDF graph and GPT models.

Command Line Mode

Execute the main method directly with your question as an argument. The code snippet for this is:

if __name__ == '__main__':
    question = "<your_question_here>"
    main(question)

API Key

An API key from OpenAI is required for the question-answering module. Set your API key in the code or as an environment variable.

Additional Technical Requirements

Currently, models like BERT and DistilBERT are not supported for conversion into ONNX format. To run ml_model_provider_node.py, ModelONNXCodebase.py, rdfCode.py, and CustomGraph.ttl are required.