Automatic question answering method, device, equipment and medium
Through the method of automatically crawling and building a knowledge graph, the problems of low efficiency and insufficient accuracy of Q&A in online education are solved, efficient and accurate Q&A services are achieved, and a continuously growing knowledge base is formed.
Patent Information
- Application Number
- CN202411971998.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
AI Technical Summary
It is difficult for existing technology to effectively and promptly answer students' learning questions in online education, resulting in low efficiency and insufficient accuracy of answering questions.
Through a pre-configured third-party library, we can crawl knowledge content related to the target course from the target channel, build a knowledge graph, and classify and query based on user questions, and automatically find and display the target answers.
It improves the efficiency and accuracy of Q&A, can provide the latest and most accurate information instantly, reduces manual intervention, forms a growing knowledge base, and improves intelligence and accuracy.
Smart Images

Figure CN119884395A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to an automatic question-answering method, apparatus, device, and medium. Background Art
[0003] With the rapid development of Internet technology, especially the popularization of mobile Internet and cloud computing technology, online educational resources have shown explosive growth. Students can obtain a large amount of learning materials through online platforms, including video lectures, online courses, e-books, forum discussions, etc. This way of learning breaks the limitations of time and space, making learning more flexible and convenient. However, this free and open learning environment also brings new challenges, that is, the problems encountered by students in the process of independent learning are often not answered in a timely and effective manner.
[0004] Traditional Q&A methods, such as face-to-face consultation, email communication, or telephone communication, can solve problems to a certain extent, but they have obvious limitations. First, these methods often require a long wait for a response, which cannot meet students' needs for instant answers, resulting in low Q&A efficiency. Secondly, with the increase in the number of students, the workload of teachers increases, and it is difficult to provide personalized and precise Q&A services for each student. Finally, the traditional Q&A method lacks systematic recording and analysis, making it difficult to accumulate and pass on experience in knowledge sharing and problem solving.
[0005] Therefore, how to improve the efficiency and accuracy of answering questions is an urgent problem that needs to be solved. Summary of the invention
[0007] In view of the above problems existing in the prior art, the purpose of this application is to propose an automatic question answering method, device, equipment and medium to at least solve the technical problem of how to improve the efficiency and accuracy of answering questions.
[0008] To achieve the above objectives and other related objectives, the present application provides an automatic question answering method, the method comprising: Crawling knowledge content related to the target course from the target channel through a pre-configured third-party library; Based on the knowledge content, construct a knowledge graph, wherein the knowledge graph includes multiple entities and relationships; Obtain user questions, and classify the user questions to obtain target question categories; Based on the target question category, the multiple entities, and the relationship, a target answer is searched in the knowledge graph, and the target answer is displayed to the user who asked the question.
[0009] In some implementations, crawling knowledge content related to a target course from a target channel includes: Obtaining web page content in the target channel; Parsing the hypertext markup language in the webpage content, and crawling initial information related to the target course from the hypertext markup language through a crawler framework; Translating the initial information according to a preset language category to obtain intermediate information; The error information in the intermediate information is processed to obtain the knowledge content.
[0010] In some implementations, the processing of error information in the intermediate information includes: Performing translation detection on the translated information in the intermediate information, and retranslating the initial information when there are grammatical errors or misunderstandings in the translated information; The intermediate information is identified for errors through a preconfigured spell checker or format validator, and based on the result of the error identification, information in the intermediate information that is not related to the target course is deleted and / or duplicate information is merged.
[0011] In some implementations, constructing a knowledge graph based on the knowledge content includes: Identify the knowledge content, determine the course entities, concept entities, as well as belonging relationships and related relationships; Constructing a knowledge graph data model, wherein the knowledge graph data model includes the categories of the entities and the structures of the relationships; Based on the course entities, concept entities, belonging relationships and related relationships, the text information in the knowledge content is imported into the knowledge graph data model to construct a knowledge graph in a graphical form, wherein the nodes of the knowledge graph in a graphical form are the entities and the edges of the knowledge graph in a graphical form are the relationships.
[0012] In some implementations, after obtaining the user's question, the method further includes: When the user question is in text form, decomposing the user question into separate words, identifying the part of speech and target entity in the words, analyzing the dependency relationship between the words in the sentence in the user question, determining the sentence structure, and determining the user question intention based on the part of speech, target entity, and sentence structure, and the user question intention is used to classify the user question; When the user question is in voice form, the user question is decomposed into separate words, the acoustic features in the words are extracted, the word sequence corresponding to the acoustic features is predicted through a pre-built language model, and the user question intention in text form is generated based on the word sequence. The user question intention in text form is used to classify the user question.
[0013] In some implementations, the target question categories include fact query, concept explanation, program operation, and comparative analysis.
[0014] In some implementations, searching for a target answer in the knowledge graph based on the target question category, the multiple entities, and the relationship includes: Based on the target question category, extract keywords, question entities, and question relations from the user's question, and convert the keywords, question entities, and question relations into structured query statements; Based on the structured query statement, determining a candidate answer set from the knowledge graph; Performing correlation analysis on multiple answers in the answer candidate set and the structured query statement, and generating a first ranked list according to the correlation analysis result; Performing context analysis on multiple answers in the answer candidate set, and generating a second ranked list according to the context analysis result; Based on the first ranked list and the second ranked list, the target answer is determined.
[0015] In one embodiment of the present application, an automatic question-answering device is also provided, the device comprising: The crawling module is used to crawl knowledge content related to the target course from the target channel through a pre-configured third-party library; A knowledge graph construction module, used to construct a knowledge graph based on the knowledge content, wherein the knowledge graph includes multiple entities and relationships; A questioning module is used to obtain user questions and classify the user questions to obtain target question categories; A query module is used to search for a target answer in the knowledge graph based on the target question category, the multiple entities, and the relationship, and to display the target answer to the user who asked the question.
[0016] In one embodiment of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein the above-mentioned automatic question-answering method is executed when the computer program is run.
[0017] In one embodiment of the present application, an electronic device is further provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned automatic question-answering method through the computer program.
[0018] Beneficial effects of the present invention: First, the knowledge content related to the target course is crawled from the target channel through a pre-configured third-party library; then, based on the knowledge content, a knowledge graph is constructed, and the knowledge graph includes multiple entities and relationships; then, user questions are obtained, and the user questions are classified to obtain target question categories; finally, based on the target question category, the multiple entities, and the relationship, the target answer is found in the knowledge graph, and the target answer is displayed to the user who asked the question. In this application, the knowledge content related to the target course is crawled from the target channel through a pre-configured third-party library. The traditional manual collection and organization of learning materials requires a lot of time and human resources, while the automated crawling tool can obtain the latest and highly relevant knowledge content from multiple sources (such as online course platforms, academic databases, forums, etc.) in a short time. As new knowledge is continuously generated, the knowledge base can be updated regularly or in real time to ensure that users can always obtain the latest and most accurate information. The knowledge graph converts unstructured text information into a structured data model, which clearly represents the relationship between different concepts (such as "belonging to", "related to", etc.). This structured representation enables the system to understand the semantic context of the problem more accurately, thereby providing more accurate answers. Through the knowledge graph, not only can a single entity be identified, but also the association between entities can be understood, so as to better grasp the context of the question and avoid misunderstandings or ambiguous answers. By automatically classifying user questions, the type of question can be quickly determined, so as to select the most appropriate method to find the answer, avoiding the time delay of manual classification and improving the response speed. The knowledge graph provides an efficient indexing and query mechanism, which can quickly locate relevant knowledge points according to question categories, entities and relationships. Compared with traditional full-text search, this method can find the most relevant answers faster. The application scheme is automated from knowledge acquisition, classification, retrieval to display, reducing human intervention and greatly shortening the time for answering questions. Users can get answers instantly without having to wait for teachers or other experts to respond; they can understand the user's question intention and accurately match it according to the knowledge graph, and can provide personalized answers according to the specific needs of each user, rather than a stereotyped standard response; the knowledge graph and answers generated during each question-answering process can be recorded to form a growing knowledge base. This accumulated knowledge can be used for future question-answering to further improve intelligence and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a schematic diagram of an application environment of an automatic question answering method shown in an exemplary embodiment of the present application; Figure 2 is a flowchart of an automatic question answering method shown in an exemplary embodiment of the present application; Figure 3 is a schematic diagram of an automatic question-answering device shown in an exemplary embodiment of the present application; Figure 4 It is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] In one embodiment of the present application, an automatic question answering method is provided. Optionally, as an optional implementation, the automatic question answering method can be applied to, but is not limited to, Figure 1 in the environment shown. Figure 1 is a schematic diagram of an application environment of the automatic question answering method shown in an exemplary embodiment of the present application, see Figure 1The automatic question answering terminal 101 may, but is not limited to, communicate with the questioning terminal 102 through a network, and the automatic question answering terminal 101 may, but is not limited to, be equipped with an automatic question answering system. The automatic question answering terminal 101 may, but is not limited to, perform operations on the database, such as write data operations or read data operations. The above-mentioned automatic question answering terminal 101 may, but is not limited to, include a human-computer interaction screen, a processor and a memory. The above-mentioned human-computer interaction screen may, but is not limited to, be used to display the target answer. The above-mentioned processor may, but is not limited to, be used to respond to the above-mentioned human-computer interaction operation, perform corresponding operations, or generate corresponding instructions, and send the generated instructions to the questioning terminal 102. The above-mentioned memory is used to store relevant storage data, such as knowledge content, knowledge graphs, and target answers.
[0025] As an optional method, the knowledge content may be collected by the automatic question answering terminal 101, for example, the knowledge content related to the target course may be collected and pre-processed.
[0026] As an optional method, the following steps in the automatic question answering method may be performed on the automatic question answering terminal 101: Crawling knowledge content related to the target course from the target channel through a pre-configured third-party library; Based on the knowledge content, construct a knowledge graph, wherein the knowledge graph includes multiple entities and relationships; Obtain user questions, and classify the user questions to obtain target question categories; Based on the target question category, the multiple entities, and the relationship, a target answer is searched in the knowledge graph, and the target answer is displayed to the user who asked the question.
[0027] As an optional method, the questioning terminal 102 may obtain the user's question and then transmit the user's question to the automatic question answering terminal 101 .
[0028] In the above method, knowledge content related to the target course is crawled from the target channel through a pre-configured third-party library. Traditional manual collection and organization of learning materials requires a lot of time and human resources, while automated crawling tools can obtain the latest and highly relevant knowledge content from multiple sources (such as online course platforms, academic databases, forums, etc.) in a short time. As new knowledge is constantly generated, the knowledge base can be updated regularly or in real time to ensure that users can always obtain the latest and most accurate information. The knowledge graph converts unstructured text information into a structured data model, which clearly represents the relationship between different concepts (such as "belongs to", "related to", etc.). This structured representation enables the system to understand the semantic context of the question more accurately, thereby providing more accurate answers. Through the knowledge graph, not only can individual entities be identified, but also the associations between entities can be understood, thereby better grasping the context of the question and avoiding misunderstandings or ambiguous answers. By automatically classifying user questions, the type of question can be quickly determined, so that the most appropriate method can be selected to find the answer, avoiding the time delay of manual classification and improving the response speed. The knowledge graph provides an efficient indexing and query mechanism, which can quickly locate relevant knowledge points based on question categories, entities and relationships. Compared with traditional full-text search, this method can find the most relevant answers faster. This application solution is automated from knowledge acquisition, classification, retrieval to display, which reduces manual intervention and greatly shortens the time for answering questions. Users can get answers instantly without having to wait for responses from teachers or other experts; it can understand the user's question intentions and accurately match them according to the knowledge graph, and can provide personalized answers based on the specific needs of each user, rather than a standard response that is the same for everyone; the knowledge graph and answers generated during each question-answering process can be recorded to form a growing knowledge base. This accumulated knowledge can be used for future question-answering, further improving intelligence and accuracy.
[0029] Optionally, in this embodiment, the network may include but is not limited to: a wireless network, wherein the wireless network includes: Bluetooth, WIFI and other networks that implement wireless communication. The automatic question answering terminal 101 may be a server, and the server may be a single server, or a server cluster composed of multiple servers, or a cloud server. The above is only an example, and this embodiment does not make any limitation to this.
[0030] As an optional example, this embodiment does not limit the execution subject of the above automatic question answering method, and some or all steps of the above automatic question answering method can be executed on the automatic question answering terminal 101.
[0031] In one embodiment of the present application, an automatic question-answering method is provided. Figure 2 is a flowchart of an automatic question answering method shown in an exemplary embodiment of the present application, see Figure 2 The automatic question answering method includes the following steps S210 to S240: In step S210, knowledge content related to the target course is crawled from the target channel through a pre-configured third-party library.
[0032] Among them, third-party libraries refer to software libraries provided by third-party developers or organizations, which are usually used to implement specific functions or tasks. In this solution, third-party libraries are mainly used for web crawler functions to help the system automatically obtain data from the Internet. By using mature third-party libraries, content related to the target course can be quickly and efficiently extracted from multiple online resources, reducing development time and complexity.
[0033] Among them, the target channel refers to the source from which the system obtains knowledge content. These channels can be online education platforms, academic databases, forums, blogs, social media, etc. The choice of target channels determines the scope and quality of knowledge that the system can obtain. By selecting high-quality target channels, the system can ensure that it obtains the most authoritative and relevant learning materials.
[0034] The target course refers to the specific subject or field of study that the user is interested in, such as "computer science", "physics", "history", etc. The clarity of the target course helps the system to crawl and process relevant knowledge content in a targeted manner, avoid interference from irrelevant information, and improve the accuracy and efficiency of answering questions.
[0035] Among them, knowledge content refers to the text related to the target course extracted from the target channel. After the knowledge content is processed, it will become the basis for building the knowledge graph. The quality of knowledge content directly affects the construction of the knowledge graph and the subsequent question-answering effect. High-quality knowledge content can provide more comprehensive and accurate answers.
[0036] In step S220, a knowledge graph is constructed based on the knowledge content, and the knowledge graph includes multiple entities and relationships.
[0037] Among them, the knowledge graph is a structured semantic network that represents entities and their relationships in the form of a graph. Each node represents an entity, and the edge represents the relationship between entities. The knowledge graph transforms unstructured knowledge content into a structured data model, allowing the system to query and reason more efficiently. It not only stores a large number of knowledge points, but also records the associations between knowledge points, thereby improving the accuracy of problem solving.
[0038] Entities refer to specific objects or concepts in the knowledge graph, such as "computer", "operating system", "programming language", etc. Relationships refer to the associations between entities, such as "belongs to", "contains", "related to", etc. For example, "Python" belongs to "programming language" and "operating system" contains "kernel". The clear representation of entities and relationships enables the system to better understand the background and context of the problem, thereby providing more accurate answers. By analyzing the relationships between entities, the system can perform multi-step reasoning to find the most appropriate answer.
[0039] In step S230, user questions are obtained and classified to obtain target question categories.
[0040] Among them, user questions refer to questions about the target course asked by students or other users to the system. These questions can be in text form or voice form. User questions are the starting point for the system to answer questions. The system's task is to find and display answers quickly and accurately based on the user's questions.
[0041] Among them, when the user questions are classified and the target question categories are obtained, the system can classify them into different question types by performing natural language processing (NLP) on the user questions, such as "fact query", "concept explanation", "program operation", "comparative analysis", etc. Question classification helps the system understand the user's needs more accurately and choose the most appropriate method to find answers. Different types of questions may require different processing methods, and classification can improve the efficiency and accuracy of answering questions.
[0042] In step S240, based on the target question category, the multiple entities, and the relationship, a target answer is searched in the knowledge graph, and the target answer is displayed to the user who asked the question.
[0043] Among them, according to the question category, keywords, entities and relationships in the user's question, the system can search in the knowledge graph to find the most relevant answer. By combining the question category and the entity relationship in the knowledge graph, the system can perform efficient query and reasoning to ensure that the answers found are not only relevant, but also have high accuracy and depth.
[0044] The system presents the answers it has found to the questioner in a user-friendly way. The presentation can be in the form of text, charts, links, etc., depending on the type of question and the user's preference. A good presentation method can improve the user experience and ensure that the user can understand the answer clearly and intuitively. In addition, the system can also provide additional learning resources or recommend related content to help users further expand their knowledge.
[0045] For example, there is an online education platform that specializes in providing courses in the field of computer science. User Xiaoming is studying the course "Operating System" and encounters a question: "What is virtual memory? How does it work?" The system selects several high-quality target channels. The system uses the Scrapy library (a crawler framework library) to crawl knowledge content related to "Operating System" from these channels, including articles, tutorials, Q&A, etc., especially those related to virtual memory, such as definition, working principle, application scenarios, etc. The system identifies some key entities, such as "virtual memory", "physical memory", "page table", "memory management unit", etc.; establishes relationships between entities, such as the "mapping relationship" between "virtual memory" and "physical memory", the "conversion relationship" between "page table" and "virtual address", etc.; constructs these entities and relationships into a knowledge graph, forming a structured semantic network. Xiao Ming asked the question: "What is virtual memory? How does it work?" The system analyzed Xiao Ming's question through NLP technology and determined that this was a "concept explanation" type question involving the definition and working principle of "virtual memory"; further analyzed the sentence structure, identified the keywords "virtual memory" and "working principle", and determined that the user's question intention was to understand the concept of virtual memory and its operating mechanism; generated structured query statements based on the question category (concept explanation), keywords (virtual memory, working principle), and entities and relationships in the knowledge graph; searched for knowledge points related to "virtual memory" in the knowledge graph, and found the definition, working principle, advantages, etc. of virtual memory; based on relevance analysis and context understanding, generated a set of answer candidates and sorted them according to relevance. The system showed Xiao Ming the most relevant and accurate answer, explained the concept and working principle of virtual memory, and attached a simplified virtual memory workflow diagram to help Xiao Ming better understand; and also recommended some related learning resources, such as video tutorials on memory management and the working principle of operating systems, for Xiao Ming to learn further.
[0046] The above-mentioned embodiment provided by the present application crawls the knowledge content related to the target course from the target channel through the pre-configured third-party library. The traditional manual collection and organization of learning materials requires a lot of time and human resources, while the automated crawling tool can obtain the latest and highly relevant knowledge content from multiple sources (such as online course platforms, academic databases, forums, etc.) in a short time. With the continuous generation of new knowledge, the knowledge base can be updated regularly or in real time to ensure that users can always obtain the latest and most accurate information. The knowledge graph converts unstructured text information into a structured data model, which clearly expresses the relationship between different concepts (such as "belonging to", "related to", etc.). This structured representation enables the system to understand the semantic background of the problem more accurately, thereby providing more accurate answers. Through the knowledge graph, not only can a single entity be identified, but also the association between entities can be understood, so as to better grasp the context of the problem and avoid misunderstandings or ambiguous answers. By automatically classifying user questions, the type of question can be quickly determined, so as to select the most appropriate method to find the answer, avoiding the time delay of manual classification and improving the response speed. The knowledge graph provides an efficient indexing and query mechanism, which can quickly locate relevant knowledge points according to question categories, entities and relationships. Compared with traditional full-text search, this method can find the most relevant answers faster. This application solution is automated from knowledge acquisition, classification, retrieval to display, which reduces manual intervention and greatly shortens the time for answering questions. Users can get answers instantly without having to wait for responses from teachers or other experts; it can understand the user's question intentions and accurately match them according to the knowledge graph, and can provide personalized answers based on the specific needs of each user, rather than a standard response that is the same for everyone; the knowledge graph and answers generated during each question-answering process can be recorded to form a growing knowledge base. This accumulated knowledge can be used for future question-answering, further improving intelligence and accuracy.
[0047] In one embodiment of the present application, crawling knowledge content related to the target course from the target channel includes: Obtaining web page content in the target channel; Parsing the hypertext markup language in the webpage content, and crawling initial information related to the target course from the hypertext markup language through a crawler framework; Translating the initial information according to a preset language category to obtain intermediate information; The error information in the intermediate information is processed to obtain the knowledge content.
[0048] Among them, obtaining web page content in the target channel refers to downloading the HTML (Hypertext Markup Language) source code or page content of the web page from the specified target channel (such as online education platform, academic database, forum, etc.). These web page contents contain text, images, links and other information related to the target course. Obtaining web page content is the first step in the entire knowledge acquisition process, ensuring that the system can access and download the latest and most relevant information. Obtaining web page content in an automated way can greatly improve the efficiency and coverage of data collection.
[0049] HTML (Hypertext Markup Language) is the main structural language of web pages, which is used to describe the content and layout of web pages. Parsing HTML means separating the tags, attributes and text content in HTML documents and extracting useful text information and metadata. Parsing HTML helps to remove irrelevant formatting and style information and retain the core text content. For example, removing HTML <script>、<style>标签,保留、<h1>等标签中的文本内容。这一步骤为后续的爬取和处理提供了干净、结构化的数据。
[0050] 其中,爬虫框架是一种用于自动化抓取网页内容的工具或库,它可以帮助开发者更高效地编写和管理网络爬虫。爬虫框架提供了丰富的功能,如自动处理分页、登录验证、反爬机制应对等,使得开发者可以专注于核心逻辑的实现。通过使用成熟的爬虫框架,系统可以更稳定、更高效地从多个目标渠道中获取数据。
[0051] 其中,在解析HTML后,系统需要进一步筛选和提取与目标课程相关的初始信息。这通常涉及基于关键词、正则表达式等技术,从网页内容中提取特定部分的数据。初始信息的提取是确保系统只获取与目标课程相关的内容,避免无关信息的干扰。例如,对于"操作系统”课程,系统可能会提取包含"内存管理”、"进程调度”等关键词的段落,而忽略其他无关的内容。这一步骤提高了后续处理的效率和准确性。
[0052] 其中,如果初始信息是用非目标语言(如英文、法文等)编写的,可以根据预设的语言类别,使用机器翻译技术将其翻译为目标语言(如中文)。翻译步骤确保系统能够处理多语言的内容,特别是当目标课程的相关资源来自不同语言的网站时。通过自动翻译,系统可以将所有信息统一为目标语言,方便后续的处理和展示。此外,翻译还可以帮助用户理解来自不同语言背景的知识内容,扩大系统的适用范围。
[0053] 示例性的,有一个在线教育平台,专门提供计算机科学领域的课程。用户小明正在学习"操作系统”这门课程,系统需要从多个目标渠道中获取与"操作系统”相关的知识内容。系统选择了几个高质量的目标渠道。使用Scrapy爬虫框架,向这些网站发送请求,获取每个页面的HTML源代码。解析HTML文档,去除无关的标签(如<script>、<style>),保留核心的文本内容。例如,系统提取了Wikipedia页面中关于"虚拟内存”的段落:根据预设的关键词(如"虚拟内存”、"内存管理”、"进程调度”等),使用正则表达式从解析后的HTML中提取与"操作系统”相关的段落。例如,系统提取了以下内容:"虚拟内存是操作系统的一种内存管理功能,它使应用程序认为自己拥有连续的工作内存,但实际上它是物理上分散的,甚至可能溢出到磁盘存储。”;"内存管理单元(MMU)负责将虚拟地址转换为物理地址。”初始信息是从英文网站获取的,则将其翻译为中文。
[0054] 本实施例中,通过使用爬虫框架和关键词匹配技术,系统能够从大量的网页内容中精确提取与目标课程相关的初始信息,避免无关信息的干扰。这不仅提高了数据的质量,还减少了后续处理的负担。系统可以从多个目标渠道中获取数据,确保覆盖了尽可能多的优质资源。这样,用户可以获得更全面、更丰富的学习材料。通过预设的语言类别和机器翻译技术,系统可以处理多语言的内容,特别是当目标课程的相关资源来自不同语言的网站时。这大大扩展了系统的适用范围,使得用户能够访问全球范围内的优质教育资源。翻译步骤确保所有信息统一为目标语言,方便用户的理解和使用。这对于非英语母语的学习者尤为重要,因为他们可以直接获得中文或其他熟悉语言的解释。整个数据获取过程(从网页内容获取、HTML解析、信息提取到翻译)都是自动化的,减少了人工干预的时间和成本。系统可以在短时间内从多个渠道获取大量数据,提高了数据处理的效率。使用成熟的爬虫框架可以确保系统的稳定性和可靠性,特别是在面对复杂的网页结构和反爬机制时。这使得系统能够在各种环境下稳定运行,持续获取最新的知识内容。系统可以根据不同的目标课程和语言需求,灵活调整爬虫策略和翻译设置。例如,对于不同的学科领域,系统可以选择不同的关键词进行信息提取;对于不同的语言,系统可以选择不同的翻译API(接口)。随着新资源的出现或用户需求的变化,系统可以轻松添加新的目标渠道或语言支持,而不需要大规模修改现有代码。这使得系统具有良好的扩展性和适应性。用户可以通过系统快速获取与目标课程相关的最新、最准确的知识内容,而不必手动搜索多个网站。这大大节省了用户的时间,提升了学习效率。系统提供的多语言支持使得用户能够无障碍地访问全球范围内的优质教育资源,特别对于非英语母语的学习者来说,这是一个巨大的便利。
[0055] 在本申请的一实施例中,所述对所述中间信息中的错误信息进行处理,包括:对所述中间信息中翻译后的信息进行翻译检测,在所述翻译后的信息存在语法错误或者误解时,重新翻译所述初始信息;通过预先配置的拼写检查器或格式验证器,对所述中间信息进行错误识别,并根据所述错误识别的结果,删除所述中间信息中与所述目标课程无关的信息,和 / 或合并重复的信息。
[0056] 其中,翻译检测是指对机器翻译生成的文本进行质量评估,检查是否存在语法错误、语义误解或不准确的表达。常见的翻译检测方法包括基于规则的检查、统计模型和深度学习模型。翻译检测可以识别出翻译过程中可能产生的错误,确保最终的知识内容准确无误。对于存在明显问题的翻译结果,系统会触发重新翻译机制,使用不同的翻译模型或参数进行改进,以提高翻译的质量。
[0057] 其中,拼写检查器是一种用于自动检测和纠正文本中拼写错误的工具。它可以通过词典匹配、编辑距离计算等技术,识别并修正拼写错误的单词。拼写检查器可以帮助系统确保知识内容中的词汇是正确的,避免因拼写错误导致的误解或混淆。这对于提高用户对系统的信任度非常重要,尤其是在处理学术或专业领域的知识时。
[0058] 其中,格式验证器是一种用于检查文本格式是否符合预设标准的工具。它可以验证文本中的标点符号、句子结构、段落格式等是否正确,确保文本的可读性和规范性。格式验证器有助于提升文本的整体质量,确保知识内容不仅在语义上准确,而且在格式上也符合标准。这使得用户能够更轻松地阅读和理解系统提供的答案。
[0059] 其中,错误识别是指通过多种技术手段(如自然语言处理、机器学习等),自动检测文本中的各种错误,包括拼写错误、语法错误、语义误解、无关信息等。错误识别是确保知识内容高质量的关键步骤。通过对中间信息进行全面的错误检测,系统可以发现并修复潜在的问题,避免将不准确或误导性的信息传递给用户。
[0060] 其中,删除无关信息,指从中间信息中移除与目标课程无关的内容,确保最终的知识内容高度相关。合并重复信息,指将中间信息中重复的内容进行合并,避免冗余信息的出现,保持知识内容的简洁性和条理性。删除无关信息和合并重复信息可以提高知识内容的精炼度,确保用户获得的是最核心、最有价值的信息。这不仅提高了答疑的效率,还提升了用户的满意度。
[0061] 示例性的,有一个在线教育平台,专门提供计算机科学领域的课程。用户小明正在学习"操作系统”这门课程,系统需要从多个目标渠道中获取与"操作系统”相关的知识内容,并对其进行翻译和处理。
[0062] 系统从英文网站获取了一段关于"虚拟内存”的描述,并将其翻译为中文:"虚拟内存是操作系统的一种内存管理功能,它使应用程序认为自己拥有连续的工作内存,但实际上它是物理上分散的,甚至可能溢出到磁盘存储。”使用翻译检测工具对这段翻译后的信息进行评估,发现其中的"溢出到磁盘存储”可能存在语义误解。正确的表达应该是"换页到磁盘存储”。因此,系统触发重新翻译机制,进行第二次翻译:"虚拟内存是操作系统的一种内存管理功能,它使应用程序认为自己拥有连续的工作内存,但实际上它是物理上分散的,必要时会换页到磁盘存储。”使用拼写检查器对翻译后的信息进行检查,确保所有词汇都是正确的。例如,系统发现"工作内存”中的"工作”可能是多余的,更准确的表达应该是"虚拟内存是操作系统的一种内存管理功能,它使应用程序认为自己拥有连续的内存,但实际上它是物理上分散的,必要时会换页到磁盘存储。”拼写检查器修正了文本中的词汇,确保最终的知识内容更加准确。使用格式验证器检查文本的标点符号、句子结构和段落格式。例如,系统发现原文中的句号使用不当,应该改为逗号,以保持句子的连贯性:"虚拟内存是操作系统的一种内存管理功能,它使应用程序认为自己拥有连续的内存,但实际上它是物理上分散的,必要时会换页到磁盘存储。”格式验证器修正了文本的格式,使得最终的知识内容更加规范和易读。系统使用自然语言处理技术对中间信息进行全面的错误识别。例如,系统发现一段关于"进程调度”的描述中包含了一些与操作系统无关的内容,如"进程调度不仅影响系统的性能,还会影响用户的社交生活。”系统识别出这句话中的"用户的社交生活”与操作系统无关,属于无关信息,因此将其删除。系统进一步分析中间信息,发现有两段关于"虚拟内存”的描述非常相似:段落1:虚拟内存是操作系统的一种内存管理功能,它使应用程序认为自己拥有连续的内存,但实际上它是物理上分散的,必要时会换页到磁盘存储;段落2:虚拟内存允许应用程序访问比实际物理内存更大的地址空间,通过换页机制将部分数据存储在磁盘上。系统将这两段内容合并为一个更简洁的描述:"虚拟内存是操作系统的一种内存管理功能,它使应用程序能够访问比实际物理内存更大的地址空间,通过换页机制将部分数据存储在磁盘上,从而实现物理上分散但逻辑上连续的内存管理。”本实施例中,通过翻译检测和重新翻译机制,系统能够识别并修正翻译过程中的语法错误和语义误解,确保最终的翻译结果准确无误。这避免了因翻译不准确而导致的误解或误导,提升了用户的信任度。拼写检查器和格式验证器的引入,确保了文本中的词汇和格式都符合标准,避免了拼写错误、标点符号错误等问题。这使得最终的知识内容更加规范、易读,提升了用户的阅读体验。通过格式验证,系统可以确保所有文本的风格一致,避免不同来源的内容在格式上的差异,增强了整体的统一性和专业性。通过对中间信息进行错误识别,系统能够有效去除与目标课程无关的内容,确保最终的知识内容高度相关。这避免了用户被无关信息干扰,提高了答疑的精准度。系统通过合并重复的内容,减少了冗余信息的出现,使得知识内容更加简洁、条理清晰。这不仅提高了用户的阅读效率,还避免了信息过载的问题。
[0063] 在本申请的一实施例中,所述基于所述知识内容,构建知识图谱,包括:识别所述知识内容,确定课程实体、概念实体,以及属于关系和相关关系;构建知识图谱数据模型,所述知识图谱数据模型包括所述实体的类别、所述关系的结构;基于所述课程实体、概念实体、属于关系和相关关系,将所述知识内容中的文本信息导入所述知识图谱数据模型,构建图形形式的知识图谱,所述图形形式的知识图谱的节点为所述实体,所述图形形式的知识图谱的边为所述关系。
[0064] 其中,课程实体是指与目标课程直接相关的具体对象或概念。它们通常是课程中的核心知识点、术语或主题。例如,在"操作系统”课程中,常见的课程实体包括"进程”、"线程”、"内存管理”、"文件系统”等。课程实体是知识图谱的基础节点,代表了课程中最重要和最基础的概念。通过识别和确定课程实体,系统可以确保构建的知识图谱能够涵盖课程的核心内容,为后续的答疑提供坚实的基础。
[0065] 其中,概念实体是指与课程实体相关联的更广泛或更具体的抽象概念。它们可能不是课程的核心知识点,但与课程实体有密切的关联。例如,在"操作系统”课程中,概念实体可以包括"并发性”、"死锁”、"虚拟化”等。概念实体扩展了知识图谱的覆盖范围,使得系统不仅能够处理课程中的基础知识,还能应对更复杂的概念和问题。通过引入概念实体,系统可以更好地理解用户提问的背景和上下文,提供更加全面的答案。
[0066] 其中,属于关系是指一个实体属于另一个实体的层次结构关系。它表示某个概念或对象是更大类别的子集或组成部分。例如,"线程”属于"进程”,"虚拟内存”属于"内存管理”。属于关系帮助系统建立实体之间的层级结构,明确不同概念之间的从属关系。这有助于系统在查询时快速定位到相关的知识点,并进行多步推理。例如,当用户问到"线程”的问题时,系统可以通过"属于关系”找到"进程”这一更广泛的类别,从而提供更全面的解释。
[0067] 其中,相关关系是指两个实体之间存在的非层次化的关联关系。它表示两个概念或对象在功能、作用或其他方面有一定的联系,但不一定存在从属关系。例如,"内存管理”与"文件系统”之间存在相关关系,因为它们都涉及到操作系统的资源管理。相关关系帮助系统识别不同实体之间的横向关联,使得系统能够在解答问题时考虑更多的相关知识点。例如,当用户问到"内存管理”的问题时,系统可以通过"相关关系”推荐"文件系统”作为扩展阅读材料,帮助用户更深入地理解操作系统的工作原理。
[0068] 其中,识别所述知识内容,确定课程实体、概念实体,以及属于关系和相关关系,是指通过自然语言处理(NLP)、命名实体识别(NER)、关系抽取等技术,从知识内容中自动识别出课程实体、概念实体,并确定它们之间的属于关系和相关关系。识别过程是构建知识图谱的关键步骤,它决定了知识图谱的准确性和完整性。通过自动化的方式识别实体和关系,系统可以高效地将大量文本信息转化为结构化的数据模型,为后续的查询和推理提供支持。
[0069] 其中,基于所述课程实体、概念实体、属于关系和相关关系,将所述知识内容中的文本信息导入所述知识图谱数据模型,构建图形形式的知识图谱,是指将识别出的实体和关系导入到知识图谱的数据模型中,形成一个以节点和边表示的图形结构。每个节点代表一个实体,每条边代表实体之间的关系。图形形式的知识图谱使得知识内容以可视化的方式呈现,便于系统进行高效的查询和推理。通过这种方式,系统可以快速找到与用户提问相关的知识点,并根据实体之间的关系生成更准确的答案。此外,图形形式的知识图谱还可以用于展示知识点之间的关联,帮助用户更好地理解复杂的概念。
[0070] 示例性的,有一个在线教育平台,专门提供计算机科学领域的课程。用户小明正在学习"操作系统”这门课程,系统需要根据获取的知识内容构建一个知识图谱,以便为用户提供精准的答疑服务。系统从多个渠道获取了关于"操作系统”的大量文本信息,包括:"进程是操作系统中执行程序的基本单位,它可以包含多个线程。”;"内存管理是操作系统的一项重要功能,它负责分配和回收内存资源。”;"文件系统是操作系统用来管理文件和目录的模块,它与内存管理系统协同工作。”系统识别出以下课程实体:进程、线程、内存管理、文件系统。系统还识别出一些与课程实体相关联的概念实体:并发性、死锁、虚拟化、换页机制。属于关系:线程属于进程、换页机制属于内存管理。相关关系:内存管理相关文件系统、并发性相关死锁。系统根据识别出的实体和关系,构建了一个知识图谱数据模型。该模型包括:实体类别:课程实体(如进程、内存管理)、概念实体(如并发性、死锁);关系结构:属于关系(如线程属于进程)、相关关系(如内存管理相关文件系统)。系统将上述实体和关系导入到知识图谱中,形成了一个图形结构。例如:节点:进程、线程、内存管理、文件系统、并发性、死锁;边:线程→进程(属于关系)、换页机制→内存管理(属于关系)、内存管理↔文件系统(相关关系)、并发性↔死锁(相关关系)。小明提出了一个问题:"什么是换页机制?它如何与内存管理相关?”。系统根据问题中的关键词"换页机制”和"内存管理”,在知识图谱中查找相关节点和边。系统发现"换页机制”属于"内存管理”,并且"内存管理”与"文件系统”存在相关关系。向小明展示了关于"换页机制”的详细解释,并推荐了"文件系统”作为扩展阅读材料,帮助他更全面地理解操作系统中的资源管理机制。
[0071] 本实施例中,通过识别课程实体、概念实体以及它们之间的属于关系和相关关系,系统将非结构化的文本信息转化为结构化的知识图谱。这种结构化表示使得系统能够更高效地进行查询和推理,避免了传统全文搜索的局限性。知识图谱不仅涵盖了课程的核心知识点,还通过属于关系和相关关系建立了知识点之间的层次结构和横向关联。这使得系统能够更好地理解问题的背景和上下文,提供更加全面和深入的答案。通过知识图谱,系统可以根据实体之间的关系进行多步推理,找到最合适的答案。例如,当用户问到"线程”的问题时,系统可以通过"属于关系”找到"进程”这一更广泛的类别,从而提供更全面的解释。知识图谱不仅关注问题中的关键词,还能理解实体之间的关联,避免误解或模糊回答。例如,当用户问到"内存管理”时,系统可以通过"相关关系”推荐"文件系统”作为扩展阅读材料,帮助用户更深入地理解操作系统的工作原理。
[0072] 在本申请的一实施例中,所述获取用户提问之后,还包括:在所述用户提问为文本形式时,将所述用户提问分解为单独的词汇,识别所述词汇中的词性、目标实体,分析所述用户提问中句子的词汇之间的依存关系,确定句子结构,并根据所述词性、目标实体、句子结构,确定所述用户提问意图,所述用户提问意图用于对所述用户提问进行分类;在所述用户提问为语音形式时,将所述用户提问分解为单独的词汇,提取所述词汇中的声学特征,通过预先构建的语言模型预测所述声学特征对应的词汇序列,并基于所述词汇序列生成文本形式的用户提问意图,所述文本形式的用户提问意图用于对所述用户提问进行分类。
[0073] 其中,依存关系分析是一种自然语言处理(NLP)技术,用于识别句子中词汇之间的语法和语义关系。它通过构建依存句法树(Dependency Parse Tree),展示每个词在句子中的角色及其与其他词的关系。常见的依存关系包括主谓关系、动宾关系、修饰关系等。依存关系分析有助于系统更深入地理解句子的结构和语义,特别是对于复杂句子,能够准确识别出主语、谓语、宾语等关键成分。这使得系统能够更好地把握用户的提问意图,避免因句子结构复杂而导致的误解。
[0074] 其中,用户提问意图是指用户提出问题时所期望获得的信息或解决的问题。通过分析词性(如名词、动词、形容词等)、识别目标实体(如课程中的具体概念)以及理解句子结构,系统可以推断出用户的真正意图。确定提问意图是分类用户问题的关键步骤。通过对词性、目标实体和句子结构的综合分析,系统可以更准确地理解用户的需求,并将其归类为不同的问题类型(如事实查询、概念解释、程序操作等)。这不仅提高了问题分类的准确性,还为后续的答案查找提供了明确的方向。
[0075] 其中,声学特征是指语音信号中的物理特性,如频率、振幅、音调、语速等。这些特征可以通过语音信号处理技术从用户的语音输入中提取出来。提取声学特征是将语音转换为文本的第一步。通过分析这些特征,系统可以识别出语音中的不同音素和单词,进而生成准确的文本表示。声学特征的提取质量直接影响到语音识别的准确性,因此这是一个非常重要的步骤。
[0076] 其中,语言模型是一种用于预测文本序列的概率模型,它可以基于已有的大量文本数据,预测给定上下文中最可能的下一个词。常见的语言模型包括n-gram模型、隐马尔可夫模型(HMM)、循环神经网络(RNN)等。语言模型在语音识别中用于将提取的声学特征转换为文本形式的词汇序列。通过预测最可能的词汇组合,系统可以生成准确的文本表示,即使在语音信号不清晰或有噪声的情况下,也能提高识别的准确性。预训练的语言模型通常具有较高的泛化能力,能够处理各种类型的语音输入。
[0077] 其中,基于所述词汇序列生成文本形式的用户提问意图,是指将语音识别生成的词汇序列进一步处理,生成能够反映用户提问意图的文本形式。这一步骤通常结合自然语言处理技术,如词性标注、命名实体识别、依存关系分析等,来理解词汇序列的语义,并推断出用户的真正意图。生成文本形式的用户提问意图是为了确保系统能够准确理解用户的语音输入,并将其转化为可以进行分类和处理的文本形式。这使得系统可以像处理文本提问一样,对语音提问进行分类和解答,提供一致的用户体验。
[0078] 示例性的,有一个在线教育平台,专门提供计算机科学领域的课程。用户小明正在学习"操作系统”这门课程,他向系统提出了一个问题。小明提出了一个文本形式的问题:"虚拟内存是如何实现换页的?”。词汇分解为:虚拟内存、如何、实现、换页。词性标注为:虚拟内存(名词短语)、如何(疑问词)、实现(动词)、换页(名词)。依存关系分析为:"虚拟内存”是主语、"如何”是疑问词,表示询问方式、"实现”是谓语、"换页”是宾语。句子结构为:主语+疑问词+谓语+宾语。提问意图为:根据词性、目标实体(虚拟内存、换页)和句子结构,确定这是一个"概念解释”类问题,用户想了解虚拟内存的具体实现机制,特别是换页的过程。分类结果为:将该问题分类为"概念解释”,并准备从知识图谱中查找与虚拟内存换页相关的知识点。
[0079] 示例性的,小明通过语音提出了一个问题:"什么是死锁?它怎么发生的?”系统从语音信号中提取出声学特征,如频率、振幅、音调等。使用预先构建的语言模型,将声学特征转换为词汇序列:"什么是 死锁 它 怎么 发生 的”。词汇序列为:什么是、死锁、它、怎么、发生、的。将词汇序列进一步处理,生成文本形式的提问:"什么是死锁?它怎么发生的?”。词汇分解为:什么是(疑问词)、死锁(名词)、它(代词)、怎么(疑问词)、发生(动词)、的(助词)。依存关系分析为:"死锁”是主语、"什么是”是疑问词,表示询问定义、"怎么”是疑问词,表示询问原因、"发生”是谓语。句子结构为:疑问词+主语+疑问词+谓语+助词。系统根据词性、目标实体(死锁)和句子结构,确定这是一个"概念解释”类问题,用户想了解死锁的定义及其发生的原因。将该问题分类为"概念解释”,并准备从知识图谱中查找与死锁相关的知识点。
[0080] 本实施例中,通过结合词性标注、依存关系分析、目标实体识别等多种技术,系统能够更全面地理解用户提问的语义和结构。这使得系统能够更准确地推断出用户的真正意图,避免因词语歧义或句子结构复杂而导致的误解。通过对提问意图的精确识别,系统可以将问题细分为不同的类别(如事实查询、概念解释、程序操作等),从而选择最合适的方法来查找答案。这不仅提高了问题分类的准确性,还为后续的答案查找提供了明确的方向。该方案不仅支持文本形式的提问,还支持语音形式的提问。通过语音识别技术和语言模型,系统可以将语音输入转换为文本形式,并对其进行相同的处理流程。这使得用户可以选择最适合自己的输入方式,提升了系统的灵活性和用户体验。无论是文本输入还是语音输入,系统都能提供一致的答疑服务,确保用户在不同输入方式下获得相同质量的回答。这增强了系统的通用性和适应性,满足了不同用户的需求。
[0081] 在本申请的一实施例中,所述目标问题类别包括事实查询、概念解释、程序操作、比较分析。
[0082] 其中,事实查询是指用户提出的问题旨在获取具体的、客观的事实信息。这类问题通常涉及明确的数据、定义、事件或现象,答案是确定的、唯一的。事实查询类问题的解答相对直接,系统可以根据知识图谱中的实体和关系,快速找到对应的事实性信息。这类问题的处理重点在于准确性和时效性,确保用户提供的是最新、最准确的事实。
[0083] 其中,概念解释是指用户提出的问题旨在理解某个概念、术语或理论的含义和原理。这类问题通常涉及较为抽象的知识点,答案需要提供详细的解释和背景信息,帮助用户全面理解该概念。概念解释类问题的解答需要系统具备较强的语义理解和推理能力,能够从知识图谱中提取相关联的概念,并进行深入的解释。这类问题的处理重点在于清晰性和深度,确保用户能够透彻理解复杂的概念。
[0084] 其中,程序操作是指用户提出的问题旨在了解如何执行某个具体的操作或步骤。这类问题通常涉及实践性的内容,如编程代码、实验步骤、软件使用等,答案需要提供详细的操作指南或示例。程序操作类问题的解答需要系统具备一定的实践指导能力,能够根据用户的实际需求,提供分步骤的操作指南或代码示例。这类问题的处理重点在于实用性和可操作性,确保用户能够按照指导顺利完成任务。
[0085] 其中,比较分析是指用户提出的问题旨在对比两个或多个对象、概念、方法等之间的异同点。这类问题通常涉及多方面的考量,答案需要提供详细的对比分析,帮助用户理解不同选项的优缺点。比较分析类问题的解答需要系统具备综合分析和对比的能力,能够从知识图谱中提取相关联的实体,并进行多维度的对比。这类问题的处理重点在于全面性和客观性,确保用户能够基于充分的信息做出合理的判断。
[0086] 在本申请的一实施例中,所述基于所述目标问题类别、所述多个实体、所述关系,在所述知识图谱中查找目标答案,包括:基于所述目标问题类别,从所述用户提问中提取关键词、提问实体、提问关系,并将所述关键词、提问实体、提问关系转化为结构化查询语句;基于所述结构化查询语句,从所述知识图谱中确定答案候选集;将所述答案候选集中的多个答案与所述结构化查询语句进行相关性分析,根据相关性分析结果生成第一排序列表;将所述答案候选集中的多个答案,进行上下文分析,根据上下文分析结果,生成第二排序列表;基于所述第一排序列表和所述第二排序列表,确定所述目标答案。
[0087] 其中,关键词、提问实体、提问关系定义:关键词:指用户提问中具有代表性和指示性的词语,通常是问题的核心词汇。例如,在"什么是虚拟内存?”中,"虚拟内存”是关键词。
[0088] 提问实体:指用户提问中涉及的具体对象或概念,通常是知识图谱中的实体节点。例如,在"什么是虚拟内存?”中,"虚拟内存”是一个提问实体。
[0089] 提问关系:指用户提问中涉及的实体之间的关系,通常是知识图谱中的边。例如,在"虚拟内存是如何实现换页的?”中,"虚拟内存”和"换页”之间存在"实现”这一关系。
[0090] 作用:通过提取关键词、提问实体和提问关系,系统可以更准确地理解用户提问的语义,为后续的查询和推理提供明确的方向。
[0091] 其中,结构化查询语句是指将用户提问中的关键词、提问实体和提问关系转化为一种标准化的查询格式,以便在知识图谱中进行高效的查询。常见的结构化查询语言包括SPARQL(用于RDF数据)、Cypher(用于Neo4j图数据库)等。结构化查询语句使得系统能够精确地表达用户的查询意图,确保在知识图谱中找到最相关的答案。它不仅提高了查询的效率,还增强了查询的准确性,避免了模糊匹配带来的误差。
[0092] 其中,基于所述结构化查询语句,从所述知识图谱中确定答案候选集,是指根据生成的结构化查询语句,在知识图谱中查找与之匹配的答案候选集。答案候选集通常包含多个可能的答案,每个答案都与用户的提问有一定的相关性。通过结构化查询语句,系统可以在知识图谱中快速定位到相关的知识点,生成一个初步的答案候选集。这一步骤为后续的相关性分析和上下文分析提供了基础。
[0093] 其中,相关性分析是指通过计算每个答案与结构化查询语句之间的相似度或匹配度,评估它们的相关性。常见的相关性分析方法包括余弦相似度等。相关性分析有助于系统对答案候选集进行初步筛选,将最相关的答案排在前面。这一步骤确保了用户能够优先看到与提问最匹配的答案,提高了答疑的精准度。
[0094] 其中,上下文分析是指通过对答案候选集中每个答案的上下文信息进行分析,评估其与用户提问的整体语义一致性。上下文分析不仅考虑答案本身的内容,还考虑其前后文的关系,确保答案的完整性和连贯性。上下文分析有助于系统进一步优化答案的排序,确保最终展示给用户的答案不仅与提问高度相关,而且具有良好的语义连贯性。这一步骤特别适用于复杂问题或多步推理的情况,能够提供更加全面和深入的回答。
[0095] 其中,基于所述第一排序列表和所述第二排序列表,确定所述目标答案,是指综合考虑相关性分析和上下文分析的结果,最终确定最合适的答案作为目标答案。系统可以根据两个排序列表的权重分配,选择最优的答案进行展示。通过结合相关性和上下文分析,系统能够更全面地评估每个答案的质量,确保最终展示给用户的答案是最准确、最完整的。这一步骤确保了答疑的高质量和用户体验的提升。
[0096] 示例性的,有一个在线教育平台,专门提供计算机科学领域的课程。用户小明正在学习"操作系统”这门课程,他向系统提出了一个问题:"虚拟内存是如何实现换页的?”。用户提问为:虚拟内存是如何实现换页的?关键词为:虚拟内存、换页。提问实体为:虚拟内存、换页。提问关系为:实现。生成结构化查询语句,查询语句表示在知识图谱中查找"虚拟内存”与"换页”之间的"实现”关系,并返回相关的答案。系统根据生成的结构化查询语句,在知识图谱中查找与"虚拟内存”和"换页”相关的知识点,生成一个答案候选集。例如,系统找到了以下几个可能的答案:答案1:虚拟内存通过分页机制将部分数据存储在磁盘上,从而实现换页;答案2:换页机制允许操作系统在物理内存不足时,将不常用的页面换出到磁盘;答案3:虚拟内存管理器负责监控内存使用情况,并在必要时触发换页操作。计算每个答案与结构化查询语句的相关性,生成第一排序列表。例如:答案1:相关性得分 = 0.95;答案2:相关性得分 = 0.85;答案3:相关性得分 = 0.75。对每个答案的上下文信息进行分析,评估其与用户提问的整体语义一致性,生成第二排序列表。例如:答案1:上下文得分 = 0.90(解释了换页的具体机制);答案2:上下文得分 = 0.80(解释了换页的触发条件);答案3:上下文得分 =0.85(解释了虚拟内存管理器的作用)。结合第一排序列表和第二排序列表,综合考虑相关性和上下文分析的结果,最终确定最合适的答案作为目标答案。例如:综合得分 =相关性得分 × 0.6 + 上下文得分 × 0.4,因此,可以知道:答案1:综合得分 = 0.95 ×0.6 + 0.90 × 0.4 = 0.93;答案2:综合得分 = 0.85 × 0.6 + 0.80 × 0.4 = 0.83;答案3:综合得分 = 0.75 × 0.6 + 0.85 × 0.4 = 0.79。选择了综合得分最高的答案1作为目标答案,并向小明展示了详细的解释:"虚拟内存通过分页机制将部分数据存储在磁盘上,从而实现换页。”本实施例中,通过结合关键词、提问实体和提问关系,系统能够更准确地理解用户的提问意图,生成精确的结构化查询语句。这使得系统能够在知识图谱中找到最相关的答案,避免了模糊匹配带来的误差。通过相关性分析和上下文分析,系统可以从多个角度评估每个答案的质量,确保最终展示给用户的答案是最准确、最完整的。这不仅提高了答案查找的精准度,还增强了用户的信任感。结构化查询语句使得系统能够在知识图谱中高效地查找答案,减少了查询时间。这使得系统能够快速响应用户的提问,缩短了用户的等待时间,提升了答疑的效率。整个答案查找过程是自动化的,系统能够在短时间内完成对用户提问的分析、查询和排序,减少了人工干预的时间和成本。这使得系统能够更高效地处理大量的用户提问,提升了整体的智能化水平。
[0097] 由上述实施例可知,通过预先配置的第三方库,从目标渠道中爬取与目标课程相关的知识内容,传统的人工收集和整理学习材料需要耗费大量时间和人力资源,而自动化的爬取工具可以在短时间内从多个来源(如在线课程平台、学术数据库、论坛等)获取最新的、相关性强的知识内容。随着新知识的不断产生,可以定期或实时地更新知识库,确保用户始终能够获得最新、最准确的信息。知识图谱将非结构化的文本信息转化为结构化的数据模型,明确表示了不同概念之间的关系(如"属于”、"相关”等)。这种结构化表示使得系统能够更精确地理解问题的语义背景,从而提供更加准确的答案。通过知识图谱,不仅能够识别单个实体,还能理解实体之间的关联,进而更好地把握问题的上下文,避免误解或模糊回答。通过对用户提问进行自动分类,可以快速确定问题的类型,从而选择最合适的方法来查找答案,避免了人工分类的时间延迟,提高了响应速度。知识图谱提供了高效的索引和查询机制,可以根据问题类别、实体和关系快速定位到相关的知识点。相比传统的全文搜索,这种方式能够更快地找到最相关的答案。本申请方案,从知识获取、分类、检索到展示都是自动化的,减少了人工干预,大大缩短了答疑的时间。用户可以即时获得答案,而不必等待教师或其他专家的回复;能够理解用户的提问意图并根据知识图谱进行精准匹配,可以根据每个用户的具体需求提供个性化的答案,而不是千篇一律的标准回复;每次答疑过程中生成的知识图谱和答案都可以被记录下来,形成一个不断增长的知识库。这些积累的知识可以用于未来的答疑,进一步提高智能性和准确性。
[0098] 在本申请的一实施例中,还提供了一种自动答疑装置。图3是本申请的一示例性实施例示出的自动答疑装置的示意图,参见图3,该装置包括:爬取模块301,用于通过预先配置的第三方库,从目标渠道中爬取与目标课程相关的知识内容;知识图谱构建模块302,用于基于所述知识内容,构建知识图谱,所述知识图谱包括多个实体和关系;提问模块303,用于获取用户提问,并对所述用户提问进行分类,得到目标问题类别;查询模块304,用于基于所述目标问题类别、所述多个实体、所述关系,在所述知识图谱中查找目标答案,并将所述目标答案向提问的用户进行展示。
[0099] 本申请实施例中的自动答疑装置,通过预先配置的第三方库,从目标渠道中爬取与目标课程相关的知识内容,传统的人工收集和整理学习材料需要耗费大量时间和人力资源,而自动化的爬取工具可以在短时间内从多个来源(如在线课程平台、学术数据库、论坛等)获取最新的、相关性强的知识内容。随着新知识的不断产生,可以定期或实时地更新知识库,确保用户始终能够获得最新、最准确的信息。知识图谱将非结构化的文本信息转化为结构化的数据模型,明确表示了不同概念之间的关系(如"属于”、"相关”等)。这种结构化表示使得系统能够更精确地理解问题的语义背景,从而提供更加准确的答案。通过知识图谱,不仅能够识别单个实体,还能理解实体之间的关联,进而更好地把握问题的上下文,避免误解或模糊回答。通过对用户提问进行自动分类,可以快速确定问题的类型,从而选择最合适的方法来查找答案,避免了人工分类的时间延迟,提高了响应速度。知识图谱提供了高效的索引和查询机制,可以根据问题类别、实体和关系快速定位到相关的知识点。相比传统的全文搜索,这种方式能够更快地找到最相关的答案。本申请方案,从知识获取、分类、检索到展示都是自动化的,减少了人工干预,大大缩短了答疑的时间。用户可以即时获得答案,而不必等待教师或其他专家的回复;能够理解用户的提问意图并根据知识图谱进行精准匹配,可以根据每个用户的具体需求提供个性化的答案,而不是千篇一律的标准回复;每次答疑过程中生成的知识图谱和答案都可以被记录下来,形成一个不断增长的知识库。这些积累的知识可以用于未来的答疑,进一步提高智能性和准确性。
[0100] 本申请中关于自动答疑装置的具体实施例可以参考上述自动答疑方法中所示示例,本示例中在此不再赘述。
[0101] 在本申请的一实施例中,还提供了一种用于实施上述自动答疑方法的电子设备。该电子设备包括存储器和处理器,存储器中存储有计算机程序,处理器被设置为通过计算机程序执行上述的自动答疑方法。
[0102] 参见图4,图4是本申请的一示例性实施例示出的电子设备的结构示意图。计算机系统400包括中央处理单元(Central Processing Unit,CPU)401,其可以根据存储在只读存储器(Read-Only Memory,ROM)402中的程序或者从储存部分408升载到随机访问存储器(Random Access Memory,RAM)403中的程序而执行各种适当的动作和处理,例如执行上述实施例中所述的方法。在RAM 403中,还存储有系统操作所需的各种程序和数据。CPU 401、ROM 402以及RAM 403通过总线404彼此相连。输入 / 输出(Input / Output,I / O)接口405也连接至总线404。
[0103] 以下部件连接至I / O接口405:包括键盘、鼠标等的输入部分406;包括诸如阴极射线管(Cathode Ray Tube,CRT)、液晶显示器(Liquid Crystal Display,LCD)等以及扬声器等的输出部分407;包括硬盘等的储存部分408;以及包括诸如LAN(Local Area Network,局域网)卡、调制解调器等的网络接口卡的通信部分409。通信部分409经由诸如因特网的网络执行通信处理。驱动器410也根据需要连接至I / O接口405。可拆卸介质411,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器410上,以便于从其上读出的计算机程序根据需要被安装入储存部分408。
[0104] 特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的计算机程序。在这样的实施例中,该计算机程序可以通过通信部分409从网络上被下载和安装,和 / 或从可拆卸介质411被安装。在该计算机程序被中央处理单元(CPU)401执行时,执行本申请的系统中限定的各种功能。
[0105] 需要说明的是,本申请实施例所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的计算机程序。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的计算机程序可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。
[0106] 附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。其中,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
[0107] 描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。
[0108] 本申请的另一方面还提供了一种计算机可读存储介质,计算机可读存储介质包括存储的计算机程序,其中,计算机程序运行时执行上述的自动答疑方法。该计算机可读存储介质可以是上述实施例中描述的电子设备中所包含的,也可以是单独存在,而未装配入该电子设备中。
[0109] 本申请的另一方面还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述各个实施例中提供的自动答疑方法。
[0110] 上述实施例仅示例性说明本发明的原理及其功效,而非用于限制本发明。任何熟悉此技术的人士皆可在不违背本发明的精神及范畴下,对上述实施例进行修饰或改变。因此,但凡所属技术领域中具有通常知识者在未脱离本发明所揭示的精神与技术思想下所完成的一切等效修饰或改变,仍应由本发明的权利要求所涵盖。< / script>
Claims
1. An automatic question answering method, characterized in that: The method comprises: Crawling knowledge content related to the target course from the target channel through a pre-configured third-party library; Based on the knowledge content, construct a knowledge graph, wherein the knowledge graph includes multiple entities and relationships; Obtain user questions, and classify the user questions to obtain target question categories; Based on the target question category, the multiple entities, and the relationship, a target answer is searched in the knowledge graph, and the target answer is displayed to the user who asked the question.
2. The automatic question answering method according to claim 1, characterized in that: The crawling of knowledge content related to the target course from the target channel includes: Obtaining web page content in the target channel; Parsing the hypertext markup language in the webpage content, and crawling initial information related to the target course from the hypertext markup language through a crawler framework; Translating the initial information according to a preset language category to obtain intermediate information; The error information in the intermediate information is processed to obtain the knowledge content.
3. The automatic question answering method according to claim 2, characterized in that: The processing of the error information in the intermediate information includes: Performing translation detection on the translated information in the intermediate information, and retranslating the initial information when there are grammatical errors or misunderstandings in the translated information; The intermediate information is identified for errors through a preconfigured spell checker or format validator, and based on the result of the error identification, information in the intermediate information that is not related to the target course is deleted and / or duplicate information is merged.
4. The automatic question answering method according to claim 1, characterized in that: The step of constructing a knowledge graph based on the knowledge content includes: Identify the knowledge content, determine the course entities, concept entities, as well as belonging relationships and related relationships; Constructing a knowledge graph data model, wherein the knowledge graph data model includes the categories of the entities and the structures of the relationships; Based on the course entities, concept entities, belonging relationships and related relationships, the text information in the knowledge content is imported into the knowledge graph data model to construct a knowledge graph in a graphical form, wherein the nodes of the knowledge graph in a graphical form are the entities and the edges of the knowledge graph in a graphical form are the relationships.
5. The automatic question answering method according to claim 1, characterized in that: After obtaining the user's question, the method further includes: When the user question is in text form, decomposing the user question into separate words, identifying the part of speech and target entity in the words, analyzing the dependency relationship between the words in the sentence in the user question, determining the sentence structure, and determining the user question intention based on the part of speech, target entity, and sentence structure, and the user question intention is used to classify the user question; When the user question is in voice form, the user question is decomposed into separate words, the acoustic features in the words are extracted, the word sequence corresponding to the acoustic features is predicted through a pre-built language model, and the user question intention in text form is generated based on the word sequence. The user question intention in text form is used to classify the user question.
6. The automatic question answering method according to claim 1, characterized in that: The target question categories include fact inquiry, concept explanation, program operation, and comparative analysis.
7. The automatic question answering method according to claim 1, characterized in that: The searching for a target answer in the knowledge graph based on the target question category, the multiple entities, and the relationship includes: Based on the target question category, extract keywords, question entities, and question relations from the user's question, and convert the keywords, question entities, and question relations into structured query statements; Based on the structured query statement, determining a candidate answer set from the knowledge graph; Performing correlation analysis on multiple answers in the answer candidate set and the structured query statement, and generating a first ranked list according to the correlation analysis result; Performing context analysis on multiple answers in the answer candidate set, and generating a second ranked list according to the context analysis result; Based on the first ranked list and the second ranked list, the target answer is determined.
8. An automatic question-answering device, characterized in that: The device comprises: The crawling module is used to crawl knowledge content related to the target course from the target channel through a pre-configured third-party library; A knowledge graph construction module, used to construct a knowledge graph based on the knowledge content, wherein the knowledge graph includes multiple entities and relationships; A questioning module is used to obtain user questions and classify the user questions to obtain target question categories; A query module is used to search for a target answer in the knowledge graph based on the target question category, the multiple entities, and the relationship, and to display the target answer to the user who asked the question.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein the computer program executes the automatic question-answering method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to execute the automatic question-answering method according to any one of claims 1 to 7 through the computer program.