CFP last date
20 December 2024
Reseach Article

Implementation of Text Recommendation using Word Frequency and Cosine Similarity in Python

by Ahmad Farhan AlShammari
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

@article{ 10.5120/ijca2023923065,
author = { Ahmad Farhan AlShammari },
title = { Implementation of Text Recommendation using Word Frequency and Cosine Similarity in Python },
journal = { International Journal of Computer Applications },
issue_date = { Aug 2023 },
volume = { 185 },
number = { 30 },
month = { Aug },
year = { 2023 },
issn = { 0975-8887 },
pages = { 50-55 },
numpages = {9},
url = { https://ijcaonline.org/archives/volume185/number30/32888-2023923065/ },
doi = { 10.5120/ijca2023923065 },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Journal Article
%1 2024-02-07T01:27:31.568385+05:30
%A Ahmad Farhan AlShammari
%T Implementation of Text Recommendation using Word Frequency and Cosine Similarity in Python
%J International Journal of Computer Applications
%@ 0975-8887
%V 185
%N 30
%P 50-55
%D 2023
%I Foundation of Computer Science (FCS), NY, USA
Abstract

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.

References
  1. Sammut, C., & Webb, G. I. (2011). "Encyclopedia of Machine Learning". Springer.
  2. Aggarwal, C. (2015). "Data Mining: The Textbook". New York: Springer.
  3. Aggarwal, C. (2016). "Recommender Systems: The Textbook". Springer.
  4. Jannach, D., Zanker, M., Felfernig, A., & Friedrich, G. (2010). "Recommender Systems: An Introduction". Cambridge University Press.
  5. Burke, R., Felfernig, A., & Göker, M. H. (2011). "Recommender Systems: An Overview". AI Magazine, 32(3), 13-18.
  6. Park, D. H., Kim, H. K., Choi, I. Y., & Kim, J. K. (2012). "A Literature Review and Classification of Recommender Systems Research". Expert Systems with Applications, 39(11), 10059-10072.
  7. Bobadilla, J., Ortega, F., Hernando, A., & Gutiérrez, A. (2013). "Recommender Systems Survey". Knowledge-based Systems, 46, 109-132.
  8. Ricci, F., Rokach, L., & Shapira, B. (2015). "Recommender Systems: Introduction and Challenges". Recommender Systems Handbook, 1-34.
  9. Lu, J., Wu, D., Mao, M., Wang, W., & Zhang, G. (2015). "Recommender System Application Developments: A Survey". Decision Support Systems, 74, 12-32.
  10. Beel, J., Gipp, B., Langer, S., & Breitinger, C. (2016). "Paper Recommender Systems: A Literature Survey". International Journal on Digital Libraries, 17, 305-338.
  11. Fayyaz, Z., Ebrahimian, M., Nawara, D., Ibrahim, A., & Kashef, R. (2020). "Recommendation Systems: Algorithms, Challenges, Metrics, and Business Opportunities". Applied Sciences, 10(21), 7748
  12. Jannach, D., Pu, P., Ricci, F., & Zanker, M. (2021). "Recommender Systems: Past, Present, Future". AI Magazine, 42(3), 3-6.
  13. Kanwal, S., Nawaz, S., Malik, M. K., & Nawaz, Z. (2021). "A Review of Text-based Recommendation Systems". IEEE Access, 9, 31638-31661.
  14. Roy, D., & Dutta, M. (2022). "A Systematic Review and Research Perspective on Recommender Systems". Journal of Big Data, 9(1), 59.
  15. Ko, H., Lee S., Park Y., & Choi A. (2022). "A Survey of Recommendation Systems: Recommendation Models, Techniques, and Application Fields". Electronics, 11(1), 141.
  16. Rich, E. (1979). "User Modeling via Stereotypes". Cognitive science, 3(4), 329-354.
  17. Goldberg, D., Nichols, D., Oki, B., & Terry, D. (1992). "Using Collaborative Filtering to Weave an Information Tapestry". Communications of the ACM, 35(12), 61-70.
  18. Resnick, P., Iacovou, N., Suchak, M., Bergstrom, P., & Riedl, J. (1994). "Grouplens: An Open Architecture for Collaborative Filtering of NetNews". In ACM Conference on Computer Supported Cooperative Work, 175-186.
  19. Amazon: https://www.amazon.com
  20. Linden, G., Smith, B., & York, J. (2003). "Amazon.com Recommendations: Item-to-Item Collaborative Filtering". IEEE Internet Computing, 7(1), 76–80.
  21. Schafer, J. B., Konstan, J., & Riedl, J. (1999). "Recommender Systems in E-Commerce". In Proceedings of the 1st ACM Conference on Electronic Commerce, 158-166.
  22. NetFlix: https://www.netflix.com
  23. Youtube: https://www.youtube.com
  24. Luhn, H. (1958). "The Automatic Creation of Literature Abstracts". IBM Journal of Research and Development, 2(2), 159-165.
  25. Salton, G., Wong, A., & Yang, C. S. (1975a). "A Vector Space Model for Automatic Indexing". Communications of the ACM, 18(11), 613-620.
  26. Salton, G., Yang, C. S., & Yu, C. T. (1975b). "A Theory of Term Importance in Automatic Text Analysis". Journal of the American Society for Information Science, 26(1), 33-44.
  27. Salton, G. & McGill, M. (1983). "Introduction to Modern Information Retrieval". McGraw Hill Book Co, New York.
  28. Salton, G., & Buckley, C. (1988). "Term-Weighting approaches in Automatic Text Retrieval". Information Processing and Management, 24(5), 513-523.
  29. Salton, G. (1989). "Automatic Text Processing: The Transformation, Analysis, and Retrieval of Information by Computer". Addison- Wesley Publishing Company, USA.
  30. Python: https://www.python.org
  31. Numpy: https://www.numpy.org
  32. Pandas: https:// pandas.pydata.org
  33. Matplotlib: https://www. matplotlib.org
  34. NLTK: https://www.nltk.org
  35. SK Learnt: https://scikit-learn.org
  36. Wikipedia: https://en.wikipedia.org
Index Terms

Computer Science
Information Sciences

Keywords

Artificial Intelligence Machine Learning Natural Language Processing Text Mining Text Recommendation Word Frequency Cosine Similarity Python Programming.