Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Utvärdering av en svensk domänspecifik chatbot baserad på svensk språkmodell och Retrieval-Augmented Generation: En jämförelsestudie av GPT-SW3 med och utan RAG
Mid Sweden University, Faculty of Science, Technology and Media, Department of Computer and Electrical Engineering (2023-).
2026 (Swedish)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [sv]

Detta examensarbete behandlar utveckling och utvärdering av en svensk domänspecifik chatbot för frågebesvarande över öppna svenska dokument inom konsumenträtt. Syftet var att undersöka hur ett språkmodellsbaserat system kan utformas för dokumentbaserat frågebesvarande samt hur svarskvaliteten påverkas när svarsgenereringen stöds av extern dokumentbaserad kontext. Studien genomfördes genom att utveckla en prototyp baserad på GPT-SW3 1.3B Instruct i två systemkonfigurationer. Den första konfigurationen genererade svar direkt från språkmodellen utan extern dokumenthämtning. Den andra använde Retrieval-Augmented Generation, där relevanta textsegment hämtades från en sökbar kunskapsbas och användes som kontext i prompten. Dokumenten rensades, delades upp i textsegment, omvandlades till embeddings och gjordes sökbara genom semantisk sökning. Utvärderingen omfattade 15 testfrågor och svaren bedömdes manuellt på en femgradig skala utifrån relevans, korrekthet och källförankring. Även svarstid mättes. Resultaten visade att RAG-konfigurationen gav högre genomsnittlig svarskvalitet än systemet utan RAG. Det sammanlagda genomsnittet för de tre kvalitetskriterierna ökade från 2,1 till 2,8 poäng. Relevansen ökade från 2,3 till 2,9, korrektheten från 1,9 till 2,9 och källförankringen från 2,1 till 2,7. Samtidigt ökade den genomsnittliga svarstiden från 19,8 till 29,4 sekunder. Slutsatsen är att RAG kan förbättra dokumentbaserat frågebesvarande i en svensk kontext, men att kvaliteten fortfarande beror på retrieval-steget, dokumentunderlaget och språkmodellens förmåga att tolka den hämtade kontexten.

Abstract [en]

This thesis concerns the development and evaluation of a Swedish domain-specific chatbot for question answering over open Swedish documents in the consumer law domain. The aim was to investigate how a language-model-based system can be designed for document-based question answering and how answer quality is affected when generation is supported by external document context. The study was conducted by developing a prototype based on GPT-SW3 1.3B Instruct in two system configurations. The first generated answers directly from the language model without external retrieval. The second used Retrieval-Augmented Generation, where relevant text segments were retrieved from a searchable knowledge base and used as context in the prompt. The documents were cleaned, divided into text segments, converted into embeddings and made searchable through semantic search. The evaluation included 15 test questions, and the answers were manually assessed on a five-point scale according to relevance, correctness and source grounding. Response time was also measured. The results showed that the RAG configuration achieved higher average answer quality than the system without RAG. The combined average score across the three quality criteria increased from 2.1 to 2.8 points. Relevance increased from 2.3 to 2.9, correctness from 1.9 to 2.9, and source grounding from 2.1 to 2.7. At the same time, the average response time increased from 19.8 to 29.4 seconds. The conclusion is that RAG can improve document-based question answering in a Swedish context, but quality still depends on retrieval, document coverage and the model’s ability to interpret the retrieved context.

Place, publisher, year, edition, pages
2026. , p. 66
Keywords [en]
Retrieval-Augmented Generation, Swedish language model, GPT-SW3, question answering, source grounding, consumer law.
Keywords [sv]
Retrieval-Augmented Generation, svensk språkmodell, GPT-SW3, frågebesvarande, källförankring, konsumenträtt.
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:miun:diva-58428Local ID: DT-V26-G3-022OAI: oai:DiVA.org:miun-58428DiVA, id: diva2:2094601
Subject / course
Computer Engineering DT1
Educational program
Computer Science TDATG 180 higher education credits
Supervisors
Examiners
Available from: 2026-08-24 Created: 2026-08-24 Last updated: 2026-08-24Bibliographically approved

Open Access in DiVA

fulltext(792 kB)1 downloads
File information
File name FULLTEXT01.pdfFile size 792 kBChecksum SHA-512
778c82b166181b9ede38722ae47b97f5e1fe4def56ce1f2116ab2839fd7798d33aa0a0cf3e320c7d54eb4c532936901be3928e186f8ee82dc3277c2d7d78e956
Type fulltextMimetype application/pdf

Search in DiVA

By author/editor
Awoad, Hadi
By organisation
Department of Computer and Electrical Engineering (2023-)
Software Engineering

Search outside of DiVA

GoogleGoogle Scholar
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 4 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf