Create Blogs in Seconds Using Perplexity AI

Kevin Hogan
27 Jul 202433:29

Summary

TLDRThe video script introduces an AI news fact-checking setup that automates the verification of facts within articles. It uses chat GPT for drafting but addresses inaccuracies by splitting articles into facts, checking them individually via an online service, and updating a database in Airtable. The process includes creating tables for articles and facts, setting up automations for fact-checking, and integrating with an external API for verification. The result is an accurate, verified article, beneficial for bloggers and content creators.

Takeaways

  • 😀 The video introduces an AI news fact-checker setup designed to automate the verification of facts within articles generated by AI, such as Chat GPT.
  • 🛠️ The creator shares a personal story about a blogger who uses AI to write articles but struggles with fact-checking, which inspired the development of this AI tool.
  • 📝 The AI fact-checker works by splitting an article into individual facts, checking each one for accuracy, and then compiling the verified information back into a coherent article.
  • 🔍 The tool uses an AI prompt to format the article into logical chunks and then leverages an external service, 'perplexity,' to verify the facts by searching the web.
  • 📈 The process involves creating an Airtable database with tables for articles and facts, and setting up various fields and automations to manage the workflow.
  • 🔗 The setup includes linking records between the articles and facts tables to associate each fact with its originating article for organized verification.
  • 🔧 The video provides a step-by-step guide on building the AI news fact-checker, including the creation of views, fields, and formulas within Airtable.
  • 📚 The tutorial covers complex strategies and thought processes behind the automation, teaching viewers how to implement similar systems on their own.
  • 🔄 The fact-checking process is automated through a combination of Airtable's automation features and external API requests to verify the accuracy of each fact.
  • 📊 The video demonstrates the use of iterators and conditional logic to handle the verification of multiple facts and update the status of each within the database.
  • 🎯 The final product is a verified article with corrections and supporting evidence where necessary, ensuring the information is accurate and up-to-date.

Q & A

  • What is the main purpose of the AI news fact-checker setup described in the script?

    -The main purpose of the AI news fact-checker is to automate the verification of facts within articles, ensuring that the information posted is accurate, relevant, and up-to-date.

  • Why was the AI news fact-checker created?

    -The AI news fact-checker was created to address the issue of inaccuracies in articles generated by chatbots like Chat GPT, which sometimes produced fake or outdated information due to the data it was trained on.

  • How does the AI news fact-checker handle the verification of facts within an article?

    -The AI news fact-checker splits the article into different facts, loops through these facts, and uploads them to a fact database. It then uses an external service like Perplexity to verify each fact individually and updates the database with the verification results.

  • What role does Perplexity play in the AI news fact-checker process?

    -Perplexity is used to search the web and verify the accuracy of each fact. It provides the system with the ability to research and validate the information, ensuring that the facts are true or false with supporting evidence.

  • What is the significance of the 'Start Fact Check' button in the AI news fact-checker setup?

    -The 'Start Fact Check' button triggers the automation process within Airtable, initiating the fact-checking sequence for the article, which includes splitting the article into facts and starting the verification process.

  • How does the AI news fact-checker ensure that all facts in an article have been verified?

    -The system tracks the status of each fact check and only marks the article as 'ready' when the total number of facts equals the number of facts verified, indicating that the verification process is complete.

  • What is the importance of the 'compiled facts' field in the AI news fact-checker database?

    -The 'compiled facts' field is a rollup field that compiles all the verified facts into a single view, allowing for an easy compilation of the final verified article.

  • How does the AI news fact-checker differentiate between verified and unverified facts?

    -The AI news fact-checker uses a 'fact check status' field to indicate whether a fact is 'not started', 'in progress', or 'complete'. Only facts marked as 'complete' are considered verified.

  • What is the benefit of having a 'supporting evidence' field in the fact database?

    -The 'supporting evidence' field provides the rationale behind the verification of a fact, offering specific evidence or sources that confirm whether the fact is true or false.

  • How can users of the AI news fact-checker benefit from the final verified article?

    -Users can benefit from the final verified article by having a publication-ready content that is fact-checked and updated with accurate information, ensuring credibility and reliability.

Outlines

00:00

🤖 Introduction to AI News Fact-Checker Tool

The speaker introduces an AI news fact-checker setup they've created to address the issue of verifying facts within articles generated by AI, such as Chat GPT. The motivation stems from a blogger's challenge of manually fact-checking due to inaccuracies. The tool automates the process of fact-checking and promises to demonstrate its functionality, output, and the thought process behind its creation. It's mentioned that the tool is complex, involving various strategies and an understanding of Airtable.

05:02

📝 Building the AI News Fact-Checker Database

The tutorial begins on setting up the AI news fact-checker by creating a new database with 'articles' and 'facts' tables in Airtable. Fields are added to the 'articles' table, including an auto-numbered 'article ID', 'article' for text, 'AI prompt' for formatting, and 'fact check status'. The process involves creating views, linking records, and setting up automations for the fact-checking process. The speaker also promotes their school community for further support and resources.

10:03

🔍 Fact-Checking Process and Airtable Setup

This paragraph delves into the specifics of the fact-checking process, detailing the creation of fields within the 'facts' table of the Airtable database. It includes 'fact ID', 'original fact', 'accuracy', 'fact correction', and 'supporting evidence'. The setup involves linking facts to articles, creating views for managing facts, and setting up automations that trigger the fact-checking process upon user action.

15:05

👨‍💻 Automation and Fact-Checking Workflow

The speaker outlines the automations needed for the fact-checking tool within Airtable, starting with the 'Start Fact Check' button that triggers a Make.com scenario. The process involves fetching the article record, updating statuses, splitting the article into facts, and preparing the data for fact-checking. The automation handles the transition from 'not started' to 'in progress' and sets up the structure for fact verification.

20:06

