[PYTHON] (Note) A story about creating a question answering system using Spring Boot and machine learning (SVM)

Introduction

It is a story of making a question answering system using Spring Boot and machine learning (SVM). I made it by myself a long time ago (around mid-2018) and left it alone. It's a waste, so it's an article organized for myself (memorial). Please note that this is an article I made for myself, so it may be difficult to understand, information, and technology may be out of date: bow: Also, I hope it will be helpful for those who want to make some kind of web application by themselves. If you don't know about the question answering system, @ VegaSato's article is very detailed. I hope you can read this. $ \ tiny {* I used it as a reference. Thank you} $: bow_tone1: Create a Japanese question answering system using Bluemix's Watson API Simply put

It is a system in which the system searches for and answers the best answer when the user inputs a question.

Looking at the article related to the question answering system on Qiita, the core part uses a proper API such as IBM Watoson, but Please note that I am a self-made SVM (Support Vector Machine) and the implementation is bad or not very accurate: no_good: The real thing is like the GIF below. Peek 2020-05-08 23-29.gif App Link

When I asked how to be happy, I managed to get the answer ** "Do your best in any situation" **: clap:

Goal (purpose?) Of this theme

It's going to be long, so this time it's up to the environment. .. ..

Target audience:

App overview

The screen and usage are very simple. If you enter a question as shown in the capture below, multiple answers will be displayed at the bottom of the screen. $ \ tiny {* Don't worry about the example question} $: sob: Also, if you click the answer link, the screen will change to the link destination in another tab. image.png

Processing flow

The flow from the user inputting the question text to displaying the answer on the screen on the system side is as follows. The same is true for humans, but first we classify what kind of question (what, when, how) to the questioned content. Perform machine learning in advance to classify, and prepare a trained model (question type). $ \ tiny {* I'd like to write an article about machine learning methods later when I have time. .. } $: sweat_smile: After classifying the questions, get the sentences from the internet (scraping). Classify the acquired sentences. Again, machine learning is done in advance to do the classification, Prepare a trained model (answer type). Then, the answer type and the acquired text are temporarily stored in the answer candidate list. $ \ tiny {* I feel that there is a waste in processing. .. } $: sob: Loop through the answer candidate list, and if the question type matches the answer type, store it in the answer list. Finally, the answer list is displayed on the screen.

image.png

Environment * I think that it will work even if it is not the following Ver, but please note that it is old: no_good_tone2: </ sup>

the next deployment

This time, I wrote an article about the environment. It's a shabby article, but I've used it for almost a day off: sob: Also, when you have time, you can brush up, sauce, etc. little by little. I would like to write an article: sob:

Recommended Posts

(Note) A story about creating a question answering system using Spring Boot and machine learning (SVM)
A story about simple machine learning using TensorFlow
A story about machine learning with Kyasuket
A story about automating online mahjong (Mahjong Soul) with OpenCV and machine learning
A story about data analysis by machine learning
What I learned about AI and machine learning using Python (4)
Machine learning A story about people who are not familiar with GBDT using GBDT in Python
A story about developing a machine learning model while managing experiments and models with Azure Machine Learning + MLflow
Try using Elasticsearch as the foundation of a question answering system
Creating a learning model using MNIST
A story about using Python's reduce
A story about trying to connect to MySQL using Heroku and giving up
Personal notes and links about machine learning ① (Machine learning)
A story about Python pop and append
"OpenCV-Python Tutorials" and "Practical Machine Learning System"
Creating a development environment for machine learning
A story about achieving a horse racing recovery rate of over 100% through machine learning
Until launching a boat race triple prediction site using machine learning and Flask
Creating a position estimation model for the Werewolf Intelligence Tournament using machine learning
A story about Go's global variables and scope
A story about modifying Python and adding functions
[Python] Sort apples and pears from pixel values using a support vector machine (SVM)