The problem we try to solve today is that we want to:
1. AI generate free tags from an article text, title and image. 2. The image should be used as context. 3. The tags should be consistent so we don't regenerate synonyms and create multiple terms meaning the same thing.
The problem is this - one article might be tagged "Jesus", another "Jesus Christ" and a third "The Messiah". The problem is that they are the same tag, but will now be 3 different tags connected to 1 article, instead of 1 tag connected to 3 articles.
This we will solve in this video using the AI Interpolator OpenAI module.
This video is from before the AI Interpolator module became AI Automators, part of the AI module . Module and menu names have changed since, and some steps look different today.
YouTube's automatic captions, lightly corrected. Click a line to jump to that moment in the video.
0:01
the workflow I we show now is super quick and it's aimed at people that know Drupal already so you might wonder why it says Mark Zuckerberg aka the Zuck uh so what we're going to do today
0:14
as a workflow is that we're going to add a title a image and a b body in an article and we're going to have ai pick out and generate tags for this article we have done this before so
0:27
there's a workflow for this before but we're going to up the game two times in this case so the first one is simple because this can be done with all the stuff in the Interpolator OpenAI now we're
0:38
going to uh add a image so it also tags on the image I don't know why you would want to do that but I'm just going to Showcase that is possible if you find some uh actual use case for it the other
0:51
one is more important though we want consistency in the tags and this means uh if you take this use case you have four articles about Christianity one is about Jesus second one is about Jesus
1:07
Christ the third one is about uh Jesus of Nazareth the fourth one is about the Messiah these are the same people right the AI would tag the first article is Jesus second as Jesus of Nazareth and so
1:21
on you get four tags that point to one article even though this should be one tag pointing to four articles right and and this is when AI does it this might actually happen when manual editors does
1:34
it as well say that you have a junior editor we take the same example uh you're in a country where Christianity is not the minority religion or is very small they might not know that Messiah
1:47
and Jesus Christ is the same person or even Jesus and Jesus of Nazareth right and in the case of Messiah and Jesus of Nazareth they start with different uh characters so if you have autocomplete
1:59
you're you're not going to see Messiah when you start writing Jesus right so you get the same problem there so this is what we're going to solve now um before I start with that uh
2:12
people that didn't see the workflows videos might wondering what the hell is this so there is this AI interpolator module I built which is basically a framework for uh running and chaining AI
2:24
Tools in this case we're not going to change chain we're not going to do anything complex if you want to see really cool workflows go to workflows of- a.com and there are chaining workflows
2:36
that's much cooler than what you're going to see today so uh what we're doing today is that we're just having the standard installation I have added a term called
2:48
Mark Zuckerberg aka the Zuck because I always want it to be tagged like that I don't want it to be tagged as Mark Zuckerberg right I will then go to content type
2:59
article so this is the standard installation that comes with the article we're just going to reuse it as it is it has as you can see a body a image and then the tags which is just an entity
3:09
reference what's important here it should be unlimited if you want to create multiple tags uh it should have create referenc entities if they don't already exist if you want it to generate
3:21
tags so the rule we're going to use from the interpolator can also be used to select uh categories from a category tree but in this case we want to generate them but we still want them to
3:33
be similar right the next de we do is enable the a Interpolator the rule we're going to use is OpenAI taxonomy we're going to use advanced mode because we want title and
3:45
body so we want multiple field uh you only see this if you install the token module so you have to install it I have prepared uh prompt here so I don't have to write it I will read it there based
3:56
on the article title article text and image create 5 to eight category ories that matches the text persons of not notoriety in the text or image should be tagged any name that is remotely famous
4:10
in the text should be tagged also tag the clothes that the person wears on the image for example blue shirt or red pants uh all those is to make sure that it chooses Mark Zuckerberg and it does
4:22
something on the image right abstract things or objects outside of clothing should not be tagged and that's to make sure that I mean it might might find abstract terms to be more important than
4:32
tagging Mark Zuckerberg right so I'm trying to make sure that that doesn't happen and this is prompt engineering you have to find the best prompt for what you're trying to solve article
4:41
title replaced by the token Noe title article text replaced by the nobody under advanced settings the interpolator weight and worker doesn't matter this is going to go in under 10 seconds so we
4:52
can just save it directly when we save the entity no chaining so no weight is needed text manipulation we set the uppercase because I already started with this find similar tags is the checkbox
5:05
we want to check so what this actually does is that it first it generates all these tags then it checks hey these are the tags we have is something similar then replace it so that's the only thing
5:19
it does basically but it makes it so much more powerful we're going to use GPT-4 Vision preview because the image should matter we choose the image as the image we upload so that's the image
5:30
field we save and now we're just going to create article here so I'm going to take this article so it's an article about his cage fighting but nowhere in this article does it say Mark Zuckerberg
5:45
aka the Zuck right it just says Mark Zuckerberg and we're going to upload that with this image of Bill Gates and Mark Zuckerberg and the tags field is then what's going to be filled in
5:59
automatically right so we just save now this will take a little bit of time but it's going to be finished any second now and then the tags will be filled in so if we go down it will have tags
6:16
and you will see here that it has tagged it Mark Zuckerberg aka the Zuck Elon Musk martial arts so it didn't actually do anything on the image it might be too hard to actually uh take this image so
6:31
we're going to try with another one just to see if we can get this working uh so we're just going to copy here it says Zuckerberg there maybe we need somewhere it says the first name so
6:44
it understands from Context that it's Facebook founder Mark Zuckerberg we're talking about and not someone else that might be named Zuckerberg um and let's see here we try with this
6:59
one in instead he has a very specific red tie there let's see if we can get the AI to at least see that so this is going to take some seconds again and let's see if we get something
7:17
and most importantly then it shouldn't tag it Mark Zuckerberg so it should only tag it Mark Zuckerberg aka the Zuck right and here you can see it also have tagged it red tie so I just will uh
7:30
search here there is no mentioning of red tie in the text so this it got from the image uh yeah so this is basically what's added into the features that makes the free tagging a lot more
7:43
powerful feel free to set it up it's open source is free to use just do the same thing after you watch this so yeah thank you for watching