# Enhancing Imbalanced Sentiment Analysis: A GPT-3-Based Sentence-by-Sentence Generation Approach
## 6 Discussion  
In this study, we focused on enhancing the performance of sentiment classification by balancing minority classes using synthetic data generated by the GPT-3 model through the sentence-by-sentence data generation technique. This research builds upon our previous study [11], which utilized the fine-tuning technique of the GPT-3 model for generating synthetic data. We explored another technique for generating synthetic data, namely, the prompting method, specifically the sentence-by-sentence generation technique. This study defined the criteria for good synthetic data used for balancing to improve the classification performance as data that exhibit good novelty and diversity while maintaining coherence with the original data. In our experiment, we identified several limitations in GPT-3's ability to generate synthetic course reviews using sentence-by-sentence generation. We observed that the model often produces outputs that are closely similar to the original input reference data and a high degree of duplications among outputs. This tendency results in the generated data lacking in diversity and novelty, which is a crucial aspect considering our objective of creating novel and diverse data that remain contextually relevant. While GPT-3's ability to closely mirror input data can be advantageous for certain applications, it poses a significant challenge in scenarios where the uniqueness of and variation in outputs are important. These findings underscore the need for further refinement in using GPT-3 for synthetic data generation, particularly in enhancing the diversity and novelty of the outputs without compromising their relevance and coherence. Alongside these limitations, a significant challenge we encountered in using GPT-3 is determining the appropriate parameters, particularly the temperature setting and the design of prompts, to guide the model in generating text that aligns with our specific requirements. The temperature parameter, which controls the randomness of the output, requires careful tuning to balance creativity and coherence. Similarly, crafting effective prompts is crucial, as they significantly influence the model's output. These challenges highlight the intricacies involved in parameter optimization to ensure that GPT-3 generates text that is not only diverse and novel but also contextually appropriate and aligned with our research objectives. For sentiment classification, our findings show that sentence-by-sentence generation generally enhances imbalanced sentiment classification, as is evident from the improvements in accuracy and F1-score metrics across all datasets generated by this technique compared to the original imbalanced dataset, with increases of around 5 to 25 percent for the five deep-learning models tested. Comparatively, our approach demonstrates certain advantages over other studies, such as the one conducted by [PERSON] et al. [22], which also used Coursera review data but with a GAN-based model. Our study diverges from theirs in crucial aspects, such as preprocessing techniques, data splitting for classification, and the use of different embedding methods. Specifically, we implemented GloVe embeddings for a range of models, including RNN, CNN, LSTM, BiLSTM, and GRU, whereas [PERSON] et al. [22] focused on models like regular RNN, BiLSTM (Glove), BiLSTM (FastText), BiLSTM (BERT), and GRU (BERT). Our results indicate the higher accuracy of balanced datasets for RNN, BiLSTM, and GRU models compared to those reported in [22]. This suggests that not only the choice of the model and architecture but also the methodology of synthetic data generation plays a pivotal role in achieving higher accuracy in sentiment analysis. Moreover, the choice of GPT-3 for generating synthetic data, as opposed to the GAN model used by [PERSON] et al. [22] presents a significant strategic advantage. GPT-3, being one of the latest and largest language models available, offers enhanced capabilities in generating diverse and contextually rich synthetic data.