The invention discloses a keyword-based question and answer method and device and a medium, and the method comprises the steps: obtaining an online corpus, extracting keywords in the online corpus, screening out a target keyword matched with a training corpus from the obtained keywords, inputting the target keyword and the training corpus into a corpus training model together, and adjusting parameters of the model based on an output result of the model to obtain a semantic understanding model; after the semantic understanding model is obtained, obtaining a standard question corresponding to auser question according to the user question, thereby outputting an answer corresponding to the standard question, and completing a question and answer mode. Therefore, because the target keyword is used as an auxiliary and is used as an input sample together with the training corpus, the weight of the information matched with the keywords in the training corpus is improved, the attention of the semantic comprehension model to the keywords is actively improved, and the similar user questions are accurately recognized, so that more accurate answers can be output, and the user experience is improved.