Will AI replace humans??

Siddharth Murugan
3 min readMar 10, 2024

--

Explained with Sentimental analysis project using Express.js

Will AI replace humans??

“Will AI replace humans??” this has been a trending topic that has been going across in recent years. Let us do a demo to understand whether AI can replace humans. I have limited knowledge about the Express.js framework and today I am going to make use of ChatGPT (An AI assistant)to create a backend sentimental analysis project.

About ChatGPT

ChatGPT is an open source Artificial Intelligence tool which is capable of answering all our queries. It is a chatbot that can address all kinds of queries across different domains. Follow this link to explore more about it — click here

Why do we fear being replaced with AI?

All the topics should begin with the question “Why?”. We have this fear because computers have started to perform better than us and it is dynamically evolving. But there is no point in comparing ourselves with AI. Rather than competing with AI, let’s try to make use of it to upgrade ourselves. AI can add a crown to our skill set if we know how to handle it.

Fear during Initial Computer Era

When computers or machines were introduced, people had a fear of being replaced with computers or machines. New jobs were getting created with the introduction of computers and machines. Similarly, due to AI, we may lose some of our jobs but we will get new jobs in the market and upon up-skilling ourselves we will get through it. Once upon a time, people were traveling by a bullock cart, then auto-rickshaws, and then taxi. Similarly, AI is not going to eradicate jobs but it is going to change the way we work and create new jobs.

Why AI won’t replace humans for now?

I have only limited knowledge about express.js and now I am going to develop a project which does sentiment analysis upon passing a text. I logged into ChatGPT and simply queried “Write a sentiment analyzing javascript code in express js”. It gave me the following code with a detailed explanation on how to make it work.

const express = require('express');
const bodyParser = require('body-parser');
const sentiment = require('sentiment');

const app = express();

app.use(bodyParser.json());

app.post('/analyze', (req, res) => {
const text = req.body.text;

if (!text) {
return res.status(400).json({ error: 'Text field is required.' });
}

const result = sentiment(text);

res.json({ sentiment: result });
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
My chat with ChatGPT

I copy pasted the text and did as per the steps it has mentioned but unfortunately, the code didn’t work as there were mistakes in the code. I tried to fix the code by googling it and modified it as below,

const express = require('express')
const app = express()
const bodyParser = require('body-parser');
const Sentiment = require('sentiment');
const port = 3000

app.use(bodyParser.json());

app.post('/analyze', (req, res) => {

const text = req.body.text;
if (!text) {
return res.status(400).json({ error: 'Text field is required.' });
}
const sentiment = new Sentiment()
const result = sentiment.analyze(text);
console.log("Here is the result:"+result)
res.json({ sentiment: result });
})

app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})

Upon making the server up and hitting the URL, I was able to get the required output as below,

Snippet from API response

Conclusion

With the above example, you can see that like humans, AI also makes mistakes and it will take some more time for AI to be better than humans. But it will not destroy all the jobs but it will create new jobs. With AI added to our crown, we can become superhuman. Let’s upskill ourselves to be a superhuman.

--

--

Siddharth Murugan

Programmer who loves to do things creatively. #automationTester by profession #javascript #nodejs #reactjs