🔄 Iterating Facts and Online Verification

The paragraph explains the iterative process of sending facts to an online verification service, likely Perplexity, to check their accuracy due to rate limits. It involves parsing text to ensure JSON compatibility, making HTTP requests to the verification service, and handling responses. The process is automated to avoid crashes and ensure each fact is verified individually.

25:08

📝 Finalizing Fact-Checked Articles

The final part of the process involves receiving responses from the fact-checking service, formatting them into JSON objects with fields for accuracy, evidence, and corrections. The information is then parsed and used to update the Airtable records, marking the verification status as complete. An additional automation updates the article's status to 'done' once the verified article is compiled, concluding the fact-checking process.

30:09

🎉 Conclusion and Call to Action

The speaker concludes by expressing excitement about sharing the AI news fact-checker tool and encourages viewers to like and subscribe for support. They highlight the value provided by the tool and its real-world application, hinting at future developments and offerings within their community.

Mindmap

Keywords

💡AI News Fact Checker

The 'AI News Fact Checker' is the central theme of the video, referring to a system designed to verify the accuracy of information within news articles. It is an automated tool that uses AI to ensure the facts presented are up-to-date and correct. In the script, the creator discusses building this system to help a blog owner who was facing issues with the authenticity of information generated by Chat GPT.

💡Chat GPT

Chat GPT is mentioned as the AI tool initially used to generate blog content. It is an advanced language model capable of creating human-like text based on prompts. However, the script highlights a limitation where Chat GPT sometimes produces outdated or fictional facts, necessitating the creation of the AI News Fact Checker to verify its output.

💡Fact Checking

Fact checking is the process of verifying the accuracy of statements or information. In the context of the video, it is the primary function of the AI News Fact Checker system. The script describes how the system breaks down an article into individual facts and checks each one for truthfulness, using tools like Perplexity to search the web for supporting evidence.

💡Perplexity

Perplexity, in this script, refers to an AI tool or service used for searching the web and verifying the accuracy of individual facts. It is part of the verification process in the AI News Fact Checker system. The script mentions making an HTTP request to Perplexity to check the validity of each fact presented in the articles.

💡Automation

Automation is a key concept in the video, referring to the process of creating automated workflows that can perform tasks without manual intervention. The AI News Fact Checker system is built with automation in mind, using triggers and scripts to automatically check facts and update the database. The script outlines several automations, such as starting the fact check and updating records when fact checks are complete.

💡Airtable

Airtable is a cloud-based database tool that is used in the video to organize and manage data. The script describes setting up an 'AI News Fact Checker' database in Airtable with tables for articles and facts, and using it to store and update information throughout the fact-checking process.

💡API Key

An API key is a unique code used to authenticate requests to an API (Application Programming Interface). In the context of the video, the API key is used to access Perplexity's services for fact verification. The script mentions obtaining an API key from Perplexity to make HTTP requests for fact checking.

💡JSON

JSON (JavaScript Object Notation) is a lightweight data format used for data interchange. In the script, JSON is used to structure the data for fact checking, ensuring that information is properly formatted for processing by AI tools. The video discusses formatting text for JSON compatibility and parsing JSON results from AI prompts.

💡Rate Limits

Rate limits refer to the restrictions on the number of requests that can be made to an API within a certain period. The script mentions adding a 5-second sleep timer in the automation to comply with Perplexity's rate limits, preventing the system from sending too many requests at once and potentially crashing.

💡Supporting Evidence

Supporting evidence is the information or sources that back up the accuracy of a fact. In the video, the AI News Fact Checker not only checks if a fact is true or false but also provides supporting evidence for its verification. The script describes how the system uses Perplexity to find and include this evidence in the final verified article.

💡Webhook

A webhook is a way for an app to provide other applications with real-time information. In the script, webhooks are used to trigger actions in the AI News Fact Checker system, such as starting the fact-checking process when a new article is added to Airtable.

Highlights

Introduction of an AI news fact-checking setup designed to verify the accuracy of information generated by AI, specifically addressing issues with Chat GPT's factual reliability.

A blog owner's challenge of manually fact-checking articles written by Chat GPT due to inaccuracies, highlighting the need for automation in the verification process.

The demonstration of an automated solution that integrates with Airtable and Make.com to streamline the fact-checking of AI-generated articles.

Explanation of the process where the AI-generated article is broken down into individual facts for verification, showcasing a method to handle complex information.

Utilization of Perplexity AI to search the web and verify each fact, illustrating the integration of external APIs for enhanced fact-checking.

The presentation of a verified article with corrections and supporting evidence, emphasizing the system's capability to provide accurate and updated information.

A step-by-step guide on building the AI news fact-checker, offering educational value and transparency into the construction process.

The creation of an Airtable database with 'Articles' and 'Facts' tables, detailing the initial setup for the fact-checking system.

Description of fields and views setup in Airtable for organizing and managing articles and facts, providing insight into database structuring.

The use of automation within Airtable to trigger fact-checking processes, demonstrating the practical application of Airtable's automation features.

Integration of a webhook to connect Airtable with Make.com, illustrating the technical setup for inter-service communication.

The setup of a Make.com scenario to handle the logic of fact-checking, including the use of GPT for text processing.

Implementation of an iterator to handle the verification of multiple facts, showcasing the use of looping mechanisms in automation.

The parsing of JSON data to manage fact information effectively, highlighting the importance of data formatting in automation workflows.

Use of HTTP requests to interact with the Perplexity API for fact verification, detailing the technical interaction with external services.

The final compilation of verified facts into a final article, emphasizing the system's output and its practical use for content creators.

A call to action for viewers to subscribe and like the video, indicating the creator's engagement with the audience and desire for community growth.

Transcripts

play00:00

hey I hope you're having an absolutely

play00:01

incredible day today I wanted to run you

play00:03

through this new setup that I built

