International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 185 - Number 30 |
Year of Publication: 2023 |
Authors: Ahmad Farhan AlShammari |
10.5120/ijca2023923065 |
Ahmad Farhan AlShammari . Implementation of Text Recommendation using Word Frequency and Cosine Similarity in Python. International Journal of Computer Applications. 185, 30 ( Aug 2023), 50-55. DOI=10.5120/ijca2023923065
The goal of this research is to develop a text recommendation program using word frequency and cosine similarity in Python. Text recommendation is the process that provides suggestions to the user. The word frequency is used to measure the importance of words in the text, and cosine similarity is used to measure the similarity between texts. The basic steps of text recommendation are explained: preprocessing text, creating list of words, creating bag of words, creating word frequency, calculating cosine similarity, creating similarity score, sorting similarity score, and printing recommendations. The developed program was tested on an experimental text from Wikipedia. The program successfully performed the basic steps of text recommendation and provided the required results.