This paper presents a study on the use of the Chat Generative Pretrained Transformer (ChatGPT) in education. In this work, we propose a sentiment analysis model of tweets related to the use of the ChatGPT in education. The purpose of this research is to identify common sentiments, topics, and perspectives that are expressed towards ChatGPT in the education field based on the data collected from Twitter. Twitter was used to collect 11830 tweets about the use of ChatGPT in education. Topics and emotions expressed in the tweets were extracted using NLP algorithms and organized into distinct groups. Also, the most frequent words in the positive and negative opinion words are determined. The findings of the paper indicate that most tweets about ChatGPT are either positive or neutral, with a small percentage expressing negative sentiments. In addition, the study analyzes the sentiments expressed in tweets about the employment of ChatGPT in education using four different classifiers: Naive Bayes (NB), Support Vector Machine (SVM), K-Nearest Neighbors (KNN), and Random Forest (RF). According to the results, the SVM classifier has the highest accuracy of 81.4 percent.