I have played around with using AI / ChatGPT to write relevance.
I will say it works 100% correctly rarely, but it often points me in the right direction. Sometimes the hardest part is figuring out where to look on a computer for the answer you are looking for, and even when it gets the relevance partly incorrect, it can still help with that part.
I wanted to take a string and capitalize the first letter and I wasn’t sure how to go about it.
I asked, and I got this answer:
(it as uppercase as string & following text of first 1 of it) of "title"
This wasn’t quite right and returns TITLEitle
but it pointed me in the right direction.
What I really wanted was this:
((it as uppercase & following text of it) of first 1 of it) of "title"
Then I wondered about doing Title Case in relevance.
I came up with this which wasn’t exactly right, but close:
concatenations " " of ((it as uppercase & following text of it) of first 1 of it) of substrings separated by " " of "hello to the world"
Which gives me this output: Hello To The World
I then gave this relevance to ChatGPT and ask it to make the relevance give title case.
It gave me this:
(item 0 of it) & " " & (concatenations " " of ( (if it is contained by set of ("a"; "an"; "the"; "and"; "but"; "or"; "for"; "nor"; "on"; "at"; "to"; "from"; "by"; "over"; "in"; "of") then it else ( (it as uppercase & following text of it) of first 1 of it ) ) of items 1 of it)) of ( ( (it as uppercase & following text of it) of first 1 of it ) , (substrings separated by " " of "hello to the world") )
This didn’t work at all and gave errors. Not surprised.
But then I came up with this based upon this incorrect relevance:
( /* Always Uppercase First Letter */ (it as uppercase & following text of it) of first 1 of it ) of concatenations " " of ( ( /* Uppercase first letter of each word unless it is on a list */ if it is contained by set of ("a"; "an"; "the"; "and"; "but"; "or"; "for"; "nor"; "on"; "at"; "to"; "from"; "by"; "over"; "in"; "of") then it else ( (it as uppercase & following text of it) of first 1 of it ) ) of it) of (substrings separated by " " of (it as lowercase) of "hello To the wOrld")
This is quite complicated to fix and get right. Definitely not something for a novice, but I did find the direction it gave me helpful, even though I had to fix it a bunch.
The real reason I went down this path is because I wanted this:
(name of it & ( ( " " & concatenation " " of ((it as uppercase & following text of it) of first 1 of it) of substrings separated by " " of codename of it ) | "" ) ) of operating system
Which should work on most operating systems except for windows. Example output:
Linux Red Hat Enterprise Linux 8.1 Ootpa
I would be curious if anyone has had better luck with a different AI / Model.
I posted these final relevances:
- https://bigfix.me/cdb/Relevance/3023794
- https://bigfix.me/cdb/Relevance/3023795
- https://bigfix.me/cdb/Relevance/3023796
- https://bigfix.me/relevance/details/3023797
Also, since none of this required a particular operating system to run on, I tested each one on the online evaluator on developer.bigfix.com :