play00:06

which is an AI news fact Checker now the

play00:09

thing that's really cool about this and

play00:11

I'll just pull up the make.com scenario

play00:14

to show you what it looks like the way I

play00:15

can explain this the best is through a

play00:17

little story so I was introduced to

play00:20

someone recently through mutual friends

play00:22

and he runs a Blog where he makes a

play00:26

considerable amount of money and most of

play00:29

the blogs are written using chat gbt so

play00:31

he'll use chat GPT to come up with ideas

play00:34

and also to write the majority of the

play00:36

article and the issue that he was

play00:39

encountering is that not all of the

play00:41

facts from Chad gbt from what it was

play00:43

creating were actually real and some of

play00:46

these were fake or some of them were old

play00:48

based on what chat GPT has been trained

play00:50

on and so he was spending a lot of his

play00:52

time manually going and having to search

play00:55

up this information on Google and so I

play00:58

told them that there is a solution to

play01:00

this and it can be fully automated and

play01:02

so here it is and so firstly I wanted to

play01:04

show you how it works and show you the

play01:07

output and explain to you a little bit

play01:10

of what's going on and then we'll go

play01:13

ahead and build this out ourselves I

play01:15

think that you will learn a ton if you

play01:18

actually follow this to the very end

play01:20

because it's pretty complex there's a

play01:22

lot going on and it'll teach you a lot

play01:24

about make as well as a lot of uh air

play01:28

table so you you'll be learning some

play01:30

basic strategies all the way up to some

play01:32

more complex strategies and you'll also

play01:34

get my thought process behind how this

play01:36

was actually achieved so let's say he

play01:39

takes his article he wants to be able to

play01:42

fact check the entire article make sure

play01:44

that what he's posting is relevant as

play01:46

well as up-to-date information right

play01:48

with what is currently available now the

play01:51

issue is is that when you have a 2word

play01:54

article chat GPT is really good at the

play01:57

beginning and the end and so all of this

play01:59

information in between kind of gets lost

play02:02

and so you need to break up the entire

play02:04

article into different facts and so what

play02:06

I did is you paste in your article here

play02:09

you click fact check it's going to run

play02:12

it through this so essentially first it

play02:15

comes up here it splits it all into

play02:18

different facts it is then going to Loop

play02:20

through these facts upload them back

play02:22

into the fact database so here you can

play02:25

see that it's split through every single

play02:27

fact this was another one that I had run

play02:29

right you can see is all complete here

play02:31

and it's just going to check every

play02:33

single one so that's when it comes down

play02:34

through the second part of the

play02:36

Automation and it is doing a request out

play02:39

to perplexity to verify this information

play02:41

and it verifies every single fact

play02:44

individually through perplexity so it's

play02:46

actually searching the web and

play02:47

perplexity is doing that research for

play02:49

you and then it goes and it re-uploads

play02:51

it back into air table and you end up

play02:53

with a final verified article that you

play02:55

can see here so before we go any further

play02:57

I'm just going to show you how it works

play03:00

and we're going to run it right now so

play03:01

we're going to back out of this

play03:02

automation here and now we are going to

play03:05

click Start faction now this is going to

play03:07

trigger the automation within the air

play03:09

table now if we come back here in a

play03:11

second we should see that the execution

play03:13

has started running it has triggered the

play03:16

watch responses air table trigger and is

play03:19

going to start splitting it into facts

play03:21

if we hop back into our air table and we

play03:23

click into the fax database we should

play03:25

start to see all the facts starting to

play03:27

be populated right here the scenario is

play03:29

running boom it split the facts and now

play03:32

it ising through all the facts and you

play03:34

can see them start to get pushed in and

play03:36

the accuracy is pending with the fact

play03:38

check status in progress and with every

play03:41

single fact it's going to tell you

play03:43

whether the fact is actually true or

play03:45

false and then provide you with

play03:47

supporting evidence as to why based on

play03:49

the research that it did so now you can

play03:51

see it's looping through the second

play03:53

portion right so right down here it's

play03:55

looping through and it's doing the

play03:57

research within perplexity and then we

play04:00

come back into the generate article you

play04:03

can see all of the different facts that

play04:04

have been verified you can see that

play04:06

these first four were all false where

play04:08

the fact correction is and why it is

play04:11

false and then lastly it outputs the

play04:14

final article as a verified article it

play04:17

marks the fact check status is done and

play04:19

you can read the entire article and you

play04:21

can view the changes that it made

play04:24

yourself to make sure that it is

play04:26

actually accurate all right so you can

play04:28

see here you know if we looked at the

play04:30

first one elvenwood is home to the

play04:32

Redwood Forest Reserve where towering

play04:34

ancient trees reached towards the sky

play04:37

and then we see that it's marked it as

play04:39

false and if we read the fact correction

play04:41

the Redwood National Park in California

play04:43

so it's not actually elvenwood it's the

play04:45

Redwood National Park it makes the

play04:47

changes based on the information that it

play04:49

found and then it also provides you with

play04:51

supporting evidence stating you know it

play04:53

mentions elvenwood is not a real

play04:55

location it seems to be a fictional

play04:57

artistic reference as seen from this

play04:59

book real locations for this are Redwood

play05:02

National Park in California so it makes

play05:04

the changes it does all of this research

play05:07

for you so that you don't have to and

play05:09

then it outputs the final article so in

play05:12

my opinion that is incredible and now we

play05:14

are going to dive in and learn how we

play05:16

can actually build this out ourselves so

play05:19

I hope you're ready this one's going to

play05:21

be a big one and this one is super

play05:23

awesome it has a real world application

play05:26

there's someone doing this right now

play05:28

making a ton of money and I'm super

play05:31

happy to be sharing this with you I've

play05:32

worked on it for the last couple of

play05:33

weeks you know really iterating it it

play05:35

