Knowledge Graphs + GPT

a laptop screen with a lot of HTML text on it. in a dark room.
From Pexels by Markus Spiske

By now, anyone who has dabbled in NLP models like GPT has figured out the massive potential that exists in using ChatGPT. But it’s currently limited because it doesn’t know about anything after mid-2021, and it doesn’t have specific domain knowledge in some areas.

Today, while thinking about its limitations, I wanted to understand why GPT couldn’t be a knowledge base expert. I believe it can. This post may be outdated in a month, if not already, but I believe we will start to see ChatGPT being used in consuming knowledge graphs.

What is a knowledge graph?

A knowledge graph is a type of data storage format that captures information about entities, concepts, and their relationships in a structured way.

simple example of a knowledge graph.
Simple knowledge graph example showing the relationship between entities.

Knowledge graphs contain information about how entities are connected and allow you to express additional properties about those entities. Properties can also be linked as ideas to help give meaning to the relationships.

Why is this important?

Plugging the knowledge graph into ChatGPT will provide additional contextual information about new data not yet in the model, such as new fields of science and medicine or common law decisions that didn’t exist prior to mid-2021.

What it means for the future of AI

With the ability to couple the power of GPT and knowledge graphs, we’ll have new skills:

  • Improved contextual understanding: More accurate responses to questions.
  • Enhanced reasoning capabilities: Better answers about fields of knowledge it didn’t have before.
  • Customized learning: ChatGPT could become a relative expert in law, medicine, finance, and engineering. It doesn’t do half bad at this already. In a recent article, GPT4 scored higher than the human average on one section of the bar exam.
  • Integration with external data sources: Cheaper than retraining the entire ChatGPT Model (retraining costs +$5M USD).

Now What?

I plan to build a knowledge graph of a book, chapter by chapter.


First, I need to confirm which format to use. ChatGPT understands the following formats:

  • RDF
  • OWL
  • JSON-LD – I think this one will be best, but I’m not yet positive.

ChatGPT supports more pedestrian formats like tables and bullet points, but these don’t infer relationships as easily. ChatGPT also understands the entity-attribute-value format, as well as semantic triples, which might prove useful.

I’ll send ChatGPT a chapter of data at a time and have it identify the entities, ideas, and other attributes about characters and events that I should collect from the chapters once I have chosen a format. I plan to use something like GPTBoss, which supports recursively calling ChatGPT (using GPT4).

After I’m able to create a knowledge graph from a chapter, I’ll send it to ChatGPT and start asking it questions about the characters, relationships, and more complex meanings/ideas from the book.

Why you should try Anyword AI in 2023

Are you exploring methods to make business processes more efficient in 2023? Anyword AI can help. Anyword is an artificial intelligence (AI) platform that lets businesses efficiently manage tasks, analyze data, and generate insights. Anyword AI is the perfect tool to help your business increase productivity and gain a competitive edge through automation. In this blog post, we’ll explore why you should try Anyword AI.

The importance of effective marketing copy

In today’s competitive business landscape, the importance of effective marketing copy cannot be overstated. Compelling copy has the power to engage audiences, drive conversions, and ultimately contribute to a company’s success.

Anyword AI uses Generative Pre-trained Transformer (GPT) technology, an advanced generative AI developed by OpenAI. This revolutionary technology enables content generation that is indistinguishable from human-written work. GPT models learn patterns from huge datasets of text, allowing them to produce convincing results without direct human input. With its powerful capabilities, Anyword AI makes content creation easy and fast, allowing marketers to generate content at scale with maximum efficiency.

Using GPT-powered content generation allows marketers to stay on top of their game by delivering fresh, up-to-date content based on current trends. In short, Anyword AI can take your content creation efforts to the next level and put your brand at the forefront of modern marketing strategies. As we look ahead in 2023, there’s no doubt that any forward-thinking marketer should look into leveraging this powerful technology for their content needs.

AI-generated, tailored copy for various channels

Generative AI technology is revolutionizing the way businesses create content. It enables organizations to generate tailored copy quickly for various channels, such as websites, emails, blogs and social media. By leveraging generative AI and natural language processing (NLP), marketers can produce accurate, personalized and up-to-date content for their campaigns. Generative AI offers a wide range of industry specific use cases, such as generating product descriptions, personalized product recommendations and engaging lead capture forms.

Content generation via generative AI is cost-effective and eliminates manual data entry. It’a also adaptable, allowing businesses to tailor content to suit their specific needs.

AI-generated content is also significantly less expensive than manual copywriting, making it a great solution for companies on a tight budget. This is why it’s a good solution for small businesses looking to quickly create high quality content without breaking the bank.

Generative AI is quickly becoming an essential tool for businesses looking to maximize their online presence. With its ability to create tailored, industry specific content, it offers companies a powerful tool for reaching potential customers and increasing their sales.

The Pros of using Anyword

  • 1. Automated copywriting for content that’s tailored to the target audience.
  • 2. Improved efficiency and productivity as there is no need for manual writing or editing.
  • 3. Ability to generate consistent, high-quality content at scale.
  • 4. Automation of mundane tasks allows teams to focus on other tasks.
  • 5. Increased engagement and conversion rate through better copywriting.

