Directions to use KGE | DSG
Access the KGE-CLIP GitHub Repo Here! 💙 | DSG, IITR
The usable apps are:
Text-Knowledge Graph Generation.
Image-Knowledge Graph Generation
Text & Image Vector Embedding & Knowledge Graph Embedding with TensorBoard
The guide on using the Text-Based Knowledge Graph Visualization App! The app is built using Flask, Python libraries, and the REBEL model, it efficiently extracts knowledge from text and visualizes it as interactive graphs. Let's dive into how you can make the most of this tool.

Getting Started
Prerequisites
Before you begin, make sure your environment is ready:
Python 3.7 or higher
pip (Python package installer)
Graphviz for advanced graph visualization
Installation Steps
Clone the Repository: Fork the project repository and clone it to your local machine:
git clone https://github.com/dsgiitr/kge-clip.git
cd your-repo-name
Set Up a Virtual Environment: Activate a virtual environment to manage dependencies:
On Windows:
python -m venv venv venv\Scripts\activate
On macOS/Linux:
python3 -m venv venv source venv/bin/activate
Install Dependencies: Install the required Python packages:
pip install flask transformers torch pandas networkx matplotlib plotly graphviz
Install Graphviz: Ensure Graphviz is installed and added to your system path:
Windows: Download from the Graphviz website.
macOS/Linux: Use Homebrew or your package manager:
brew install graphviz
Running the Flask App
Once installed, follow these steps to run the app:
Activate Virtual Environment and set the Flask app environment variable:
On Windows:
set FLASK_APP=app.py
On macOS/Linux:
export FLASK_APP=app.py
Start the Flask Server:
flask run
Access the App: Open
http://127.0.0.1:5000/
in your browser to start using the app.
How to Use the App
Input Text: Paste the text you want to analyze on the homepage.

Generate the Knowledge Graph: Click "Generate Knowledge Graph" to process the text and generate visualizations.

View the Results: Explore the generated knowledge graph on the result page.

How It Works
Text Processing: The app extracts triplets (subject-predicate-object) from the text using the REBEL model.
Graph Construction: These triplets are used to build a knowledge graph with NetworkX.
Visualization: The graph can be visualized in several ways:
Static Graph: Created with Matplotlib and NetworkX.
Interactive Graph: Built using Plotly, offering dynamic exploration.
Hierarchical Layout: Structured using Graphviz.
Troubleshooting Tips
Having trouble? Here are some quick fixes:
Python Compatibility: Ensure you're using Python 3.7+.
Virtual Environment: Verify your virtual environment is active.
Graphviz Installation: Make sure Graphviz is installed correctly and added to your PATH.
Memory Issues: For large texts, consider using a machine with more RAM.
Moving on in the Gitbook, the project is explained in detailed from Problems in Traditional Vector Embeddings to Knowledge Graph Embeddings and its use in RAG-LLMs.
Last updated