used to have a lot more steps I tried to

play05:37

simplified as much as possible and this

play05:38

is where I ended up so let's get started

play05:41

so the very first thing that we're going

play05:43

to want to do is create a new AI news

play05:45

fact Checker database so you're going to

play05:47

go ahead create a new database from

play05:49

scratch right so I just called mine AI

play05:51

news fact Checker and then you're going

play05:53

to want to have two tables the first

play05:55

one's going to be articles and the

play05:56

second one is going to be facts now

play05:58

within the views I just created one view

play06:01

so you come down here you click on new

play06:03

grid and that'll give you the view that

play06:05

you want and you can just retitle that

play06:08

all articles and then within this you're

play06:10

going to want to add a bunch of fields

play06:13

so we are just going to Loop through all

play06:14

of these fields now and we are going to

play06:17

build it out from scratch together

play06:19

before we go any further and we run

play06:21

through all of the different columns

play06:23

that we have and how it's all linked I

play06:25

just wanted to mention that I do have a

play06:27

school Community where I provide all of

play06:29

these make automations for you also have

play06:32

weekly calls and anytime you have any

play06:35

questions whatsoever you can reach out

play06:36

to me personally and I'll be able to

play06:38

help you walk through and debug your own

play06:41

issues and really get you from where you

play06:43

are at to where you want to be so the

play06:45

community is 60% off right now as we're

play06:47

new and as we're growing and as I want

play06:49

to make the community as best as it

play06:51

possibly can and in order to do so once

play06:53

we hit 20 community members it'll only

play06:56

become 40% off and it'll continue like

play06:58

that until it is full price and you'll

play07:01

be locked in at a lifetime price of 60%

play07:04

off and what I'm going to be building

play07:05

out in the future I haven't seen anyone

play07:07

else doing you'll be able to research

play07:09

your niches pull in the best performing

play07:12

posts of their data and then also be

play07:15

able to create your own post all managed

play07:17

within airtable and make.com and I'm

play07:20

super excited to be sharing this with

play07:22

you and building this out and sharing my

play07:24

journey along the way so for this you

play07:26

are going to need to have the article ID

play07:30

which is just a simple ID Auto number

play07:32

field I called it article ID you come

play07:35

down here you select auto number and

play07:37

that way every single article will have

play07:39

its own unique ID you're also going to

play07:41

want to have an article which is going

play07:43

to be long text that's where you'll be

play07:45

pasting in your article to have the

play07:47

information verified you're also going

play07:49

to have this AI prompt so it's also

play07:52

going to be a long text and then the

play07:54

text that we have here is split the

play07:56

following article into logical chunks

play07:58

based on ideas or facts we're going to

play08:00

format the result as adjacent object

play08:02

with an array called pairs now each

play08:04

object within the array should have

play08:06

three keys so we're going to have the

play08:07

original which is going to contain the

play08:09

original chunk fact we're going to have

play08:12

a fact check which is going to be set to

play08:14

pending meaning that the fact hasn't

play08:15

been verified and it's either going to

play08:17

be true or false and then we are going

play08:19

to have correction which for the time

play08:21

being should be said to null and if it

play08:23

is false then it's going to have the

play08:25

correction uploaded in there so we also

play08:27

do not want to include any delimiters

play08:29

like Json around the Json output right

play08:32

so we want it in the pure Json format

play08:34

and lastly here is the article and then

play08:38

we are going to add a checkbox the

play08:40

checkbox is going to be start fact check

play08:42

and that is the style that we are using

play08:44

we're going to have the fact check

play08:47

status and there are three different

play08:48

fields so you're going to come in here

play08:50

you're going to choose single select so

play08:51

you're either going to have not started

play08:52

in progress or done and the default

play08:55

option is going to be not started so

play08:57

whenever you create a new article it is

play08:59

going to automatically be in the not

play09:01

started status next we are going to have

play09:03

a record ID the record ID is going to be

play09:05

the formula and then the formula is

play09:07

simply going to be record ID with both

play09:09

parentheses we are going to have the

play09:11

total fact so this is essentially what

play09:14

allows us to determine if the uh fact

play09:17

check status is done or not right so we

play09:19

have the the total fact and the total

play09:21

fax is going to be count of the fax link

play09:26

so I'll show you how to set that up in a

play09:27

second then we're going to have fax

play09:29

verified which is a count once again of

play09:32

the fax link and we're going to turn

play09:34

this on so only include linked records

play09:36

from fax where fact check status is

play09:39

complete once again don't worry about

play09:41

that for now you can just go ahead and

play09:43

set them up and choose count but we

play09:46

won't be able to select the source yet

play09:47

until we create the fact table and then

play09:50

we are going to have the ready and this

play09:52

is the formula which is saying like if

play09:54

total fax is greater than zero and the

play09:57

total fax is equal to the facts verified

play10:00

give it the status of one otherwise keep

play10:02

it at zero so essentially when these two

play10:05

are equal put this to one otherwise if

play10:08

all the facts haven't been verified yet

play10:10

then the status is not ready because the

play10:12

article is not done lastly I have two

play10:14

other hidden Fields here right now which

play10:16

is the fax linked and the compiled fact

play10:19

so we'll get to those in a second for

play10:21

now let's hop into the fax View and one

play10:25

other thing that's important to note

play10:27

that I forgot to say is you want to

play10:30

group by the article so that every

play10:32

single article that you create is going

play10:34

to have this nice little dashboard now

play10:36

if we hop into facts right I have two

play10:39

grids so you're going to want to create

play10:41

two grids the first one you're going to

play10:43

click here you're going to click grid

play10:44

the first one is going to be all facts

play10:46

and then the second one is going to be

play10:47

generate article so if we open up the

play10:50

all facts it's got a pretty similar

play10:52

setup to the Articles table so first

play10:54

you're going to want to have a fact ID

