Sıradan Sıraya LSTM Modeli ile Telegram Bot Uygulaması

Sohbet botu (Chatbot), işitsel veya metinsel yöntemlerle kullanıcı ile sohbet eden bir yazılımdır. Gelişmiş sohbet botları, ilgili konuya uygun cevaplar verebilmektedir. Sohbet botlarında yapay zeka yöntemlerinin kullanılması etkinliğini artırmaktadır. Bu kapsamda, çalışmada LSTM (Uzun Kısa Süreli Bellek) ve seq2seq modeli ile telegram bot uygulaması geliştirilmiştir. Çalışmada LSTM kullanılması bir sonraki konuşma eylemini tahmin etmek için konuşma geçmişine geri dönülebilmesini sağlamıştır. Çalışmada kaggle.com’dan alınan chatterbot veri kümesi kullanılarak zaman tasarrufu sağlanmıştır. Kullanıcı etkileşimi için pythonanywhere üzerinden telegram ile entegrasyon yapılmıştır. Çalışmanın eğitimi sırasındaki kayıp oranı ve diğer performans parametreleri TensorBoard ile görselleştirilmiştir. Çalışmada 50 adımlık eğitim, 13 saniyede tamamlanmıştır. Çalışmadaki kayıp oranı her adımda azalarak 50 adım sonunda 0.2772’ye düşmüş ve yüzde 79 doğruluk oranı elde edilmiştir. Çalışma, modüler ve geliştirmeye açık bir şekilde tasarlanmıştır. Modüler yapıdaki çalışmanın eğitim süreci devam edilmesi sağlanarak farklı dilsel ifadelerin öğretilmesi sağlanabilecektir. Çalışmada, açık kaynak kodlu ve ücretsiz yazılımlar kullanılmıştır. Sunulan çalışma, güncel teknolojilerin kullanıldığı literatürde öne çıkan çalışmaların özelliklerinin biraraya getirilmesini sağlamıştır.

Telegram Bot Application with Sequence to Sequence LSTM Model

Chatbot is a software that chat with the user by audio or textual methods. Advanced chat bots are able to provide appropriate answers related issues. Using artificial intelligence methods in chat bots increases efficiency. In this context, telegram bot application was developed with LSTM (Long Short Term Memory) and seq2seq model. The use of LSTM in the study enabled the return to speech history to predict the next speech action. Time saving was achieved by using chatterbot dataset from kaggle.com in the study. Telegram integration is provided via pythonanywhere for user interaction. The loss rate and other performance parameters during the training of the study were visualized with TensorBoard. In the study, the 50-step training was completed in 13 seconds. The loss rate in the study decreased at each step and decreased to 0.2772 at the end of 50 steps and 79 percent accuracy rate was obtained. The study is designed modularly and open to development. By continuing the education process of the modular study, it will be possible to teach different linguistic expressions. Open source and free software were used in the study. The presented study has brought together the features of the outstanding studies in the literature using state of art technologies.

