Text-To-Graph Using ChatGPT is a powerful project that aims to convert unstructured natural language into a structured knowledge graph. By harnessing the capabilities of the ChatGPT API, this project enables the transformation of a given paragraph of text into an entity-relationship (ER) diagram.
The project leverages the ChatGPT API, which is an advanced AI language model. Its primary purpose is to comprehend and extract valuable information from unstructured text. By providing a paragraph as input to this project, the underlying code interacts with the ChatGPT API to process the input and extract significant entities and relationships.
Once the essential information has been extracted, the project proceeds to generate an ER diagram. This diagram serves as a visual representation of the entities and their relationships, offering a clear and structured depiction of the knowledge encapsulated within the original text.
To make use of this project, you must have access to the ChatGPT API. Ensure that you possess the necessary API credentials and configure the required environment variables for successful authentication.
To get started with Text-To-Graph Using ChatGPT:
- Clone this repository to your local machine using your preferred method.
- Install all the required dependencies listed in the
requirements.txt
file. You can use a package manager like pip to install them automatically. - Run the main script, ensuring that you provide the paragraph of text you wish to convert into a knowledge graph.
To exemplify the usage of this project, here is a code snippet demonstrating the basic steps:
from chatgpt import ChatGPT
# Initialize the ChatGPT model
model = ChatGPT()
# Provide the paragraph
paragraph = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla pulvinar nibh in augue fermentum, ac eleifend mi tristique."
# Generate the ER diagram
diagram = model.generate_ER_diagram(paragraph)
# Display the diagram
diagram.display()
Feel free to modify and expand upon this example according to your specific use case.
Contributions to this project are highly encouraged and appreciated. If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. Let's collaborate to enhance the functionality and usability of this Text-To-Graph project and make it even more valuable to the community.
This project is licensed under the MIT License, granting you the freedom to use, modify, and distribute the code according to the terms specified in the license.
Prompts are located in the public/prompts
folder.
- Run
npm install
to download required dependencies - Make sure you have an OpenAI API key. You will enter this into the web app when running queries.
- Run
npm run start
. GraphGPT should open up in a new browser tab.