play10:55

which is going to be an auto number next

play10:57

thing you want to have is the original

play10:58

fact right so this is where your facts

play11:01

are all going to be split so that is

play11:03

just long text go ahead and save that

play11:05

then you're going to have accuracy

play11:07

accuracy is also going to be long text

play11:09

then you're going to have fat correction

play11:10

also long text and that's where if there

play11:13

is a correction so accuracy will

play11:15

initially be set to pending and then

play11:17

once it is run through perplexity it's

play11:20

either going to come back as false or

play11:21

true and if it is false then you're

play11:23

going to have a fact correction here and

play11:25

then you're also going to have

play11:26

supporting evidence which is going to be

play11:29

long text as well so fact check status

play11:32

is a single select and there's only two

play11:34

options which is either it's in progress

play11:35

or it's complete you are also going to

play11:37

have a record ID so once again this is

play11:39

going to be a formula with the record ID

play11:41

you are going to have an article link so

play11:43

now we're going to make our first link

play11:46

right so you're going to go link to

play11:48

articles so you go link to another

play11:50

record and then you're going to select

play11:51

the Articles table and that'll create

play11:54

the article link and then I also have a

play11:56

few other fields here that are hidden

play11:58

I'll unhide them so that that you can

play11:59

add them as well but you have the

play12:01

article which is from the article so

play12:04

that's a lookup field and we are going

play12:06

to be looking up from the article link

play12:09

that we just created and then we are

play12:11

going to be looking up the article so

play12:13

that's important because that'll allow

play12:15

everything within our make to be

play12:17

processed at once so what that means is

play12:20

let's say you have 10 different facts

play12:22

they're all going to be under the same

play12:24

article which is the article ID so let's

play12:27

say article ID is one and within article

play12:30

ID 1 we have 10 different facts that are

play12:33

created well this is going to link them

play12:35

all together here and then we also have

play12:38

ready which is another lookup field and

play12:40

we're looking up in the article link

play12:42

that we created and we're looking up the

play12:44

ready table and then lastly we have the

play12:46

fact display which is a Formula which is

play12:50

essentially saying that if the accuracy

play12:52

is equal to True provide the original

play12:54

fact otherwise provide the fact

play12:57

correction so this is is going to be

play13:00

important when it comes to compiling

play13:02

everything together at the end because

play13:04

for every single fact we're going to

play13:06

have the fact display and then we're

play13:08

going to roll up the fact display so

play13:11

essentially what's happening is if the

play13:13

accuracy is equal to true meaning that

play13:15

the the fact is actually true provide us

play13:17

with the original fact otherwise if the

play13:20

fact is false provide us with the

play13:21

correction all right so I'm just going

play13:22

to go ahead and hide those fields and

play13:24

then I also have it filtered by the fact

play13:26

check status so where fact check status

play13:30

is not complete so as soon as it becomes

play13:32

complete it comes off of all facts and

play13:35

it goes into generate article and then

play13:37

they are grouped by the article link so

play13:39

that you get a nice view in this

play13:41

article's all facts table now if we go

play13:44

to generate article right so you just go

play13:46

create a new grid generate article

play13:49

that's what you can name it and then I

play13:50

filtered by you know I want to show

play13:53

records where fact check status is

play13:54

complete and ready is equal to one and

play13:57

then they are grouped by the article

play13:59

Link in this table as well so that you

play14:00

get this nice little dashboard now we're

play14:02

going to hop back into articles and

play14:05

within articles now we can create these

play14:07

last three right here so if we go to

play14:09

Total facts and we do a count we're

play14:11

going to select the the count link the

play14:14

count source which is going to be equal

play14:16

to the fax link now in order to connect

play14:18

it to that we are going to have to

play14:21

unhide two more Fields so this is where

play14:23

we're going to create our last two

play14:24

fields that we couldn't before because

play14:26

we had to create the fax table so I'm

play14:28

just going we're going to go ahead and

play14:30

unhide those now and so here we can see

play14:32

the fax link so this is going to be a

play14:35

link we're going to allow linking to

play14:37

multiple records and we're going to call

play14:39

it the fax link so essentially this

play14:41

article is linked to all of these

play14:43

different facts and if we hop into the

play14:47

facts right 9394 we can see that all of

play14:50

these are linked under this specific

play14:53

article ID where these are the fact IDs

play14:56

so we have that there and then lastly we

play14:58

have the compiled fax which is a rollup

play15:01

of the fax link so a roll up of all of

play15:05

these fact and we are just joining those

play15:08

values and we are separating them by a

play15:10

space that's all that's happening there

play15:12

now that we've created the fax link and

play15:15

the compiled facts we can hop into total

play15:17

facts so once again we going to select

play15:20

count and we are going to select the fax

play15:23

link as the count source so right we see

play15:26

that there are six facts so it's going

play15:28

to show us that there are six total

play15:30

facts and then facts verified is also

play15:33

another count we're linking it to facts

play15:35

link again but we are adding in this

play15:38

condition where the fact check status is

play15:40

equal to complete so it's only counting

play15:42

complete facts or facts that have been

play15:44

verified and lastly if we look at ready

play15:47

it is just saying if the total fact is

play15:48

greater than zero and total fact is

play15:51

equal to the facts verified then give it

play15:53

a status one meaning that it's complete

play15:56

all right and so now we have both of our

play15:58

tables setup and if we go into our

play16:01

automations there's a few automations

play16:03

that we need to have as well so the

play16:05

first one is going to be the start the

play16:07

fact check right when I click the button

play16:09

to start the fact check we need to send

play16:11

that trigger into make in order to

play16:13

create the make scenario so we are going

play16:16

to have it so that when a record matches

play16:19

a specific condition we are going to

play16:20

connect it to the article's table and is

play16:23

going to be when start fat check is

play16:25

clicked and when that happens we're

