Knowledge Graphs Using Python and ChatGPT

Knowledge Graphs Using Python and ChatGPT

In the era of Generative AI and Natural Language Understanding it has become a complex challenge to understand context of questions being asked in different ways.

To answer questions many chat systems are required to have proper knowledge of that subject , understand relationships between words within that context.

The LLMs like Chat GPT and Google BARD are well known systems now a days and they also provide APIs to generate relationships between words in given context which we can very well integrate in our systems to boost our NLP capabilities.

If we integrate these APIs with programming language like python then it becomes easy to process large text data and their meanings in well known knowledge graphs , Store them in any Graph based data base , use them when and where required.

Here i have integrated Python with Chat GPT api's and generate knowledge graphs.

Repository is public and easy to use. Here are some steps to enable it:

Make sure you have python 3.8 or higher version and below python packages installed.

  1. pandas
  2. networkx
  3. matplotlib

Open AI api key: Please generate and save your open ai api key from here?https://platform.openai.com/account/api-keys


How to Run

Please follow below instructions to run this project

  1. Download or clone the project repo.
  2. Install required python packges.
  3. Open cmd and Goto -> knowledgegraph-gpt-python folder.
  4. Run "python3 knowledgegraph.py"
  5. After running it will ask for knowledge base file name where you have your text, for testing i have kept supplychain.txt in knowledgebase folder. You can add any text file in this folder for your purpose.
  6. For testing give "supplychain.txt" as input.
  7. Next it will ask for openai api key. please provide your api key generated from?https://platform.openai.com/account/api-keys
  8. Wait for sometime and knowledge graph will be generated. You can also use list of entities and relationships for your projects.

No alt text provided for this image



要查看或添加评论,请登录

Prateek Kale的更多文章

  • Airflow : The Data Pipeline Framework

    Airflow : The Data Pipeline Framework

    Focus areas for this post : What is Airflow? How useful is Airflow in WMS(workflow management system) space. Example of…

    1 条评论
  • Different Clustering Methods Using Tableau and R

    Different Clustering Methods Using Tableau and R

    Tableau provides default clustering method as k-means clustering , in this article we will discuss about how to achieve…

  • Practice for Web Data connector - Setup and connection with Tableau

    Practice for Web Data connector - Setup and connection with Tableau

    What is Web Data Connector? Web data connector(WDC) is one of the data source in tableau to fetch data from websites in…

  • Tableau with R - The connection

    Tableau with R - The connection

    Hi , In my First article of tableau with R i am going to discuss about how we make connection from tableau to R and…

    3 条评论

社区洞察

其他会员也浏览了