Title: | Métodos computacionais para detecção de incoerências em textos curtos |
Author: | Braz Júnior, Osmar de Oliveira |
Abstract: |
Incoerências ocasionam dificuldades na interpretação de discursos, comprometendo o desempenho de agentes conversacionais, tutores inteligentes, sistemas de Question Answering (QA) e até humanos em diálogos. Detectar e corrigir automaticamente palavras que causam incoerência semântica é um desafio, pois textos corretos ortográfica e gramaticalmente podem carecer de consistência. Embora existam diversos modelos para medir a coerência semântica, muitos se limitam a distinguir documentos originais de versões com sentenças permutadas aleatoriamente. Tais modelos têm limitações: não funcionam bem com textos curtos, não detectam incoerências semânticas, nem oferecem correções automáticas. Este trabalho investiga o uso de modelos de linguagem para identificar e tratar incoerências semânticas em textos curtos. Inicialmente, foi desenvolvido o CoheBERT (Coherence BERT) para avaliar um classificador BERT que distingue documentos originais daqueles com sentenças permutadas e medidas de (in)coerência calculadas a partir da (dis)similaridade dos embeddings de sentenças adjacentes. Posteriormente, reduzindo a granularidade, desenvolvemos o framework COHEWL (COHErence at Word Level) para analisar a coerência de palavras em textos curtos. Suas funcionalidades incluem a geração de dados contrastivos, substituindo palavras por outras sugeridas por humanos ou previstas pelo BERT Masked Language Model. Por fim, avaliamos o BERT e grandes modelos de linguagem (Large Language Models - LLMs) generativos no COHEWL para classificar e medir a coerência semântica, além de detectar e corrigir incoerências. Os experimentos utilizaram conjuntos de dados em português e inglês, incluindo CSTNews, SQuAD 2.0, FaQuAD, OnlineEduc 1.0 e CohQuAD, sendo os dois últimos montados neste doutorado. O classificador CoheBERT, baseado no BERT, obteve acurácia de até 99,20% na detecção de sentenças permutadas em textos jornalísticos e de um fórum de dúvidas de um ambiente virtual de aprendizagem. Já no COHEWL, o BERT alcançou 80% a 99,88% de acurácia na detecção de perguntas curtas típicas de QA com uma palavra alterada. Os LLMs como LLaMA, GPT, Gemini e Sabiá-3 superaram o BERT na classificação da coerência semântica em nosso corpus de perguntas curtas sobre estruturas de dados. LLMs também geraram medidas de coerência semântica de palavras mais alinhadas à percepção humana de coerência do que as derivadas de embeddings do BERT e foram capazes de corrigir palavras incoerentes com muito melhor desempenho. Abstract: Inconsistencies can lead to difficulties in interpreting discourse, compromising the performance of conversational agents, intelligent tutors, QA systems, and even humans in dialogue. Automatically detecting and correcting words that cause semantic incoherence is a challenge, as orthographically and grammatically correct texts may still lack consistency. Although several models exist for assessing textual coherence, many are limited to distinguishing original documents from versions with randomly permuted sentences. These models have limitations: they do not perform well with short texts, fail to detect semantic incoherence, and do not provide automatic corrections. This work investigates the use of language models to identify and handle semantic inconsistencies in short texts. Initially, we developed CoheBERT (Coherence BERT) to evaluate a BERT-based classifier that distinguishes original documents from those with permuted sentences, and (in)coherence scores computed from the (dis)similarity of adjacent sentence embeddings. Later, by reducing the granularity, we developed the COHEWL (COHErence at Word Level) framework to analyze word-level coherence in short texts. Its functionalities include generating contrastive data by replacing words with alternatives suggested by humans or predicted by the BERT Masked Language Model. Finally, we evaluated BERT and generative large language models (LLMs) within COHEWL to classify and measure semantic coherence and detect and correct incoherent words. The experiments used datasets in both Portuguese and English, including CSTNews, SQuAD 2.0, FaQuAD, OnlineEduc 1.0, and CohQuAD ? the last two created during this PhD research. The CoheBERT classifier, based on BERT, achieved up to 99.20% accuracy in detecting permuted sentences in journalistic texts and a question-and-answer forum from a virtual learning environment. In COHEWL, BERT achieved accuracy ranging from 80% to 99.88% in detecting short QA-style questions with one altered word. LLMs such as LLaMA, GPT, Gemini, and Sabiá-3 outperformed BERT in classifying semantic coherence in our corpus of short questions about data structures. LLMs also produced word-level semantic coherence scores more aligned with human coherence perception than those derived from BERT embeddings, and detected and corrected incoherent words with significantly better performance. |
Description: | Tese (doutorado) - Universidade Federal de Santa Catarina, Centro Tecnológico, Programa de Pós-Graduação em Ciência da Computação, Florianópolis, 2025. |
URI: | https://repositorio.ufsc.br/handle/123456789/265490 |
Date: | 2025 |
Files | Size | Format | View |
---|---|---|---|
PGCC1301-T.pdf | 4.812Mb |
View/ |