Comparison and clustering of textual information sources based on the cosine similarity algorithm
Loading...
Date
Journal Title
Journal ISSN
Volume Title
Publisher
Національний університет «Львівська політехніка»
Abstract
This article presents a study aimed at developing an optimal concept for analyzing and comparing information sources based on large amounts of text information using natural language processing (NLP) methods. The object of the study was Telegram news channels, which are used as sources of text data. Pre-processing of texts was carried out, including cleaning, tokenization and lemmatization, to form a global dictionary consisting of unique words from all information sources. For each source, a vector representation of texts was constructed, the dimension of which corresponds to the number of unique words in the global dictionary. The frequency of use of each word in the channel texts was displayed in the corresponding positions of the vector. By applying the cosine similarity algorithm to pairs of vectors, a square matrix was obtained that demonstrates the degree of similarity between different sources. An analysis of the similarity of channels in limited time intervals was conducted, which allowed us to identify trends in changes in their information policies. The model parameters were optimized to ensure maximum channel differentiation, which increased the efficiency of the analysis. Clustering algorithms were applied, which divided the channels into groups according to the degree of lexical similarity. The results of the
study demonstrate the effectiveness of the proposed approach for quantitatively assessing the similarity and clustering text data from different sources. The proposed method can be used to analyze information sources, identify relationships between sources, study the dynamics of changes in their activities, and assess the socio-cultural impact of media content. У цій статті представлено дослідження, спрямоване на розроблення оптимальної концепції аналізу та порівняння джерел інформації на основі великих обсягів текстової інформації з використанням методів опрацювання природної мови. Об’єктом дослідження стали канали новин Telegram, які використовуються як джерела текстових даних. Була проведене попереднє опрацювання текстів, включаючи очищення, токенізацію та лематизацію, щоб сформувати глобальний словник, що складається з унікальних слів з усіх джерел інформації. Для кожного джерела було побудовано векторне представлення текстів, розмірність якого відповідає кількості унікальних слів у глобальному словнику. Частота використання кожного слова в текстах каналу відображалася у відповідних позиціях вектора. Застосовуючи алгоритм косинусної подібності до пар векторів, була отримана квадратна матриця, яка демонструє ступінь подібності між різними джерелами. Проведено аналіз схожості каналів на обмежених часових інтервалах, що дозволило виявити тенденції зміни їх інформаційної політики. Параметри моделі були оптимізовані для забезпечення максимальної диференціації каналів, що підвищило ефективність аналізу.
Застосовувалися алгоритми кластеризації, які розподіляли канали на групи за ступенем лексичної схожості. Результати дослідження демонструють ефективність запропонованого підходу для кількісної оцінки подібності та кластеризації текстових даних з різних джерел. Запропонована методика може бути використана для аналізу джерел інформації, виявлення взаємозв’язків між джерелами, дослідження динаміки змін їх діяльності та оцінки соціокультурного впливу медіаконтенту.
Description
Citation
Hu Z. Comparison and clustering of textual information sources based on the cosine similarity algorithm / Zhengbing Hu, Dmytro Uhryn, Artem Kalancha // Вісник Національного університету “Львівська політехніка”. Серія: Інформаційні системи та мережі. — Львів : Видавництво Львівської політехніки, 2025. — № 17. — С. 34–43.