International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
|
Volume 185 - Issue 36 |
Published: Oct 2023 |
Authors: Ahmad Farhan Alshammari |
![]() |
Ahmad Farhan Alshammari . Implementation of Text Similarity using Word Frequency and Cosine Similarity in Python. International Journal of Computer Applications. 185, 36 (Oct 2023), 54-59. DOI=10.5120/ijca2023923160
@article{ 10.5120/ijca2023923160, author = { Ahmad Farhan Alshammari }, title = { Implementation of Text Similarity using Word Frequency and Cosine Similarity in Python }, journal = { International Journal of Computer Applications }, year = { 2023 }, volume = { 185 }, number = { 36 }, pages = { 54-59 }, doi = { 10.5120/ijca2023923160 }, publisher = { Foundation of Computer Science (FCS), NY, USA } }
%0 Journal Article %D 2023 %A Ahmad Farhan Alshammari %T Implementation of Text Similarity using Word Frequency and Cosine Similarity in Python%T %J International Journal of Computer Applications %V 185 %N 36 %P 54-59 %R 10.5120/ijca2023923160 %I Foundation of Computer Science (FCS), NY, USA
The goal of this research is to develop a text similarity program using word frequency and cosine similarity in Python. The purpose of text similarity is to measure the similarity between texts. The word frequency is used to measure the word importance in the text, and cosine similarity is used to measure the similarity between texts. The basic steps of text similarity are explained: preprocessing text, creating list of words, creating bag of words, creating word frequency, calculating cosine similarity, and printing similarity score. The developed program was tested on an experimental text from Wikipedia. The program successfully performed the basic steps of text similarity and provided the required results.