play16:28

going to run a script

play16:29

the record ID is going to be equal to

play16:31

the air table record ID and then we just

play16:34

have this simple code go ahead and open

play16:37

this up you can see here the name and

play16:38

the value we we need to create an input

play16:40

variable so we call the the variable

play16:42

record ID capital I and the value is the

play16:46

air table record ID and we are just

play16:48

saying you know fetch this web hook so

play16:50

we're going to go ahead we're going to

play16:51

create a web hook and make now and the

play16:54

action is going to be equal to fact

play16:55

check so if we hop into the fact Checker

play16:58

we click on watch responses right that's

play17:01

the first thing we need to do so you're

play17:02

going to create a new trigger it's going

play17:05

to be the watch responses in air table

play17:08

and right you would just go ahead You'

play17:09

create a new web hook you'll see here

play17:12

right that that web hook has a specific

play17:15

address we're going to copy that address

play17:17

to clipboard and we are going to paste

play17:19

it right here so await fetch so you're

play17:22

awaiting for that URL of that web hook

play17:25

to get this trigger going and then we're

play17:27

going to pass the record ID as well as

play17:29

the action fact check so that's the

play17:31

first thing you can go ahead you can

play17:33

choose your record right so you would

play17:35

just choose one of the Articles or

play17:37

choose an article load in some sample

play17:39

data there what I did to test it out is

play17:42

I said create an article about a travel

play17:44

destination with both real and fake

play17:46

information please do not specify which

play17:48

is real and fake just write the article

play17:50

and then I copied all of that

play17:52

information and I pasted it into the

play17:55

article's table so I came in here I hit

play17:58

plus I create created a new article and

play18:00

I just dropped it under the article it's

play18:02

going to start and then we want to

play18:03

create a router it's going to have two

play18:05

routes the first route is going to be

play18:06

the fact Checker which is going to split

play18:08

it into individual facts so for that you

play18:11

want to set the label to fact check the

play18:14

condition is going to be the action that

play18:16

is passed from Air table so the action

play18:19

in in this case is fact check and we're

play18:22

going to set the text equal to fact

play18:23

check so that when we hit the start fact

play18:26

check button it is going to trigger this

play18:29

automation of starting the fact check

play18:31

and it's going to run this script and go

play18:33

past this information and know to go

play18:35

down this path now to test that once you

play18:38

could just choose the record like we

play18:40

just did and then hit Test action and

play18:42

then come into to make and hit run once

play18:45

and it is going to trigger that now next

play18:47

thing we want to do is get that actual

play18:49

record that is just triggered right so

play18:51

that we can split it into facts so

play18:52

you're going to go ahead you're going to

play18:54

create your connection within air table

play18:57

if you don't know how to do that and it

play18:58

is your your first time it's really

play18:59

simple you click on your account within

play19:02

developer Hub you can then create your

play19:04

own personal access token name it

play19:06

whatever you want and then you just want

play19:08

to make sure that you add all of the

play19:10

possible Scopes you click here add scope

play19:12

click all of them and then add the right

play19:15

base right the right database so I just

play19:18

have it set to all databases and then

play19:20

you're going to go ahead hit save and

play19:21

then that'll get created and then it is

play19:24

very simple to just set it up afterwards

play19:26

like that then you are going to want to

play19:28

choose your base so we named ours the AI

play19:30

news fact Checkers so you want to make

play19:32

sure you select the the right table in

play19:34

our case it's articles and then the

play19:36

record ID is going to be the record ID

play19:38

that was passed when we tested out this

play19:40

trigger for the first time so now let's

play19:42

grab that information the next thing we

play19:44

want to do is update the record so once

play19:47

again create your connection select the

play19:49

Articles table grab that same record ID

play19:52

from the first step here and then we are

play19:54

going to update the fact check status to

play19:58

input progress right so you can just

play20:00

turn off mapping and then it is now gone

play20:03

from not started to in progress so that

play20:05

when we click Start fact check it gets

play20:08

flipped into in progress status and we

play20:10

will leave the rest blank ahead and hit

play20:12

okay now the next thing we want is to

play20:16

split this into Json so we're going to

play20:19

create a chat completion we're using GPT

play20:21

40 the role is set to user and then the

play20:24

message content is you are an assistant

play20:27

that formats text for Jason

play20:29

compatibility your task is to process

play20:31

the following article text by replacing

play20:33

new lines with n and escaping double

play20:37

quotes with one two three four five

play20:41

slashes right return the formatted text

play20:43

only here is the article text where I

play20:46

paste the article and the article is

play20:49

going to be from the record that we just

play20:51

grabbed right the article and then we

play20:53

going to ensure that the Json is

play20:55

properly formatted without any line

play20:57

breaks with within string values and we

play21:00

don't want to include any delimiters

play21:01

like Json or around the Json output set

play21:04

the max tokens equal to zero after that

play21:06

is done we're going to split the article

play21:09

interax we want to create a completion

play21:11

so we're going to choose the GPT 40 the

play21:14

r set to user and then message content

play21:17

is going to be the AI prompt right so so

play21:19

we're going to split it into different

play21:21

facts and different chunks with the

play21:23

original the status and the correction

play21:26

and then we are going to pass that

play21:28

article here's the article Max token is

play21:30

going to be set to zero hit okay and

play21:32

then once that is done we'll get a bunch

play21:34

of different pairs and we now want to

play21:37

parse that Json right and so to do this

play21:39

you would add these two steps we're

play21:42

going to head back into the AI news fact

play21:44

Checker we're going to test the action

play21:47

again we are going to run this once and

play21:49

then we'll get that information passed

play21:51

down through here and then to parse the

play21:54

Json we'll grab the result from the

play21:57

splitter so you can see here's my result

play21:59

right you can see this Pairs and then

play22:01

you're going to have it split properly

play22:03

