Utilizing Large Language Models for Text Analysis

Thesis title: Využití velkých jazykových modelů pro analýzu textu
Author: Pumrová, Nikol
Thesis type: Bakalářská práce
Supervisor: Kliegr, Tomáš
Opponents: Sýkora, Lukáš
Thesis language: Česky
Abstract:
Bakalářská práce se zabývá využitím velkých jazykových modelů pro analýzu textu. V práci byla vytvořena a otestována sada tří promptů pro velký jazykový model Llama 3.1 8B, které umožňují vyhodnotit znaky manipulace, posoudit dodržování etických zásad a identifikovat emoce v textu. V práci jsou teoreticky vymezeny pojmy manipulace, etické zásady, emoce a s nimi spojená expresivita, dále jsou popsány současné přístupy k jejich detekci pomocí LLMs. Následně je shrnuto, jak probíhal proces návrhu promptů. Funkčnost promptů byla otestována na vybraných datasetech (MentalManip, Hate Speech and Offensive Language, Emotions) s hlavním modelem Llama 3.1 8B. Bylo také provedeno testování kompatibility promptů s modely GPT-4o, Gemini 2.0 Flash a Claude 3.7 Sonnet na menším vzorku dat. Výsledky testování ukázaly, že model na základě promptu pro detekci manipulace správně identifikoval většinu manipulativních textů (úplnost 92,31 %), ale docházelo k častému chybnému označování nemanipulativních textů jako manipulativních. S tímto problémem se setkali i autoři jiných studií. Prompt pro detekci nenávistných projevů dosáhl celkové přesnosti klasifikace 86,5 %. Model Llama 3.1 8B v kombinaci s promptem pro detekci emocí detekoval v testovacích datech 172 hlavních a 202 vedlejších emocí. V seznamu detekovaných emocí převažovaly negativní emoce. Celková přesnost klasifikace při použití kategorií emocí z datasetu byla nízká (47,77 %). Prompt je vhodné využívat v situacích, kdy není požadována přesná klasifikace do předem definovaných kategorií. Je důležité zdůraznit, že LLMs mají sloužit pouze jako nástroj a konečné vyhodnocení a odpovědnost leží na uživateli.
Keywords: prompt engineering; nenávistné projevy; Llama 3.1; manipulace; velké jazykové modely; emoce
Thesis title: Utilizing Large Language Models for Text Analysis
Author: Pumrová, Nikol
Thesis type: Bachelor thesis
Supervisor: Kliegr, Tomáš
Opponents: Sýkora, Lukáš
Thesis language: Česky
Abstract:
This bachelor's thesis focuses on the use of large language models for text analysis. A set of three prompts was developed in the thesis to evaluate signs of manipulation, assess adherence to ethical principles, and identify emotions in text. The thesis provides a theoretical definition of the concepts of manipulation, ethical principles, emotions, and the related expressivity, and describes current approaches to their detection using LLMs. The functionality of the prompts was tested on selected datasets (MentalManip, Hate Speech and Offensive Language, Emotions) using the primary model Llama 3.1 8B. Compatibility testing of the prompts was also conducted on a smaller data sample with the models GPT-4o, Gemini 2.0 Flash, and Claude 3.7 Sonnet. The results of testing showed that the model, when using the prompt for manipulation detection, correctly identified most manipulative texts (recall 92,31%), but frequently misclassified non-manipulative texts as manipulative. This issue has also been reported by other researchers. The prompt for hate speech detection achieved an overall classification accuracy of 86,5%. The Llama 3.1 8B model, in combination with the emotion detection prompt, identified 172 primary and 202 secondary emotions in the test data. Negative emotions prevailed in the list of detected emotions. The overall classification accuracy when using emotion categories from the dataset was low (47,77%). The prompt is best used in situations where precise classification into predefined categories is not required. It is important to emphasize that LLMs should serve only as a tool, and the final evaluation and responsibility rest with the user.
Keywords: large language models; prompt engineering; Llama 3.1; manipulation; hate speech; emotions

Information about study

Study programme: Aplikovaná informatika
Type of study programme: Bakalářský studijní program
Assigned degree: Bc.
Institutions assigning academic degree: Vysoká škola ekonomická v Praze
Faculty: Faculty of Informatics and Statistics
Department: Department of Information and Knowledge Engineering

Information on submission and defense

Date of assignment: 27. 1. 2025
Date of submission: 11. 5. 2025
Date of defense: 2025

Files for download

The files will be available after the defense of the thesis.

    Last update: