Public Perception of ChatGPT and Transfer Learning for Tweets Sentiment Analysis Using Wolfram Mathematica
Abstract
:1. Introduction
2. Related Works
2.1. Tweets Analytics and Topic Modeling
2.2. Deep Learning for Tweets Sentiment Analysis
3. Public Perception of ChatGPT on Twitter
3.1. Research Objectives and Questions
- The dynamics and trends related to discussions involving ChatGPT;
- The nature and characteristics of the content in these discussions;
- The primary topics and sentiments prevalent in conversations about ChatGPT on Twitter.
- RQ1: How have the trends in the number of tweets mentioning ChatGPT evolved over the studied time span?
- RQ2: What are the overall characteristics of the content of tweets mentioning ChatGPT?
- RQ3: What are the main topics that are being discussed about ChatGPT on Twitter?
3.2. Method
3.2.1. Data Source
- date: date of the tweet post;
- id: a unique identifier of the tweet;
- content: actual tweet content;
- username: username of the Twitter user;
- like_count and retweet count: like and retweet counts for that tweet.
3.2.2. Data Pre-Processing
3.2.3. Tweets Exploration
3.2.4. Topic Classification and Modeling
- This classifier attempts to infer the topic of a text;
- This classifier has been trained on Facebook posts but can be used for other texts as well;
- The input text should typically be one or a few sentences;
- The current version only works for the English language.
3.3. Result and Discussion
3.3.1. Temporal Trend of Tweet Counts
- 7 February 2023: the unveiling of Google’s AI chatbot, Bard, marked its entry as a contender against ChatGPT;
- 8 February 2023: this date witnessed three significant developments:
- Alibaba Group announced its intent to develop an AI chatbot to challenge OpenAI’s ChatGPT;
- A study explored ChatGPT’s proficiency at generating academic content capable of evading anti-plagiarism tools;
- Another research introduced a framework for evaluating language learning models (LLMs) like ChatGPT, employing public datasets. ChatGPT’s performance on 23 datasets spanning eight distinct NLP tasks revealed strengths and limitations, including issues with reasoning accuracy and hallucinatory outputs.
- 15 March 2023: OpenAI made headlines with the release of its advanced language model, GPT-4;
- 17 March 2023: following the GPT-4 release, OpenAI’s CEO, Sam Altman, appeared on ABC News, outlining AI’s transformative potential and emphasizing the associated risks;
- 24 March 2023: OpenAI announced a feature for ChatGPT to integrate plugins, facilitating real-time information retrieval, calculations, and third-party interactions, all within a safety-centric framework.
3.3.2. Analysis of Topic Classification and LDA Topic Modeling
4. Topic Classification of Tweets through the Integrative Use of GloVe, LDA, and KNN
4.1. LDA and Jensen–Shannon Distance Calculation
- α and β: Dirichlet prior parameters, typically assumed to be symmetric and utilized in default values;
- K: the number of topics to be identified.
4.2. GloVe Embedding and Cosine Similarity Calculation
- The dot symbol (·) represents the dot product of two vectors
- and represent the magnitude of the vectors and , respectively.
4.3. Combining Similarity Metrics and KNN Clustering
- Initialization: select k initial centroids, where k is the predetermined number of clusters;
- Assignment step: assign each tweet to the cluster with the nearest centroid, employing to compute similarity/distance:
- Update step: update the centroids by computing the mean vector of all tweet vectors within each cluster;
- Convergence check: evaluate if the centroids have shifted. If the centroids remain unaltered or the shift is below a predetermined threshold, proceed to the next step, else return to the assignment step;
- Result retrieval: final clusters C are obtained and can be further analyzed for topical insights.
4.4. Experiments and Discussion
4.4.1. Data Source
4.4.2. Perplexity Test
4.4.3. Algorithm Validation
5. Tweets Sentiment Analysis Based on Transfer Learning
5.1. Research Questions
- RQ4. How effective is the use of Wolfram Mathematica’s built-in classifier for the sentiment analysis of tweets?
- RQ5. How can pre-trained models in the Wolfram Neural Net Repository be leveraged for transfer learning to perform sentiment analysis on tweets?
5.2. Method
5.2.1. Data Source
- target: the polarity of the tweet (0 = negative, 4 = positive);
- ids: the id of the tweet (2087);
- date: the date of the tweet (Sat 16 May 23:58:44 UTC 2009);
- flag: the query (lyx). If there is no query, then this value is NO_QUERY;
- user: the user that tweeted (robotickilldozr);
- text: the text of the tweet (Lyx is cool).
5.2.2. Base Line: Built-in Classifier
5.2.3. Comparative Analysis with Existing Sentiment Analysis Tools
5.2.4. Transfer Learning Based on Wolfram Neural Net Repository
- GloVe + LSTM
- GloVe embedding layer: converts tokens to dense vectors representing words;
- Dropout layer: mitigates overfitting by randomly setting a fraction of input units to 0 at each update during training;
- LSTM layer: processes sequential data, capturing long-term dependencies between words;
- Sequence last layer: extracts the relevant features from the output sequence;
- Linear layer: performs linear transformations to the extracted features;
- Softmax layer: converts model outputs to probability distributions for each class.
- ConceptNet + LSTM
- ConceptNet embedding layer: transforms tokens to dense vectors using the enriched representations from ConceptNet;
- Dropout layer: acts as a regularization mechanism, reducing the likelihood of overfitting by randomly zeroing a fraction of the input units during training;
- LSTM layer: addresses the sequence processing, making sense of the order and context of words in the text;
- Sequence last layer: extracts the significant features from the sequence produced by the LSTM layer;
- Linear layer: applies linear transformations to the features for mapping to the output space;
- Softmax layer: converts the model’s raw outputs into probabilities, indicating the likelihood of each class.
- Fine-Tuning BERT
- BERT embedding layer: transforms text into sequences of high-dimensional vectors utilizing the pre-trained BERT representations;
- Dropout layer: implements regularization by randomly setting a subset of input units to zero at each update during training time to prevent overfitting;
- Linear layer: applies linear transformation to the input data for mapping to the output space;
- Aggregation layer: utilized to convert an array with spatial dimensions into a fixed-size vector representation, crucial for classifying sequences of subword embeddings using a max pooling strategy;
- Softmax layer: normalizes the raw output values from the model, producing a probability distribution over the classes.
- Fine-Tuning ELMo
- ELMo embedding layer: utilizes the pre-trained ELMo representations to convert tokens into contextual word-embedding vectors;
- Dropout layer: introduces regularization by randomly deactivating certain neurons during training to mitigate the risk of overfitting;
- Linear layer: executes linear transformations to map the obtained features to the desired output space;
- Aggregation layer: converts spatial arrays into a unified vector representation, crucial for the classification of sequences of subword embeddings using a max pooling strategy;
- Softmax layer: normalizes the model outputs to represent probabilities, facilitating the identification of the most likely class.
5.2.5. Sentiment Analysis of the Tweets Dataset Related to ChatGPT
5.3. Result and Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Aljanabi, M. ChatGPT: Future Directions and Open possibilities. Mesopotamian J. Cybersecur. 2023, 2023, 16–17. [Google Scholar] [CrossRef]
- Dida, H.A.; Chakravarthy, D.S.K.; Rabbi, F. ChatGPT and Big Data: Enhancing Text-to-Speech Conversion. Mesopotamian J. Big Data 2023, 2023, 31–35. [Google Scholar] [CrossRef]
- Bian, J.; Yoshigoe, K.; Hicks, A.; Yuan, J.; He, Z.; Xie, M.; Guo, Y.; Prosperi, M.; Salloum, R.; Modave, F. Mining twitter to assess the public perception of the “internet of things”. PLoS ONE 2016, 11, e0158450. [Google Scholar] [CrossRef]
- Guo, J.; Radloff, C.L.; Wawrzynski, S.E.; Cloyes, K.G. Mining twitter to explore the emergence of COVID-19 symptoms. Public Health Nurs. 2020, 37, 934–940. [Google Scholar] [CrossRef] [PubMed]
- Bian, J.; Topaloglu, U.; Yu, F. Towards large-scale twitter mining for drug-related adverse events. In Proceedings of the 2012 International Workshop on Smart Health and Wellbeing, Maui, HI, USA, 29 October 2012; pp. 25–32. [Google Scholar]
- Zucco, C.; Calabrese, B.; Agapito, G.; Guzzi, P.; Cannataro, M. Sentiment analysis for mining texts and social networks data: Methods and tools. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2010, 10, e1333. [Google Scholar] [CrossRef]
- Rambocas, M.; Pacheco, B. Online sentiment analysis in marketing research: A review. J. Res. Interact. Marketing 2018, 12, 146–163. [Google Scholar] [CrossRef]
- Haque, M.U.; Dharmadasa, I.; Sworna, Z.T.; Rajapakse, R.N.; Ahmad, H. I think this is the most disruptive technology: Exploring sentiments of chatgpt early adopters using twitter data. arXiv 2022, arXiv:2212.05856. [Google Scholar]
- Abdullah, M.; Madain, A.; Jararweh, Y. Chatgpt: Fundamentals, applications and social impacts. In Proceedings of the 2022 Ninth International Conference on Social Networks Analysis, Management and Security (SNAMS), IEEE, Milan, Italy, 29 November 2022–1 December 2022; pp. 1–8. [Google Scholar]
- Dwivedi, Y.K.; Kshetri, N.; Hughes, L.; Slade, E.L.; Jeyaraj, A.; Kar, A.K.; Baabdullah, A.M.; Koohang, A.; Raghavan, V.; Ahuja, M.; et al. “So what if chatgpt wrote it?” multidisciplinary perspectives on opportunities, challenges and implications of generative conversational ai for research, practice and policy. Int. J. Inf. Manag. 2023, 71, 102642. [Google Scholar] [CrossRef]
- Taecharungroj, V. “What can chatgpt do?” analyzing early reactions to the innovative ai chatbot on twitter. Big Data Cogn. Comput. 2023, 7, 35. [Google Scholar] [CrossRef]
- Aljabri, M.; Chrouf, S.M.B.; Alzahrani, N.A.; Alghamdi, L.; Alfehaid, R.; Alqarawi, R.; Alhuthayfi, J.; Alduhailan, N. Sentiment Analysis of Arabic Tweets Regarding Distance Learning in Saudi Arabia during the COVID-19 Pandemic. Sensors 2021, 21, 5431. [Google Scholar] [CrossRef]
- Mujahid, M.; Lee, E.; Rustam, F.; Washington, P.B.; Ullah, S.; Reshi, A.A.; Ashraf, I. Sentiment Analysis and Topic Modeling on Tweets about Online Education during COVID-19. Appl. Sci. 2021, 11, 8438. [Google Scholar] [CrossRef]
- Roe, C.; Lowe, M.; Williams, B.; Miller, C. Public Perception of SARS-CoV-2 Vaccinations on Social Media: Questionnaire and Sentiment Analysis. Int. J. Environ. Res. Public Health 2021, 18, 13028. [Google Scholar] [CrossRef] [PubMed]
- Macrohon, J.J.E.; Villavicencio, C.N.; Inbaraj, X.A.; Jeng, J.-H. A Semi-Supervised Approach to Sentiment Analysis of Tweets during the 2022 Philippine Presidential Election. Information 2022, 13, 484. [Google Scholar] [CrossRef]
- Saif, H.; He, Y.; Alani, H. Semantic sentiment analysis of twitter. In Proceedings of the Semantic Web-ISWC, Boston, MA, USA, 11–15 November 2012; pp. 508–524. [Google Scholar]
- Kiritchenko, S.; Zhu, X.; Mohammad, S.M. Sentiment Analysis of Short Informal Texts. J. Artif. Intell. Res. 2014, 50, 723–762. [Google Scholar] [CrossRef]
- Da Silva, N.F.; Hruschka, E.R.; Hruschka, E.R., Jr. Tweet sentiment analysis with classifier ensembles. Decis. Support Syst. 2014, 66, 170–179. [Google Scholar] [CrossRef]
- Thelwall, M.; Buckley, K.; Paltoglou, G. Sentiment strength detection for the social web. J. Am. Soc. Inf. Sci. Technol. 2012, 63, 163–173. [Google Scholar] [CrossRef]
- Paltoglou, G.; Thelwall, M. Twitter, MySpace, Digg: Unsupervised sentiment analysis in social media. ACM Trans. Intell. Syst. Technol. 2012, 3, 1–19. [Google Scholar] [CrossRef]
- Kalchbrenner, N.; Grefenstette, E.; Blunsom, P. A convolutional neural network for modelling sentences. In Proceedings of the 52nd Annual Meeting Association for Computational Linguistics, Baltimore, MD, USA, 22–27 June 2014; Volume 1, pp. 655–666. [Google Scholar]
- Dos Santos, C.; Gatti, M. Deep convolutional neural networks for sentiment analysis of short texts. In Proceedings of the 25th International Conference on Computational Linguistics: Technical Papers, Dublin, Ireland, 23–29 August 2014; pp. 69–78. [Google Scholar]
- Kim, Y. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Quatar, 25–29 October 2014; pp. 1746–1751. [Google Scholar]
- Zhang, Y.; Roller, S.; Wallace, B.C.; Knight, K.; Nenkova, A.; Rambow, O. MGNC-CNN: A simple approach to exploiting multiple word embeddings for sentence classification. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, CA, USA, 12–17 June 2016; Association for Computational Linguistics (ACL): Stroudsburg, PA, USA, 2016; pp. 1522–1527. [Google Scholar]
- Ansari, K. Cracking the ChatGPT Code: A Deep Dive into 500,000 Tweets Using Advanced NLP Techniques. Available online: https://medium.com/@ka2612/the-chatgpt-phenomenon-unraveling-insights-from-500-000-tweets-using-nlp-8ec0ad8ffd37 (accessed on 6 August 2023).
- Chen, B.; Chen, X. MAUIL: Multilevel attribute embedding for semisupervised user identity linkage. Inf. Sci. 2022, 593, 527–545. [Google Scholar] [CrossRef]
- Kim, S.W.; Gil, J.M. Research Paper Classification Systems Based on TF-IDF and LDA Schemes. Hum. Centric Comput. Inf. Sci. 2019, 9, 30. [Google Scholar] [CrossRef]
- Shaopeng, W.; Yan, P.; Jie, W. Application Research of Text Clustering Based on LDA in Online Public Opinion Analysis. J. Shandong Univ. Sci. Ed. 2014, 49, 129–134. (In Chinese) [Google Scholar]
- Kim, S.; Park, H.; Lee, J. Word2vec-based Latent Semantic Analysis (W2V-LSA) for Topic Modeling: A Study on Blockchain Technology Trend Analysis. Expert Syst. Appl. 2020, 152, 113401. [Google Scholar] [CrossRef]
- Hengyi, Z.; Chenglin, L.; Tianzhu, L. A Topic Detection Method for Online Long Text. J. Eng. Sci. 2019, 41, 1208–1214. (In Chinese) [Google Scholar]
- Shaohua, L.; Weijiang, L.; Zhengtao, Y. Research on Weibo Topic Detection Based on GV-LDA. Softw. Guide 2018, 17, 131–135. (In Chinese) [Google Scholar]
- Available online: https://alt.qcri.org/semeval2016/task6/ (accessed on 21 August 2023).
- Go, A.; Bhayani, R.; Huang, L. Twitter Sentiment Classification Using Distant Supervision; CS224N Project Report; Stanford University: Stanford, CA, USA, 2009. [Google Scholar]
- Pennebaker, J.W.; Francis, M.E.; Booth, R.J. Linguistic inquiry and word count: LIWC 2001. Mahway Lawrence Erlbaum Assoc. 2001, 71, 2001. [Google Scholar]
- Padmaja, S.; Fatima, S.S.; Bandu, S. Evaluating sentiment analysis methods and identifying scope of negation in newspaper articles. Int. J. Adv. Res. Artif. Intell. 2014, 3, 1–58. [Google Scholar] [CrossRef]
- Alessia, D.; Ferri, F.; Grifoni, P.; Guzzo, T. Approaches, tools, and applications for sentiment analysis implementation. Int. J. Comput. Appl. 2015, 125, 26–33. [Google Scholar]
- Bonta, V.; Janardhan, N.K.N. A Comprehensive Study on Lexicon Based Approaches for Sentiment Analysis. Asian J. Comput. Sci. Technol. 2019, 8, 1–6. [Google Scholar] [CrossRef]
- Pang, B.; Lee, L.; Vaithyanathan, S. Thumbs up? Sentiment classification using machine learning techniques. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, Stroudsburg, PA, USA, 6 July 2002; pp. 79–86. [Google Scholar]
- Rao, G.; Huang, W.; Feng, Z.; Cong, Q. LSTM with sentence representations for document-level sentiment classification. Neurocomputing 2018, 308, 49–57. [Google Scholar] [CrossRef]
- Le, G.M.; Radcliffe, K.; Lyles, C.; Lyson, H.C.; Wallace, B.; Sawaya, G.; Pasick, R.; Centola, D.; Sarkar, U. Perceptions of cervical cancer prevention on Twitter uncovered by different sampling strategies. PLoS ONE 2019, 14, e0211931. [Google Scholar] [CrossRef]
- Heaton, J.; Goodfellow, I.; Bengio, Y.; Courville, A. Deep learning. Genet. Program. Evolvable Mach. 2017, 19, 305–307. [Google Scholar] [CrossRef]
- Weiss, K.; Khoshgoftaar, T.M.; Wang, D. A survey of transfer learning. J. Big Data 2016, 3, 1817. [Google Scholar] [CrossRef]
- Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA, 2–7 June 2019; Volume 1, pp. 4171–4186. [Google Scholar]
- Howard, J.; Ruder, S. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, Melbourne, Australia, 15–20 July 2018; Association for Computational Linguistics (ACL): Stroudsburg, PA, USA, 2018; pp. 328–339. [Google Scholar]
- Prottasha, N.J.; Sami, A.A.; Kowsher, M.; Murad, S.A.; Bairagi, A.K.; Masud, M.; Baz, M. Transfer Learning for Sentiment Analysis Using BERT Based Supervised Fine-Tuning. Sensors 2022, 22, 4157. [Google Scholar] [CrossRef] [PubMed]
Topic Classification of Tweets with Built-in Classifier | LDA Topic Modeling of Tweets Using External Python Evaluation |
---|---|
|
|
Classify- “Sentiment” | Classify-ML- Markov | GloVe-LSTM | ConceptNet-LSTM | FT-BERT | FT-ELMo | |
---|---|---|---|---|---|---|
Accuracy | 56.0 | 74.2 ± 0.4 | 81.1 | 76.7 | 80.3 | 75.6 |
Precision | - | - | 81.1 | 76.7 | 80.4 | 76.5 |
Recall | - | - | 81.1 | 76.7 | 80.3 | 75.7 |
F1 Scores | - | - | 81.1 | 76.7 | 80.3 | 75.5 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Su, Y.; Kabala, Z.J. Public Perception of ChatGPT and Transfer Learning for Tweets Sentiment Analysis Using Wolfram Mathematica. Data 2023, 8, 180. https://doi.org/10.3390/data8120180
Su Y, Kabala ZJ. Public Perception of ChatGPT and Transfer Learning for Tweets Sentiment Analysis Using Wolfram Mathematica. Data. 2023; 8(12):180. https://doi.org/10.3390/data8120180
Chicago/Turabian StyleSu, Yankang, and Zbigniew J. Kabala. 2023. "Public Perception of ChatGPT and Transfer Learning for Tweets Sentiment Analysis Using Wolfram Mathematica" Data 8, no. 12: 180. https://doi.org/10.3390/data8120180
APA StyleSu, Y., & Kabala, Z. J. (2023). Public Perception of ChatGPT and Transfer Learning for Tweets Sentiment Analysis Using Wolfram Mathematica. Data, 8(12), 180. https://doi.org/10.3390/data8120180