into the different facts now once that's

play22:06

done we need to iterate through all of

play22:08

those facts and we need to pass that

play22:10

back to air table so for that I just put

play22:13

in an iterator and that is linked to the

play22:16

pairs so you can see here it is now

play22:18

split nicely into original fact check

play22:20

and correction it was parse properly and

play22:24

we're going to grab that iterator we're

play22:26

going to grab those pairs we're also

play22:27

going to sleep so I found if you put in

play22:30

a 1 second sleep timer it prevents it

play22:33

from all the records being updated at

play22:34

once which sometimes causes it to crash

play22:37

so having this sleep timer of 1 second

play22:39

allows each individual fact to come in

play22:41

without any errors and then lastly we're

play22:44

going to create a record so now we're

play22:45

creating a record in the fax table so

play22:48

instead this time connect it to the fax

play22:51

table and then from there from that

play22:53

record we are going to pass the original

play22:56

fact so that's going to be the original

play22:58

from the iterator then the accuracy is

play23:01

going to be set to pending right for the

play23:04

article to be verified or for that fact

play23:06

to be verified and then the fact

play23:08

correction is going to be the correction

play23:11

which is blank because it has not had

play23:14

any chance to be verified yet we're

play23:16

going to set the fact check status to in

play23:19

progress and the article of the record

play23:22

ID right is going to be the record ID

play23:25

from the very beginning this allows us

play23:27

to have all the facts contained within

play23:30

that article based on the record ID so

play23:33

once all of that is done and go ahead

play23:35

hop back into here you're going to test

play23:38

the action again you're going to hop

play23:40

back into make you're going to run it

play23:42

once and you should now have if you hop

play23:45

into your facts table if you go into all

play23:47

facts you should have all of your facts

play23:50

here since mine have already been

play23:51

verified when I did this example at the

play23:53

very start you'll see that the generate

play23:56

article portion is full but in your case

play23:59

under all facts you should see all these

play24:01

set to pending all of this should be set

play24:03

to blank and you're going to have the

play24:05

original fact the accuracy set to

play24:07

pending and the fact check status to

play24:09

impr progress now let's build out the

play24:11

second portion of the fact Checker so

play24:14

now that it's split everything into

play24:15

facts and it can verify all facts

play24:17

individually next thing that we want to

play24:18

do is we want to get a record so same

play24:21

thing we're going to come into air table

play24:24

we're going to create a new Automation

play24:25

and that's going to be fact check online

play24:28

and so what's going to happen is when a

play24:29

record enters the allfax view right so

play24:33

when a record enters a view we're going

play24:34

to select the fax view is going to be

play24:36

set to alax we're going to run a script

play24:39

so it's the same script that we just had

play24:41

the previous step once again we're going

play24:43

to create an input variable which is

play24:45

going to be the record ID and it's going

play24:47

to be the air table record ID and then

play24:49

we are going to fetch the same web hook

play24:52

we're going to pass that record ID and

play24:54

this time the action is going to be set

play24:56

to online verify so when we come back

play24:59

here in the router when we have this

play25:02

filter it's going to be set to online

play25:04

verify where the action that is passed

play25:07

from the watch responses is going to be

play25:10

equal to online verify so now it knows

play25:12

to come down this path and not the fact

play25:14

check path once again we are going to

play25:16

get the record we are going into the

play25:18

fact Checker database we are going into

play25:21

the Articles table and we are grabbing

play25:23

the record ID from the very start so to

play25:25

get this kicked off you'll want to come

play25:28

into here choose a record choose any one

play25:31

of the records that are going to be in

play25:32

your table and then you're going to hop

play25:34

into run a script and click Test action

play25:37

and then you're going to run this once

play25:39

and then your response will come through

play25:40

here and you should be able to get that

play25:43

information and the record ID now the

play25:45

next thing that we want to do is parse

play25:47

the text right so I was getting this

play25:50

error because of the blank spaces and

play25:53

how it was formatted coming from a table

play25:57

into make it wasn't always properly

play25:59

formatted and a lot of that had to do

play26:02

with titles and then there would be a

play26:04

space and then there would be the body

play26:06

section of that article and when that

play26:09

happens it doesn't allow you to have

play26:10

proper Json formatting so what we are

play26:13

going to do is put in this text parser

play26:16

which is going to remove that and allow

play26:18

it to pass through uh in proper Json

play26:21

formatting so I just did sln as the

play26:24

pattern and the new value is going to be

play26:27

dou sln in instead so essentially what's

play26:29

happening is this is the search pattern

play26:32

that it's looking for and then it's

play26:34

replacing that pattern with this new

play26:36

value and then we are going to want to

play26:38

check Global match check that it's case

play26:41

sensitive because it's always going to

play26:42

be lowercase n and check the multi-line

play26:46

as well single line you can set to know

play26:49

and then the text is going to be the

play26:51

original fact is created within your

play26:54

table hit okay next thing because of

play26:56

rate limits with perplex we don't want

play26:58

to send all the facts at once so we add

play27:01

a 5sec sleep timer and this is just due

play27:04

to perplexities rate limits with their

play27:06

API so next thing we want to do is make

play27:08

an HTTP request to perplexity so we are

play27:12

going to have this as the URL https API

play27:16

perplexity completions we're going to do

play27:19

a post request so we're going to be

play27:20

sending information to them for that to

play27:22

verify we are going to set the header to

play27:25

accept application Json as the value the

play27:29

second header is the name is going to be

play27:31

authorization and then it's going to as

play27:33

the value is going to be ver Bearer and

play27:36

then your API key that you're going to

play27:38

get from perplexity lastly the third

play27:39

item that you want is the content type

play27:43

as the name and the value as the

play27:44

application Json for your third header

play27:47

then we are going to have the body type

play27:49

set to Raw the content type set to Jason

play27:53