The reveal

Anyword generated everything you’ve read until now. This entire blog post. Sorry to do this to you, but I wanted you to see how well the product works. I started playing with it today, and it does really well. It generates marketing copy for various channels, such as social media, email, and websites. The platform provides AI-generated copy, language optimization, performance prediction, A/B testing, and integrations with other marketing tools. It supports multiple industries and use-cases, allowing users to generate tailored copy for different marketing objectives. Give it a try, click below to start!

Asking ChatGPT to be creative in 2023

After reading Amy Goodchild’s post on ChatGPT-3 vs ChatGPT-4’s abilities on Sol Lewitt’s Wall Drawings, I wanted to see what I could do with ChatGPT.

My first prompt:

What are some things people have NOT yet asked you to do for them?

ChatGPT’s response was:

As an AI language model, I don’t keep track of specific requests from individual users, but there are certain things that are not within my capabilities or are not appropriate for me to do. For example, I cannot physically perform tasks like cooking or cleaning, and I cannot violate ethical or legal boundaries such as hacking into someone’s computer or providing illegal advice.

However, some possible examples of things that people have not yet asked me to do could include creating a completely original work of art or music, generating a completely new scientific theory or hypothesis, or developing a new language or communication system from scratch. These tasks require a high level of creativity and originality that are typically associated with human intelligence rather than artificial intelligence.

OpenAI’s ChatGPT

So I asked it to create an original work of art. In my head, I wanted it to create an image. It went left.

Here’s a short poem that I just generated for you:

In the stillness of the night,
The stars dance in pure delight,
Their twinkling lights, so serene,
Guide us through the darkness unseen.

The moon rises with a graceful air,
Its silvery glow, so bright and fair,
Reflects upon the world below,
A wondrous sight, a gentle glow.

The universe sings a symphony,
Of light and sound, so full of harmony,
A masterpiece of art and grace,
A timeless beauty, in every space.

ChatGPT, the bard

Then I asked it to generate a p5.js drawing based off of the poem it just wrote.

a moon on a black background

To see it in action, Go here and click play.

I then asked it to create a song from the poem. It generated the code in python and saved as a midi. I converted it to mp3. ChatGPT is much better at poetry and the visual arts than music.

Here’s the code it generated:

from midiutil import MIDIFile

# Define the tempo, time signature, and duration
tempo = 120
time_signature = (4, 4)
duration = 1
output_file = 'output.mid'


# Define the melody for the first track
melody = [60, 60, 60, 60, 60, 60, 60, 60, 62, 62, 62, 62, 64, 64, 65, 65, 67, 67, 69, 69, 71, 71, 72, 72]

# Define the chords for the second track
chords = [
    [60, 64, 67],
    [62, 65, 69],
    [64, 67, 71],
    [65, 69, 72],
    [67, 71, 74],
    [69, 72, 76],
    [71, 74, 77],
    [72, 76, 79]
]

# Define the bassline for the third track
bassline = [48, 50, 51, 53, 55, 57, 59, 60]

# Define the melody for the fourth track
melody2 = [72, 71, 69, 67, 65, 64, 62, 60]

# Define the string section for the fifth track
strings = [60, 64, 67, 72, 76, 79, 84, 88]

# Define the woodwind section for the sixth track
woodwinds = [62, 64, 66, 67, 69, 71, 73, 74]

# Define the brass section for the seventh track
brass = [65, 67, 69, 71, 72, 74, 76, 77]

# Define the percussion for the eighth track
percussion = [
    [35, 51],
    [35, 49],
    [36, 49],
    [35, 51],
    [35, 49],
    [36, 49],
    [35, 51],
    [35, 49]
]

# Create a new MIDI file with 8 tracks
midi_file = MIDIFile(8)

# Set the time signature and tempo for all tracks
for track in range(8):
    midi_file.addTimeSignature(track, 0, 4, 2, 24)

    midi_file.addTempo(track, 0, tempo)
# Add the notes for each track
for i, note in enumerate(melody):
    midi_file.addNote(0, 0, note, i * duration, duration, 100)

for i, chord in enumerate(chords):
    for note in chord:
        midi_file.addNote(1, 0, note, i * duration, duration, 100)

for i, note in enumerate(bassline):
    midi_file.addNote(2, 0, note, i * duration, duration, 100)

for i, note in enumerate(melody2):
    midi_file.addNote(3, 0, note, i * duration, duration, 100)

for i, note in enumerate(strings):
    midi_file.addNote(4, 0, note, i * duration, duration, 100)

for i, note in enumerate(woodwinds):
    midi_file.addNote(5, 0, note, i * duration, duration, 100)


# Write the MIDI file to disk
with open(output_file, 'wb') as file:
    midi_file.writeFile(file)

And here’s what it sounds like. ChatGPT is no Mozart.

ChatGPT’s Magum Opus concerto #1

In summary, ChatGPT is good at sounding smart but can’t yet make smart sounds. It also needs more art appreciation classes.