___

  • [1] J. Huang, M. Zhou, D. Yang, “Extracting Chatbot Knowledge from Online Discussion Forums”, Proceedings of the 20th International Joint Conference on Artificial Intelligence(IJCAI), January 6–12 2007, Hyderabad, India, R. Sangal, H. Mehta, R. K. Bagga, Morgan Kaufmann Publishers, Hyderabad, India: 2007, pp. 423-428.
  • [2] I. Sutskever, Q. Le, O. Vinyals, (2014). Sequence to Sequence Learning with Neural Networks, In Advances in neural information processing systems, December 8–12 2014, Montreal, Canada, Z. Ghahramani, M. Welling, C. Cortes, Morgan Kaufmann Publishers, NY, USA: 2014, pp. 3104- 3112.
  • [3] F. Bonilla, F. Ugalde, “Automatic Translation of Spanish Natural Language Commands to Control Robot Comands based on LSTM neural network”, Third IEEE International Conference on Robotic Computing (IRC), February 25-27 2019, Naples, Italy, F. G. Rosas NY: Curran Associates, 2019, pp. 125- 131.
  • [4] A. Xu, Z. Liu, Y. Guo, V. Sinha, and R. Akkiraju, “A new chatbot for customer service on social media”, In Proceedings of the 2017 CHI Conference on Human Factors in Computing Systems, May 6-11 2017, Denver, USA, H. Mark, S. Fussell, NY: Association for Computing Machinery, 2017, pp. 3506-3510.
  • [5] M. H. Su, C. H. Wu, K. Y. Huang, Q. B. Hong and H. M. Wang, “A chatbot using LSTM-based multilayer embedding for elderly care”, In 2017 International Conference on Orange Technologies (ICOT), December 8-10 2017, Crescent, Singapore, M. Dong, L. Wang, Y. Lu, H. Li, Singapore: Research Publishing Services, 2017, pp. 70-74.
  • [6] M. Muslih, D. Supardi, E. Multipi, Y. M. Nyaman and A. Rismawan, “Developing Smart Workspace Based IOT with Artificial Intelligence Using Telegram Chatbot”, In 2018 International Conference on Computing, Engineering, and Design (ICCED), September 6-10 2018, Bangkok, Thailand, T. Mantoro, NY: Curran Associates, 2018, pp. 230-234.
  • [7] P. Muangkammuen, N. Intiruk and K. R. Saikaew, “Automated thai-faq chatbot using RNN-LSTM”, In 2018 22nd International Computer Science and Engineering Conference (ICSEC), 30 October -1 November 2018, Chiang Mai, Thailand, E. Boonchieng, NY: Curran Associates, 2018, pp. 1-4.
  • [8] W.C. Lee, Y.S. Wang, T.S. Hsu and K.Y. Chen, “Scalable Sentiment for Sequence-to-Sequence Chatbot Response with Performance Analysis”, 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), April 15–20 2018, Calgary, AB, M. Hayes, NY: Curran Associates, 2018, pp. 6164-6167.
  • [9] F. Rahman, “Sequence to Sequence Learning with Keras”, Available: https://github.com/farizrahman4u/seq2seq, [Accessed: Sept. 12, 2019].
  • [10] R. Kompella, “Neural Machine Translation — Using seq2seq with Keras”, Available: https://towardsdatascience.com/neural-machinetranslation-using-seq2seq-with-keras-c23540453c74, [Accessed: Sept. 12, 2019].
  • [11] Textminingonline, “Getting Started with Word2Vec and GloVe”, Available: https://textminingonline.com/getting-started-withword2vec-and-glove, [Accessed: Sept. 12, 2019].
  • [12] J. S. Chawla, “What is GloVe?”, Available: https://medium.com/@japneet121/wordvectorization-using-glove-76919685ee0b , [Accessed: Sept. 12, 2019].
  • [13] R. Kaus, “Dataset for chatbots”, Available: https://www.kaggle.com/kausr25/chatterbotenglish [Accessed: Sept. 12, 2019].
  • [14] C. Jongerius, “Quantifying Chatbot Performance by using Data Analytics”, Utrecht University, Faculty of Science Theses, Master thesis, 2018.
  • [15] PythonAnywhere, “PythonAnywhere in one minute”, Available: https://www.youtube.com/watch?v=NH2PhXYvrWs, [Accessed: Sept. 12, 2019].
  • [16] Telegram, “Telegram Bot Api”, Available: https://core.telegram.org/bots/api#available-methods, [Accessed: Sept. 12, 2019].
  • [17] Tensorflow, “TensorBoard”, Available: https://www.tensorflow.org/tensorboard, [Accessed: Sept. 12, 2019].
Gazi Mühendislik Bilimleri Dergisi-Cover
  • Yayın Aralığı: Yılda 3 Sayı
  • Başlangıç: 2015
  • Yayıncı: Aydın Karapınar