and then this is the request content so

play27:56

here is the model that we are using for

play27:58

this specific case the role of the

play28:00

system is really to ensure that the

play28:02

information is up to date accurate and

play28:04

relevant right because we are verifying

play28:06

all these facts so that's what we're

play28:07

asking the system to do and then the

play28:09

prompt that we're passing it so we're

play28:11

going to pass the role as the user the

play28:13

content is going to be you are

play28:15

factchecking assistant your task is to

play28:17

verify the accuracy of the following

play28:18

statement and provide a detailed

play28:21

response it is going to be the text that

play28:23

has been parsed properly so the fact

play28:26

that has been parsed properly and this

play28:27

is is why it's so important to have that

play28:29

in there because if you don't have the

play28:31

text pared properly then this Json

play28:33

request will not work because there's

play28:35

going to be spaces in it so your

play28:38

response should include whether the

play28:39

statement is true or false supporting

play28:41

evidence or sources and a corrected

play28:42

version if needed and then format it in

play28:45

the following response in the following

play28:47

format accuracy true or false supporting

play28:50

evidence provide specific evidence of

play28:52

sources here and then a corrected

play28:54

statement so if the original statement

play28:56

is false provide a corrected version of

play28:59

the entire original statement with

play29:00

accurate information if the statement is

play29:02

true leave this field know so once that

play29:04

is done we are going to have another

play29:07

completion created within chat

play29:09

GPT I would recommend that you hop in

play29:12

your fact check and you test the action

play29:15

you hop back in here you run a once and

play29:17

you make sure that you get a status code

play29:18

of 200 for perplexity because otherwise

play29:21

the rest of the steps won't work so once

play29:23

you get a status code of 200 then you

play29:26

can proceed onto the chat GPT step

play29:28

and before going any further I'm going

play29:31

to be sharing this request content with

play29:34

you so that you have it and you can just

play29:37

copy paste rather than having to do it

play29:40

all yourself and then we're going to

play29:43

have the create a completion within that

play29:45

GPT so we're going to set the role to

play29:47

user and then we're going to have the

play29:50

following prompt so format the following

play29:53

fact checking result as adjacent object

play29:55

with these fields now accuracy

play29:57

supporting evidence correction remove

play29:59

any prefixes right so we want to get it

play30:01

into the proper Json format so that we

play30:03

can split it again using par Json and

play30:06

then pass all those values back into our

play30:08

air table and then the factchecking

play30:10

result is going to be the data

play30:14

choices message content so it's going to

play30:18

put that into proper Json formatting for

play30:21

us and then lastly we are going to parse

play30:24

the results from chat GPT so you just

play30:28

come in here you select the result it

play30:30

should be parsed properly based on the

play30:32

prompt that we gave it and then lastly

play30:35

we are going to update our air table

play30:38

record So within fax you're going to

play30:40

grab the record ID now the record ID is

play30:43

not going to be the original record ID

play30:46

within air table we're going to want to

play30:48

grab the air table record ID make sure

play30:51

you choose this one down at the bottom

play30:53

from the following step right here and

play30:56

then the record that we're going to

play30:58

update is the accuracy so the Json has

play31:01

now been parsed properly it's going to

play31:02

be the accuracy under the accuracy the

play31:04

fact correction so whether the fact is

play31:07

true or false is going to be the

play31:08

correction and then the supporting

play31:10

evidence is going to be supporting

play31:13

evidence which is going to be pass right

play31:15

here we're going to update the fact

play31:17

check status to complete so make sure

play31:19

that you turn this off and select

play31:21

complete when this is switched into

play31:23

complete it'll also trigger the number

play31:26

of facts that are verified and that is

play31:28

it for that and you want to go ahead and

play31:30

save and you can go ahead and test it

play31:32

again test the action and run it once

play31:35

and have it run through this entire

play31:37

prompt and if it's done properly you

play31:39

should end up with one of your facts

play31:42

under the generate article with the

play31:44

accuracy either set the true or false

play31:46

and if it's false it should have a fact

play31:48

correction with supporting evidence now

play31:50

I do have one other automation that's

play31:52

important and that is when the fact

play31:54

check is equal to complete so lastly

play31:57

we're going to to set one last

play31:59

automation within air table which is

play32:01

when a record matches the condition

play32:04

where the article's table as the

play32:07

verified article is not empty so

play32:10

essentially what's happening is when the

play32:12

verified article is not empty right

play32:15

we're going to update the record of the

play32:17

fact check status of the articles with

play32:19

the record ID and the fact check status

play32:21

is going to be equal to done so now what

play32:25

that'll look like on your main page

play32:27

within the AR articles it's going to

play32:29

trigger and say hey this article is now

play32:31

complete and your verified article

play32:34

should pop up here now you should be

play32:36

able to turn on all of your automations

play32:38

as well as turn on your make scenario

play32:43

and back in here you can paste the

play32:46

article that I'll have shared with you

play32:48

and you should just be able to click

play32:50

Start fact check it should run

play32:51

completely in the background and output

play32:54

a verified article that has been

play32:56

searched has has found the latest

play32:58

information updated it where it could

play33:01

and output a completed and verified

play33:04

article that is correct now this took me

play33:07

a ton of time to build out and I'm super

play33:10

psyched to be sharing it with you I hope

play33:12

you got immense value out of it and if

play33:14

you did I would really appreciate if you

play33:16

dropped a like And subscribe it's free

play33:18

and it really helps my channel grow and

play33:20

allows me to continue making videos like

play33:23

this so I hope you have an incredible

play33:25

day and I'll catch you on the next one

play33:27

peace PE

Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
AI Fact-CheckerArticle VerificationAutomationContent AccuracyData ResearchChat GPTPerplexity AIWebhook IntegrationAirtableMake.com
هل تحتاج إلى تلخيص باللغة الإنجليزية؟