CN113127619A - Intelligent question answering method and device - Google Patents
Intelligent question answering method and device Download PDFInfo
- Publication number
- CN113127619A CN113127619A CN202110416478.2A CN202110416478A CN113127619A CN 113127619 A CN113127619 A CN 113127619A CN 202110416478 A CN202110416478 A CN 202110416478A CN 113127619 A CN113127619 A CN 113127619A
- Authority
- CN
- China
- Prior art keywords
- question
- speech
- search
- scheme
- result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000003058 natural language processing Methods 0.000 claims abstract description 22
- 230000008569 process Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000018109 developmental process Effects 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 241000238558 Eucarida Species 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/374—Thesaurus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/211—Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/237—Lexical tools
- G06F40/247—Thesauruses; Synonyms
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses an intelligent question answering method and device, wherein the method comprises the following steps: analyzing the question by using a natural language processing NLP to obtain the part of speech of each word in the question; and matching with map data in the cache according to the part of speech to obtain a search template of the question. Replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question; and inquiring whether the map data in the cache has a result matched with the search scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the search scheme in a database. According to the invention, the result is searched in the cache firstly, so that the reusability of data can be improved, and the searching efficiency can be improved.
Description
Technical Field
The invention relates to the technical field of internet, in particular to an intelligent question answering method and device.
Background
The development history of the intelligent question-answering system has been decades since 1950 since the development of Turing test. The intelligent question-answering system is really widely accepted by the industry and benefits from the demonstration effect brought by Siri and Watson in 2011. From now on, the intelligent question-answering system is more appropriate to practical application than ever before, which is attributed to the long-standing progress and development of machine learning and natural language processing technology.
However, the problems faced by the existing intelligent question-answering system are not completely solved, and the analysis of the real intention of the question and the judgment of the matching relation between the question and the answer are still two key problems restricting the performance of the intelligent system.
Disclosure of Invention
In order to solve at least one of the above technical problems, the present disclosure provides an intelligent question answering method and apparatus.
In a first aspect, the present invention provides an intelligent question answering method, including:
analyzing the question by using a natural language processing NLP to obtain the part of speech of each word in the question;
and matching with map data in the cache according to the part of speech to obtain a search template of the question.
Optionally, the method further comprises:
replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question;
and inquiring whether the map data in the cache has a result matched with the search scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the search scheme in a database.
Optionally, the method further comprises:
replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question;
combining the search schemes to obtain a combined scheme;
and inquiring whether the map data in the cache has a result matched with the combined scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the combined scheme in a database.
Optionally, the method further comprises:
and writing the result queried in the database into the cache.
Optionally, matching with map data in a cache according to the part of speech to obtain a search template of the question sentence, including:
and matching the keywords in the part of speech with the map data in the cache to obtain a search template of the question.
Optionally, the method further comprises:
and performing near meaning word configuration on the words in the word network.
Optionally, the method further comprises:
replacing part-of-speech variables in the search template with similar meaning words corresponding to the words with consistent parts-of-speech in the question to obtain a similar meaning scheme of the question;
and inquiring whether the map data in the cache has a result matched with the near meaning scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the near meaning scheme in a database.
In a second aspect, the present invention provides an intelligent question answering device, comprising: a question parsing module and a template matching module, wherein,
the question analysis module is used for analyzing a question by utilizing Natural Language Processing (NLP) to obtain the part of speech of each word in the question;
and the template matching module is used for matching with map data in the cache according to the part of speech to obtain a search template of the question.
Optionally, the apparatus further comprises: a part-of-speech replacement module and a result query module, wherein
The part-of-speech replacement module is used for replacing the part-of-speech variables in the search template with the words with consistent parts-of-speech in the question to obtain a search scheme of the question;
and the result query module is used for querying whether the map data in the cache has a result matched with the search scheme, if so, returning the result of the question sentence, and otherwise, querying the result matched with the search scheme in a database.
Optionally, the apparatus further comprises: the scheme combination module is used for combining the search schemes to obtain a combination scheme;
the result query module is further configured to query whether the map data in the cache has a result matching the combination scheme, if so, return the result of the question sentence, otherwise, query the database for the result matching the combination scheme.
Optionally, the apparatus further comprises: and the data cache module is used for writing the result inquired in the database into the cache.
Optionally, the template matching module is specifically configured to match the keywords in the part of speech with the map data in the cache to obtain a search template of the question.
Optionally, the apparatus further comprises: and the word network configuration module is used for carrying out near meaning word configuration on the words in the word network.
Optionally, the apparatus further comprises: a word meaning replacing module, configured to replace part-of-speech variables in the search template with near-sense words corresponding to words with the same part-of-speech in the question, so as to obtain a near-sense scheme of the question;
the result query module is further configured to query whether the map data in the cache has a result matching the synonym scheme, if so, return a result of the question, and otherwise, query a database for a result matching the synonym scheme.
In a third aspect, the present invention provides a readable storage medium having executable instructions thereon which, when executed, cause a computer to perform the method as comprised in the first aspect.
In a fourth aspect, the present invention provides a computing device comprising: one or more processors, memory, and programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors to perform the method as comprised in the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 to 5 are schematic flow diagrams of intelligent question answering methods according to different embodiments of the present invention, respectively.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, the present invention provides an intelligent question answering method, which includes:
analyzing the question by using a natural language processing NLP to obtain the part of speech of each word in the question;
and matching with map data in the cache according to the part of speech to obtain a search template of the question.
As shown in fig. 2, the present invention provides an intelligent question answering method, which includes:
analyzing the question by using a natural language processing NLP to obtain the part of speech of each word in the question;
matching with map data in cache according to the part of speech to obtain a search template of the question;
replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question;
and inquiring whether the map data in the cache has a result matched with the search scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the search scheme in a database.
As shown in fig. 3, the present invention provides an intelligent question answering method, which includes:
analyzing the question by using a natural language processing NLP to obtain the part of speech of each word in the question;
matching with map data in cache according to the part of speech to obtain a search template of the question;
replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question;
and inquiring whether the map data in the cache has a result matched with the search scheme, if so, returning the result of the question sentence, and otherwise, inquiring the result matched with the combined scheme in a database.
As shown in fig. 4, the present invention provides an intelligent question answering method, which includes:
analyzing the question by using a natural language processing NLP to obtain the part of speech of each word in the question;
matching with map data in cache according to the part of speech to obtain a search template of the question;
replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question;
combining the search schemes to obtain a combined scheme;
and inquiring whether the map data in the cache has a result matched with any one of the combination scheme and the search scheme, if so, returning the result of the question sentence, and otherwise, inquiring the result matched with any one of the combination scheme and the search scheme in a database.
It should be noted that, in the embodiment of the present invention, after the result of the question is queried in the database, the queried result may be written in the cache, so that the reusability of data may be effectively improved, and the search efficiency may be improved.
It should be noted that, in the embodiment of the present invention, the search template may be obtained by matching the part of speech after the word segmentation of the question with the existing search template in the cache. For example, the question is that the Shanghai Huaan industry (group) company's director Tan Xuan and the secretary Hu pistil come to the American New York modern art museum to visit. The question word is divided into: shanghai Huaan industry (group) company/nt, director/n, Tan Xuguang/nr, and/c, secretary/n, pistil/nr, incoming/v, New York, modern Art museum/ns, visit/v, with the part of speech corresponding to nt-n-nr-c-n-nr-v-ns-v after word segmentation. And using the part-of-speech result after word segmentation for matching the search template in the cache.
It should be noted that, in the embodiment of the present invention, a word in a word library word network may be configured with a near-synonym, a near-synonym and a word group are added to a participle name, and a near-synonym search scheme for a question is generated.
As shown in fig. 5, the present invention provides an intelligent question answering method, which specifically comprises:
step 1: and entering a system, caching atlas data (used for matching entities, relations, labels and attributes during question search) by the system, and entering a word bank word network to configure similar words so as to search the same word meaning in different word modes, thereby obtaining accurate answers of the question in multiple search modes.
Step 2: inputting a question, analyzing the question by using a Natural Language (NLP), analyzing the part of speech of the question by using a part of speech tag and a part of speech/sense cluster, analyzing the question by using a hand toolkit to obtain the analyzed part of speech tag and the part of speech/sense cluster, and generating a corresponding search scheme by template matching the part of speech.
And step 3: searching in the cache through the searching scheme generated in the step 2 and the combined scheme, performing matching search again in the database under the condition of no result, and writing the result and the matched template object into the cache after obtaining the result, thereby improving the reusability of data and improving the searching efficiency. Only part of matched template data in the cache is not loaded into the cache in full.
The invention provides an intelligent question answering device, which comprises: a question parsing module and a template matching module, wherein,
the question analysis module is used for analyzing a question by utilizing Natural Language Processing (NLP) to obtain the part of speech of each word in the question;
and the template matching module is used for matching with map data in the cache according to the part of speech to obtain a search template of the question.
In one embodiment of the invention, the apparatus further comprises: a part-of-speech replacement module and a result query module, wherein
The part-of-speech replacement module is used for replacing the part-of-speech variables in the search template with the words with consistent parts-of-speech in the question to obtain a search scheme of the question;
and the result query module is used for querying whether the map data in the cache has a result matched with the search scheme, if so, returning the result of the question sentence, and otherwise, querying the result matched with the search scheme in a database.
In one embodiment of the invention, the apparatus further comprises: the scheme combination module is used for combining the search schemes to obtain a combination scheme;
the result query module is further configured to query whether the map data in the cache has a result matching the combination scheme, if so, return the result of the question sentence, otherwise, query the database for the result matching the combination scheme.
In one embodiment of the invention, the apparatus further comprises: and the data cache module is used for writing the result inquired in the database into the cache.
In an embodiment of the present invention, the template matching module is specifically configured to match the keywords in the part of speech with the map data in the cache to obtain the search template of the question.
In one embodiment of the invention, the apparatus further comprises: and the word network configuration module is used for carrying out near meaning word configuration on the words in the word network.
In one embodiment of the invention, the apparatus further comprises: a word meaning replacing module, configured to replace part-of-speech variables in the search template with near-sense words corresponding to words with the same part-of-speech in the question, so as to obtain a near-sense scheme of the question;
the result query module is further configured to query whether the map data in the cache has a result matching the synonym scheme, if so, return a result of the question, and otherwise, query a database for a result matching the synonym scheme.
Because the content of information interaction, execution process, and the like among the modules in the device is based on the same concept as the method embodiment of the present invention, specific content can be referred to the description in the method embodiment of the present invention, and is not described herein again.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (10)
1. An intelligent question-answering method, characterized in that the method comprises:
analyzing the question by using a natural language processing NLP to obtain the part of speech of each word in the question;
and matching with map data in the cache according to the part of speech to obtain a search template of the question.
2. The intelligent question answering method according to claim 1, characterized in that the method further comprises:
replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question;
and inquiring whether the map data in the cache has a result matched with the search scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the search scheme in a database.
3. The intelligent question answering method according to claim 1, characterized in that the method further comprises:
replacing part-of-speech variables in the search template with words with consistent parts-of-speech in the question to obtain a search scheme of the question;
combining the search schemes to obtain a combined scheme;
and inquiring whether the map data in the cache has a result matched with the combined scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the combined scheme in a database.
4. The intelligent question-answering method according to any one of claims 2 or 3, characterized in that the method further comprises:
and writing the result queried in the database into the cache.
5. The intelligent question answering method according to claim 1, wherein the step of matching with map data in a cache according to the part of speech to obtain a search template of the question sentence comprises the steps of:
and matching the keywords in the part of speech with the map data in the cache to obtain a search template of the question.
6. The intelligent question answering method according to claim 1, characterized in that the method further comprises:
and performing near meaning word configuration on the words in the word network.
7. The intelligent question answering method according to claim 6, characterized in that the method further comprises:
replacing part-of-speech variables in the search template with similar meaning words corresponding to the words with consistent parts-of-speech in the question to obtain a similar meaning scheme of the question;
and inquiring whether the map data in the cache has a result matched with the near meaning scheme, if so, returning the result of the question, and otherwise, inquiring the result matched with the near meaning scheme in a database.
8. An intelligent question answering device, characterized in that the device comprises: a question parsing module and a template matching module, wherein,
the question analysis module is used for analyzing a question by utilizing Natural Language Processing (NLP) to obtain the part of speech of each word in the question;
and the template matching module is used for matching with map data in the cache according to the part of speech to obtain a search template of the question.
9. A readable storage medium having executable instructions thereon that, when executed, cause a computer to perform the method as included in any one of claims 1-7.
10. A computing device, comprising: one or more processors, memory, and programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors to perform the method as recited in any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110416478.2A CN113127619A (en) | 2021-04-19 | 2021-04-19 | Intelligent question answering method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110416478.2A CN113127619A (en) | 2021-04-19 | 2021-04-19 | Intelligent question answering method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113127619A true CN113127619A (en) | 2021-07-16 |
Family
ID=76777584
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110416478.2A Pending CN113127619A (en) | 2021-04-19 | 2021-04-19 | Intelligent question answering method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113127619A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105868313A (en) * | 2016-03-25 | 2016-08-17 | 浙江大学 | Mapping knowledge domain questioning and answering system and method based on template matching technique |
US20180189385A1 (en) * | 2016-12-29 | 2018-07-05 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method and device for locating an answer based on question and answer |
CN109492077A (en) * | 2018-09-29 | 2019-03-19 | 北明智通(北京)科技有限公司 | The petrochemical field answering method and system of knowledge based map |
CN112507089A (en) * | 2020-11-25 | 2021-03-16 | 厦门渊亭信息科技有限公司 | Intelligent question-answering engine based on knowledge graph and implementation method thereof |
CN112597272A (en) * | 2020-11-17 | 2021-04-02 | 北京计算机技术及应用研究所 | Expert field knowledge graph query method based on natural language question |
-
2021
- 2021-04-19 CN CN202110416478.2A patent/CN113127619A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105868313A (en) * | 2016-03-25 | 2016-08-17 | 浙江大学 | Mapping knowledge domain questioning and answering system and method based on template matching technique |
US20180189385A1 (en) * | 2016-12-29 | 2018-07-05 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method and device for locating an answer based on question and answer |
CN109492077A (en) * | 2018-09-29 | 2019-03-19 | 北明智通(北京)科技有限公司 | The petrochemical field answering method and system of knowledge based map |
CN112597272A (en) * | 2020-11-17 | 2021-04-02 | 北京计算机技术及应用研究所 | Expert field knowledge graph query method based on natural language question |
CN112507089A (en) * | 2020-11-25 | 2021-03-16 | 厦门渊亭信息科技有限公司 | Intelligent question-answering engine based on knowledge graph and implementation method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10115056B2 (en) | Method and apparatus for responding to an inquiry | |
US10169337B2 (en) | Converting data into natural language form | |
US8452772B1 (en) | Methods, systems, and articles of manufacture for addressing popular topics in a socials sphere | |
US9720977B2 (en) | Weighting search criteria based on similarities to an ingested corpus in a question and answer (QA) system | |
KR20120009446A (en) | System and method for automatic semantic labeling of natural language texts | |
US8930296B2 (en) | Method and system for programming virtual robots using a template | |
GB2513537A (en) | Natural language processing | |
Cm et al. | Question answering over knowledge graphs using BERT based relation mapping | |
Kiyavitskaya et al. | Semi-Automatic Semantic Annotations for Web Documents. | |
CN113190692A (en) | Self-adaptive retrieval method, system and device for knowledge graph | |
Sanyal et al. | Natural language processing technique for generation of SQL queries dynamically | |
CN111898024A (en) | Intelligent question and answer method and device, readable storage medium and computing equipment | |
US20220366135A1 (en) | Extended open information extraction system | |
US11947530B2 (en) | Methods and systems to automatically generate search queries from software documents to validate software component search engines | |
CN109558580B (en) | Text analysis method and device | |
US11921763B2 (en) | Methods and systems to parse a software component search query to enable multi entity search | |
CN113127619A (en) | Intelligent question answering method and device | |
KR102600703B1 (en) | Apparatus and method for answering questions related to legal field | |
US10713329B2 (en) | Deriving links to online resources based on implicit references | |
CN110717029A (en) | Information processing method and system | |
German et al. | Information extraction method from a resume (CV) | |
Bédaride et al. | Semantic normalisation: a framework and an experiment | |
JP4033089B2 (en) | Natural language processing system, natural language processing method, and computer program | |
Kiyavitskaya et al. | Semantic Annotation as Design Recovery | |
CN118152424A (en) | Text2cypher system, method, device, processor and medium for realizing financial question and answer based on heuristic rule |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210716 |