Back To Blog

Learn (Basic) Natural Language Processing (NLP) in 6 easy steps

Recently, I started the ‘Intro To NLP’ Course on the 365 Data Science platform. I’ve noticed the platform scrambling in recent months to introduce AI content after focusing almost exclusively on Data Science topics. Since the two are related, this wasn’t a bad thing, but glad to see it bringing in more high quality courses focusing exclusively on AI/LLM topics, and looking forward to seeing more.

The Intro to NLP consists of 7 sections of lessons with a Practical Task at the end of each section, then a section devoted to a whole project, finishing up with a ‘Future of NLP’ section before the Final Exam. So far it’s been a good course, about a subject I knew almost nothing about before I started, but which is central to LLM like Chat GPT and AI generally.

What is Natural Language Processing, or NLP? NLP is a technology that allows computers to understand, interpret and respond to human languages, both written and spoken. As it turns out, it has an astonishing number of uses, and was widely used in ways I never even thought about, even before the arrival of the LLMs:

  • Search engines: when we type a query into a search engine, NLP algorithms interpret our intent, understand the context, and deliver relevant search results. This involves processing the query, identifying key terms, and even understanding the context of our question.
  • Voice Assistants and Smart Home Devices: Devices like Amazon’s Alexa, Google Assistant, and Apple’s Siri use NLP to understand spoken commands. They can interpret our requests, respond to queries, control smart home devices, and even engage in casual conversation. Sort of.
  • Text Autocorrect and Predictive Text: The autocorrect and predictive text features on smartphones and other devices use NLP to understand the context of what we are typing, correct spelling errors, and predict the next word we might type. Sometimes this works, sometimes it doesn’t. I’ve sent many garbled text because of Autocorrect.
  • Language Translation Services: Online translation tools like Google Translate utilize NLP to convert text or spoken words from one language to another, understanding grammatical nuances and context to provide accurate translations.
  • Chatbots and Customer Service: Many websites and customer service platforms employ chatbots that use NLP to understand and respond to customer inquiries. These bots can handle a range of tasks from answering FAQs to helping with online shopping or troubleshooting. Next time you’re frustrated by some generic response from a chatbot and wish you were talking to an actual human – thank NLP.
  • Email Filtering: Email services use NLP to filter out spam or categorize emails into different folders (like social, promotions, primary). This is done by analyzing the content of the emails and identifying certain patterns or keywords. This has gotten dramatically better in recent years.
  • Social Media Feeds: NLP algorithms help in personalizing our social media feeds. They analyze our interactions, the content we engage with, and use this data to curate a feed that is supposedly tailored to our interests. I would say they mostly ruin them, but you get the idea.
  • Sentiment Analysis: Businesses use NLP for sentiment analysis to gauge public opinion about their products or services. By analyzing social media posts, reviews, and comments, they can understand customer satisfaction and general sentiment.
  • Content Recommendations: Streaming services like Netflix or Spotify use NLP to recommend movies, shows, or music based on our previous viewing or listening habits, search history, and preferences. I’ve found these to be mostly . . . if not quite useless, close to it.
  • Accessibility Tools: NLP aids in creating tools for individuals with disabilities, such as text-to-speech and speech-to-text applications, which allow users with visual or hearing impairments to interact with technology more effectively. Potentially very useful.
  • Educational Tools: NLP is used in educational software to aid in language learning, provide automated grading of essays, and even give feedback on writing style and grammar.
  • Resume Screening: In the hiring process, NLP is used to screen resumes and applications to identify the most suitable candidates by matching job requirements with the skills and experiences listed in the resumes. Another instance where we’d probably be better off without this. Ever wonder why you can’t get an interview? Thank some unknowable NLP algorithm.

But with the arrival of Chat GPT and the other LLMs a year ago, NLP really came into its own. Suddenly we were able to engage with a machine in a way eerily similar to how we interact with human beings. We can argue whether this, long term, a good thing, but seen purely as a technology, Chat GPT is amazing. Even with all its flaws, hallucinations, errors, the dubious practice of just scraping content without any permissions at all, and so on. Chat GPT and the other LLMs struggling to catch up, really are a leap ahead on a technological scale and NLP made them possible.

How is NLP used in the new Large Language Models?

  • Understanding Language: ChatGPT uses NLP to grasp the nuances of human language. When you type a sentence, NLP helps the model understand not just the words, but also the meaning and context behind them. This understanding is crucial for generating relevant and coherent responses.
  • Generating Text: Once ChatGPT understands our input, it uses its knowledge gained from NLP to construct a reply. NLP guides it in forming sentences that are not only grammatically correct but also contextually appropriate, maintaining a flow that resembles natural human conversation.
  • Learning from Large Datasets: ChatGPT has been trained on a vast array of text data. NLP is used to process and learn from this data, enabling the model to recognize patterns, understand various topics, and even mimic different writing styles.
  • Handling Different Tasks: Whether it’s answering questions, writing essays, or even creating ‘poetry’, ChatGPT uses NLP to tailor its responses to the specific task at hand. NLP provides the flexibility to switch between different types of language use, from formal to casual, technical to creative.
  • Continuous Learning: As ChatGPT interacts with users, it continually refines its understanding and use of language. NLP is key in this learning process, helping the model to adapt and improve over time based on new interactions and data.

