In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
How to integrate the man-machine question answering system QuestionAnsweringSystem in the application? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
QuestionAnsweringSystem is a man-machine question answering system implemented by Java, which can automatically analyze questions and give candidate answers. IBM artificial intelligence computer system "Watson" in February 2011 in the United States popular TV quiz show "Jeopardy!" Beat two human champions, QuestionAnsweringSystem is IBM Watson's open source implementation of Java.
The architecture of the system is as follows:
QuestionAnsweringSystem provides two ways of integration, embedded in the application as a library and deployed independently as a platform.
Let's talk about how to do these two ways.
1. Embed it into the application in the way of library.
This method only supports the Java platform, and libraries can be added to the build path through Maven dependencies, as shown below:
Org.apdplat deep-qa 1.1
How to use it in the application? The sample code is as follows:
String questionStr = "who is the author of APDPlat?" ; Question question = SharedQuestionAnsweringSystem.getInstance (). AnswerQuestion (questionStr); if (question! = null) {List candidateAnswers = question.getAllCandidateAnswer (); int iTun1; for (CandidateAnswer candidateAnswer: candidateAnswers) {System.out.println ((iTunes +) + "," + candidateAnswer.getAnswer () + ":" + candidateAnswer.getScore ());}}
After running the program, the directory deep-qa is generated in the current directory, and there are two directories, dic and questionTypePatterns, in the directory.
Dic is the thesaurus that Chinese word segmentation components depend on, and questionTypePatterns is the pattern definition that problem category analysis depends on, which can be modified according to their own needs.
2. Deploy independently in a platform way.
First, it is deployed on your own server, such as 192.168.0.1, and then you can provide services through Json Over HTTP, as shown below:
Call address: who is the author of http://192.168.0.1/api/ask?n=1&q=APDPlat? Parameter: n indicates the number of answers to be returned Q indicates question code: UTF-8 code returns json: [{"answer": "Yang Shangchuan", "score": 1}] this is the answer to the question about how to integrate the man-machine question answering system QuestionAnsweringSystem in the application. I hope the above content can be of some help to you. If you still have a lot of questions to solve, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.