Building Knowledge graph using GraphGPT

Sai Praveen
Everything is Connected
4 min readMay 24, 2023

Unlock the power of interconnected knowledge with GraphGPT — the cutting-edge technology revolutionizing how we understand information through knowledge graphs.

Welcome back to the second part of our Everything is Connected series, where we explore how seemingly different topics are interconnected in fascinating and unexpected ways.

The Information-driven world we live in today requires the ability to quickly and efficiently acquire relevant information. Knowledge graph, as discussed previously, caters to this problem by organizing data into a network of related concepts, making it simpler to navigate and extract insights from. While Knowledge Graphs do their work, GraphGPT has stepped up the game by introducing autonomous Knowledge Graph construction. Due to its cutting-edge features and adaptability, GraphGPT is swiftly becoming the preferred tool for data scientists, developers, and academics.

In this blog, we will be delving into Knowledge Graphs and GraphGPT. With the help of an example of Times Now news headlines, we will see how GraphGPT can leverage textual data (News Headlines) into Knowledge Graphs using NLP. We will then see how to form interconnections between two news articles based on the created Knowledge Graphs and draw insights.

Knowledge Graphs

A knowledge Graph is a system of things representing real-world entities in the form of Objects (Entities) and defining the relationship (Predicate) between them. For more information about what Knowledge Graphs are and how they work, visit the first part of the series here.

What is GraphGPT?

GraphGPT is an open-source project that uses GPT language models to build and analyze knowledge graphs. It can automatically extract and organize information text data, making insights easier to interpret and use. It uses advanced natural language processing (NLP) techniques for entity and relationship extraction. GraphGPT will later represent this knowledge in a knowledge graph form. With this powerful tool, one can use GraphGPT to improve search engines, enhance data analysis, Etc.

How does GraphGPT work?

Application of GraphGPT

One of the best ways to use GraphGPT is to find hidden connections between news articles.

With GraphGPT, we can weave together the essential threads of news articles, unraveling the complexity of current events and illuminating the hidden insights beneath the surface. By exploring the web of connections that emerge, we can gain a deeper understanding of what’s truly happening in the world and leverage that knowledge to develop more innovative and practical solutions to real-life challenges. It’s like having a map to navigate the complex information landscape, helping us make sense of the chaos and find new paths toward progress.

Below are the steps to use GraphGPT with examples:

  • Basic NLP-based knowledge graph
  • Knowledge graph of interconnected news article headlines

Example 1:

Step 1:

GraphGPT requires an OpenAI API key to generate graphs. You can make an account at https://openai.com/. More detailed steps are given in the article below https://www.howtogeek.com/885918/how-to-get-an-openai-api-key/

Step 2:

Visit https://graphgpt.vercel.app/ and enter your openAPI key. Now, enter the text prompt you want the knowledge graph of and click on the generate button.

Step 3:

In the generated graph the nodes represent the entities and the edges represent the relationships.

More entities and connections can be added to the graph by simply adding more prompts.

For example, to modify the graph above, the following prompt was added

“tuff is John Doe’s dog, he eats meat, hates vegetables, and loves John Doe”

The clear button allows you to clear any already existing graphs in case you need to create a new one.

Example 2:

In this example, we will be taking more than one news prompt to make an interconnected knowledge graph showing insights. The prompt for this graph is news articles giving updates on corona cases and deaths in India dated 04–04–2023:

India reports 3,962 new coronavirus infections, active Covid cases dip to 36,244 — (Article 1)

India Reports 3,962 Covid Cases In 24 Hours, 6% More Than Yesterday — (Article 2)

Delhi records 289 new Covid cases, 1 death; positivity rate at 9.74 percent — (Article 3)

Delhi is a state in India, news date: 04–04–2023” — (Article 4)

The above prompts give the following graph output:

This graph is news from different articles linked together via relationships into one singular knowledge graph.

Conclusion

To sum it up, GraphGPT is a software that combines neural networks and language models. It represents information as nodes and edges in a graph. GraphGPT can identify relationships between entities, point out missing data, and generate accurate predictions. With a graph, we can extract hidden insights from news articles or connect two domain news articles. The graph could significantly impact the way we interpret data and information and have profound impacts on many different kinds of industries, including finance, healthcare, and cybersecurity.

Authors — Reva Bharara, Aryan Rathore

--

--