In short, NLP is the ‘brain’ behind our LLM’s ability to communicate effectively with humans, using human language. It is what allows the model to understand our questions and respond in a way that is informative, engaging and eerily human-like.

So now we’re going to learn the basics of NLP and how to use it. First stop: Text Preparation.

Back To Blog

Introduction to Chat GPT for High School Teachers

Since the release of Chat GPT3 in late November, 2022, I’ve been wondering not just what impact it will have on everything from the job market to our media environment, but also how it can be used, both by myself and people I know. Since many people I know are teachers, including members of my family, education is as good as any a place to start.

What is Chat GPT?

Well, let’s ask Chat GPT itself:

ChatGPT is an advanced Artificial Intelligence (AI) model that uses Natural Language Processing (NLP) technology to understand and generate human-like responses to written text inputs. It is designed to respond to any input text by generating appropriate and contextually relevant responses, just like a human would in a conversation.

The technology behind ChatGPT is based on the GPT (Generative Pre-trained Transformer) architecture, which is a deep learning model that has been trained on massive amounts of text data from the internet. The GPT model learns to recognize patterns and relationships between words and phrases in the data, enabling it to generate coherent and contextually relevant responses to text inputs.

To create ChatGPT, OpenAI has trained the GPT architecture on an enormous amount of text data, including books, articles, and web pages, to ensure that it has a broad understanding of human language. This means that when you input text into ChatGPT, it can draw on its vast knowledge to generate a response that is both accurate and relevant to the input.

Open AI, the company behind Chat GPT, collected data from across the internet, and spent a year and a half training its incredibly powerful novel to match patterns in human speech. Unfortunately, since it took a year a half to train its LLM, Chat GPT’s knowledge stops, well, a year and a half ago. It CAN be coaxed, through careful prompting, into retrieve more recent information but for completely up to date information, you’ll have to look elsewhere. This is NOT true of Bing’s Chat, which can access the internet (and provides sources, which Chat GPT does not). However, despite this, I generally find Chat GPT a more powerful tool than either Bing or the recently released Google Bard.

When Chat GPT3 was first released, the immediate fear was that the technology would be used (or mis-used) not by teachers, but by students, since a simple prompt can solve problem sets and even generate whole essays. The style may be, well, robotic and sometimes flat-out wrong (GPT3 was known to ‘hallucinate’ – that is, to generate random nonsense when it couldn’t find an answer) but the fear was that many students would give up writing their own essays and just generate all their school assignments via AI. While this has happened, right from the beginning many teachers recognized its great potential as a learning tool:

Don’t Ban ChatGPT in Schools. Teach With It – NYT

To sign up for Chat GPT3, go to https://chat.openai.com/chat. GPT3 is free and only requires an email address. Note that during busiest times, availability may become limited, or drop out altogether. For that reason, when it became available a few weeks ago, I signed up for GPT Plus, which not only allows 24 hour access but immediate access to the recently released GPT4, which is a considerable improvement on GPT3, with considerably higher accuracy (especially in mathematics and programming) and more in-depth answers to general questions. For me, it’s worth paying $20 per month, but many will be satisfied with the free version.

So . . . how can teachers use Chat GPT to assist them in the classroom? Since I’m not a teacher, I turned once again to my new best friend Chat GPT4:

  1. Personalized Learning Experiences: Chat GPT can be an invaluable tool for creating personalized learning experiences for students. By inputting a student’s individual learning needs and preferences, teachers can use Chat GPT to generate tailored educational materials, including lesson plans, quizzes, and project ideas. This level of customization ensures that each student receives an education that is specifically catered to their unique strengths and weaknesses.
  2. Supplementing Lesson Plans: Teachers can use Chat GPT to supplement lesson plans by generating additional content and resources on a given topic. By providing a brief summary or key points of a lesson, Chat GPT can generate detailed explanations, examples, and practice problems. This can save teachers time and help them expand on topics that may be difficult for students to grasp fully.
  3. Real-Time Feedback and Grading Assistance: Chat GPT can be used to provide real-time feedback to students on their assignments and quizzes. By inputting a student’s response to a question or a written assignment, Chat GPT can generate feedback and suggestions for improvement. This immediate feedback can help students learn more effectively and allow teachers to focus on providing individualized attention and guidance.
  4. Tutoring and Homework Assistance: Outside of the classroom, Chat GPT can be utilized as a tutoring tool, offering guidance and assistance to students as they work through assignments or prepare for exams. By answering questions and providing explanations, Chat GPT can be a helpful resource for students who require additional support or clarification on a particular topic.
  5. Enhancing Classroom Discussions and Debates: Chat GPT can help facilitate engaging classroom discussions and debates by providing diverse perspectives on a given subject matter. Teachers can input discussion prompts or debate topics into Chat GPT, and the AI will generate thought-provoking arguments and counterarguments, encouraging students to think critically and engage in meaningful conversations.
  6. Encouraging Creativity and Originality: Chat GPT can be used to spark creativity and originality in student projects and writing assignments. By providing a prompt or topic, Chat GPT can generate a wide range of ideas and examples that students can draw inspiration from. This can help students break free from conventional thinking and explore new ideas and perspectives.

