{'fraction_non_alphanumeric': 0.015199493350221659, 'fraction_numerical': 0.0, 'mean_word_length': 5.475409836065574, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Leveraging Grammatical Roles for Measuring Semantic Similarity Between Texts

Semantic similarity between texts can be defined based on their meaning. Assessing the textual similarity is a prerequisite in almost all applications in the field of language processing and information retrieval. However, the diversity in the sentence structure makes it formidable to estimate the similarity. Some sentences pairs are lexicographically similar but semantically dissimilar. That is why the trivial lexical overlapping is not enough for measuring the similarity. To attain the semanticity of sentences, the context of the words and the structure of the sentence should be considered. In this paper, we propose a new method for capturing the semantic similarity between sentences based on their grammatical roles through word semantics. First, the sentences are divided grammatically into different parts where each part is considered as a grammatical role. Then multiple new measures are introduced to estimate the role-based similarity exploiting word semantics considering the sentence structure. The proposed similarity measures focus on inter-role and intra-role similarity between the sentence-pair. The word-level semantic information is extracted from a pre-trained word-embedding model. The performance of the proposed method was verified by conducting a wide range of experiments on the SemEval STS dataset. The experimental results indicated the effectiveness of the proposed method in terms of different standard evaluation metrics and outperformed some known related works.