International Journal of Computer Science Languages Original Research

Understanding Sentiment Trends Through Zero-Shot and Few-Shot Learning Models

  1. Kinjal Doshi Department of Computer Science, Atmiya University Rajkot
  2. Falguni Parsana Department of Computer Science, Atmiya University Rajkot

Abstract

The requirement for large, manually labeled datasets is one of the main barriers to applying sentiment analysis algorithms in specialized or rapidly evolving disciplines in the present natural language processing (NLP) landscape. This work investigates a paradigm shift from traditional fully supervised learning to data-efficient methods, specifically zero-shot learning (ZSL) and few-shot learning (FSL). This study uses the advanced capabilities of instruction-tuned large language models (LLMs), like GPT-4, to assess the ability to classify emotions in a variety of language settings with little to no task-specific training data. The project mixes benchmark datasets like SST-2 with specialty domain sets like hospital evaluations and financial tweets to evaluate performance stability and domain generalizability. According to our experimental results, highly supervised models like Bidirectional Encoder Representations from Transformers (BERT) obtain great accuracy (93.2%), whereas the GPT-4 few-shot model achieves a competitive 92.8% accuracy utilizing just 1% of the labeled training data. This is a significant resource allocation optimization that reduces both the amount of human labor required for annotation and the computational overhead of fine-tuning the model. The study then does a comprehensive error analysis, indicating persistent challenges in language complexity, such as recognizing sarcasm and understanding domain-specific jargon. By addressing context ambiguity and data imbalance through purposeful prompt engineering and in-context learning (ICL), this work provides a comprehensive method for performing high-performance sentiment analysis in resource-constrained contexts. The results show that the marginal usefulness of more labeled data rapidly drops at the few-shot barrier, making FSL the most practicable technical and cost-effective method for modern enterprise-level sentiment monitoring.

Keywords

References (15)

  1. Pang B, Lee L, Vaithyanathan S. Thumbs up? sentiment classification using machine learning techniques [Preprint]. 2002. arXiv:cs/0205070. doi:10.48550/arXiv.cs/0205070.
  2. Brown TB, Mann B, Ryder N, Subbiah M, Kaplan J, Dhariwal P, et al. Language models are few-shot learners. In: Proceedings of the 34th International Conference on Neural Information Processing Systems (NeurIPS 2020), Vancouver, BC, Canada. Red Hook (NY): Curran Associates Inc.; 2020. Article No.: 159. p. 1877–1901.
  3. Adusumalli S, Lee H, Hoi Q, Koo SL, Tan IB, Ng PC. Assessment of Web-Based Consumer Reviews as a Resource for Drug Performance. Journal of Medical Internet Research. 2015;17(8):e211. doi:10.2196/jmir.4396
  4. Ramesh G, Sahil M, Palan SA, Bhandary D, Ashok TA, Shreyas J, et al. A review on NLP zero-shot and few-shot learning: methods and applications. Discover Applied Sciences. 2025;7(9). doi:10.1007/s42452-025-07225-5
  5. Yu Y, Zhang D, Li S. Unified Multi-modal Pre-training for Few-shot Sentiment Analysis with Prompt-based Learning. Proceedings of the 30th ACM International Conference on Multimedia. 2022:189-198. doi:10.1145/3503161.3548306
  6. Niu C, Li C, Ng V, Luo B. CrossCodeBench: Benchmarking Cross-Task Generalization of Source Code Models. 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE). 2023:537-549. doi:10.1109/icse48619.2023.00055
  7. Min S, Lyu X, Holtzman A, Artetxe M, Lewis M, Hajishirzi H, et al. Rethinking the role of demonstrations: what makes in-context learning work? [Preprint]. 2022 Feb 25. arXiv:2202.12837. doi:10.48550/arXiv.2202.12837.
  8. Song R, Li Y, Shi L, Giunchiglia F, Xu H. Shortcut learning in in-context learning: a survey [Preprint]. 2024 Nov 4. arXiv:2411.02018. doi:10.48550/arXiv.2411.02018.
  9. Zhou Y, Xu A, Zhou Y, Singh J, Gui J, Joty S. Variation in verification: understanding verification dynamics in large language models [Preprint]. 2025 Sep 22. arXiv:2509.17995. doi:10.48550/arXiv.2509.17995.
  10. Liu H, Tam D, Muqeeth M, Mohta J, Huang T, Bansal M, et al. Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. Adv Neural Inf Process Syst. 2022;35:1950–1965.
  11. Yong G, Jeon K, Gil D, Lee G. Prompt engineering for zero‐shot and few‐shot defect detection and classification using a visual‐language pretrained model. Computer-Aided Civil and Infrastructure Engineering. 2023;38(11):1536-1554. doi:10.1111/mice.12954
  12. Zhang W, Deng Y, Liu B, Pan S, Bing L. Sentiment Analysis in the Era of Large Language Models: A Reality Check. Findings of the Association for Computational Linguistics: NAACL 2024. 2024:3881-3906. doi:10.18653/v1/2024.findings-naacl.246
  13. Vamvakas D, Papaioannou I, Tsaknakis C, Sgouros T, Korkas C. Generative AI for Sustainable Smart Environments: A Review of Energy Systems, Buildings, and User-Centric Decision-Making. Energies. 2025;18(23):6163. doi:10.3390/en18236163
  14. Song Y, Wang T, Cai P, Mondal SK, Sahoo JP. A Comprehensive Survey of Few-shot Learning: Evolution, Applications, Challenges, and Opportunities. ACM Computing Surveys. 2023;55(13s):1-40. doi:10.1145/3582688
  15. Kamath U, Keenan K, Somers G, Sorenson S. Prompt-based Learning. Large Language Models: A Deep Dive. 2024:83-133. doi:10.1007/978-3-031-65647-7_3