These are just a few examples. I could prompt again, and generate many more.

For teachers who do want to use Chat GPT, it’s important to have a basic idea of how it works. I might write a whole blog post about this, because it’s an important and surprisingly nuanced skill, but for now, it’s important to understand that because the LLM recognizes speech patterns, how you ask it a question is very important. For the above, I wrote:

Can you write me a blog post describing how high school teachers can use Chat GPT?

I could have written a much more detailed query, and received a much more detailed response. It’s also important to remember that, unlike a search engine, Chat GPT remembers ‘conversations’. so the process is iterative: you ask one question, then another, and Chat GPT will not only ‘remember’ the original question, but remember the answer it generated. Thus you can ask one question and drill down on the answer to get more detail, or receive an expanded answer and Chat GPT will, in a sense, be trained on the ‘conversation’ and tailor its responses appropriately. For example if I then ask:

Can you tell me more about ‘Real-Time Feedback and Grading Assistance’?

I’ll receive an even more detailed answer (I’ll just include the titles – Chat GPT can be verbose):

The use of Chat GPT for real-time feedback and grading assistance presents an opportunity for teachers to enhance the learning experience for their students while also reducing their workload. By harnessing the power of artificial intelligence, teachers can offer students immediate and personalized feedback on their work, helping them to learn more effectively and efficiently. Here’s a deeper look into how Chat GPT can provide real-time feedback and grading assistance:

  1. Instantaneous Feedback
  1. Consistent Evaluation Criteria
  1. Personalized Feedback for Individual Students
  1. Reducing Teacher Workload
  1. Continuous Learning and Improvement

It’s important to note that while Chat GPT can provide valuable real-time feedback and grading assistance, it should not completely replace the role of the teacher. Human interaction, empathy, and understanding are still essential components of a successful learning environment. Teachers should continue to monitor the feedback provided by Chat GPT to ensure its accuracy and relevance and supplement it with their insights and guidance as needed.

In this video Ted Pickett, himself a teacher, outlines the basics of creating a good prompt. He follows a four-step rule put out by an organization called ‘AI In Education’:

Use ARTS to help you craft efficient prompts

A udience: “This blog is from educators around the globe

R ole: “I want you to act as a title generator for the blog posts I am writing

T arget: “I will give you the topic and keywords from the article and you create five engaging titles

S pecific: “Keep the titles concise. Less than 15 words.

This is the whole video: From Ted Pickett’s ‘AI for the Classroom’ channel.

Ted Pickett’s ‘AI for the Classroom’ channel.

It’s also important to remember that the same response can produce somewhat different answers Since Chat GPT relies on pattern recognition, it will produce different answers for different users, and sometimes even variations on an answer for the same user with the same prompt. It also should not be seen as a replacement for human research: since it relies on information from the web, it can get things wrong (the so-called hallucinations).

Another useful Chat GPT function is its ability to summarize. Download the transcript of a video and Chat GPT will provide a summary. Chat GPT provided the following summary of the video below:

The video presents five ways teachers can use ChatGPT to enhance their teaching:

1) creating lesson sequences with student discussion questions,

2) designing well-being lessons,

3) providing feedback to students,

4) generating student reports,

5) crafting song lyrics for young learners.

The speaker emphasizes that AI tools like ChatGPT can help educators focus on the process and stages of student learning, rather than just the end product.

From Liam Bassett’s YT channel

What’s truly amazing is the speed at which this technology is evolving. Just a couple of months after the initial release of Chat GPT3 comes Chat GPT4, a significant improvement in both accuracy and depth of its responses. Then Microsoft included a somewhat dumbed-down version of Chat GPT4 in its Bing browser. Hundreds, even thousands of apps, built on the GPT API, are being released weekly. And soon, Open AI will allow the use of plugins which could revolutionize the technology even further, allowing for the customization of the core technology into every sphere imaginable, including (probably especially) education. Both Duolingo and Khan Academy have become early adopters (though Khan Academy is still in the testing phase – you can sign up to be on the waitlist for testers – I imagine teachers will get priority), using the chatbot as a sort of virtual tutors for their students.

What does the future hold? As with all technological change, it’s hard to know where this will end up, whether it will be a net benefit or loss. I think AI’s potential to help educators is very considerable indeed, but so is its capacity for misuse. For the time being, I think it’s up to everyone to learn how to use this properly – and to learn how to use it for good.

This is a vast and fast-growing field, so I’ll be posting more on the subject.