Project Idea: “Rudeness Translator”
Motivation: Comments on my Medium articles like this
With two claps from one person and an absolutely lambasting comment, “We Need HTML” is not exactly my best-received article. The person who left the comment is highly critical of frontend web frameworks, but a number of people on Medium defend him with the argument that his points are legitimate.
So some people leave really critical comments on my Medium blogs. What do I do? I could stop blogging, but then my general ideas about software development would be kept away from a public forum, only coming to light when they are plugged into real, important production code instead of field-tested here. I could disable comments, but then readers would have no way to correct me for anything. I could delete negative comments, but that would be harmful to potential readers as well. What if I wrote conspiracy theories about how React is dead, or how GPT-4 almost escaped?
What I could really use is a “rudeness translator,” something that turns unnecessarily scathing, non-constructive criticism and translates it into tactful, constructive criticism.
Me: It translates rude comments into constructive ones
BH: Does that mean it would also translate constructive criticism into rude comments?
Me: Of course
GPT-3.5
The code I have so far, and there is not much, is based on this
The person who wrote that probably based her work on the actual OpenAI documentation. Smack and I have worked with the API using Python, but in my mind I imagine using JavaScript will flow a little more smoothly with tools I am used to.
I was thinking of focusing in on the JavaScript code today, but…it is not rocket science. I consider this the GPT equivalent of “hello world.” It uses text-davinci-003, or gpt-3.5-turbo, meaning anything you make with it relies on the same technology as ChatGPT. Line 8 extracts an API key I do not want to share from my .bashrc file. I have the price capped at $5 a month, but so far today I have not even expended a cent.
You can run with node GptHelloWorld.js, if you have a key set up, but it really does not do much. It validates the API key, and it provides a motivational speech about coding limited to 70 tokens.
Node.js is a JavaScript runtime environment. Line 5 uses the require() function, which is supported in Node.js and allows you to include modules in your project. The function itself, starting on line 13, is an async function. Without going into great detail, the async and await keywords enable asynchronous, promised-based behavior.
Line 21 prints the text response. Line 22 prints the number of tokens used.
$ node main.js
Coding is an amazing skill to have! It can open up so many doors and opportunities for you. It can help you create things that you never thought were possible. It can help you solve problems and make life easier. It can help you make a difference in the world. Coding is a skill that can take you places and help
token cost: 84 tokens
Moving Ahead
Next there can be an actual frontend. I have already drawn out an extremely professional, sophisticated wireframe using a dirty piece of paper and a crayon.
When you type in Google Translate, the result is instant. I would guess that their webpage is reactive. Here, on the other hand, there should probably be an actual button to avoid making too many calls to something that costs a little bit of money every time you call it.
The normal-comment -> Rude-comment is where things get interesting. I do not imagine GPT is capable of something like this, so I may have to roll out my own code and invent my own algorithms. For now, I am thinking of inserting the word “bullcookies” into every third sentence. From here, sky is the limit. Maybe I will include some text files full of customized insults and jam them in between sentences.
Closing Thoughts
Someone wrote this comment:
What sort of dribble is this? Are you even qualified to write anything that remotely concerns coding and technology? So many mistakes here like, “Backend developers works closely with hardware”. Just shows you how much you know, which is NIL! It’s simple, it’s so hard to get a software engineering job because you’re too lazy to be any good. If you were, everyone would be banging down your door. I get headhunted at least 2 or 3 times a day and get offers from all around the world. But then again, I worked hard over the last 20 years to be the best I can be in my field. Stop being lazy and rubbish as a software engineer and complaining why companies won’t hire you. You cannot just take 1 YouTube course in Swift and call yourself an experienced mobile developer 🤣🤣🤣🤣🤣 Joker
ChatGPT summarized it as
Summary: The commenter expresses frustration and disbelief regarding the expertise of the writer in coding and technology. They highlight perceived mistakes in the information provided, specifically mentioning the statement about backend developers and hardware. They assert their own success and experience in the field, attributing it to hard work over the past 20 years. The commenter criticizes the idea of acquiring expertise through a single YouTube course and accuses the writer of being lazy and complaining about job opportunities.
There is no need to “tell” ChatGPT to make the summary more constructive and less rude — it already does this implicitly.
ChatGPT is almost there. The comment is not accusing the writer of “complaining about job opportunities.” I have yet to meet someone who complains about job opportunities.
The point has been welded into the ground, but I did not write “backend developers works closely with hardware.” I wrote that “backend developers CAN work closely with hardware,” which is essentially still wrong. “Backend developer” typically means “server-side web developer,” though I suppose to win the argument I COULD argue that maybe the backend developer is programming a website that you use to control IoT devices. I would be even more off base at that point, but in the resulting confusion I could run from my opponent.
Then I could go outside, get some fresh air, and finally be free from these stupid Medium comments.