Method, device and equipment for analyzing document based on semantic reasoning and readable storage medium
By extracting key words of the document and determining their word relationships, the semantic structure of the document is directly generated, which solves the problem of low efficiency and accuracy of existing document parsing methods and achieves more efficient and accurate document parsing.
Patent Information
- Application Number
- CN202411386701.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-21
AI Technical Summary
Existing document parsing methods rely on manual tagging and complex tag library management, resulting in low parsing efficiency and accuracy.
By extracting the keyword set of the document to be parsed, and determining the word relationship of the keywords according to the grammar of the document, using a preset algorithm to summarize the semantic structure of the document, skipping tag parsing.
It improves the efficiency and accuracy of the document parsing process and reduces the complexity of manual intervention and tag library management.
Smart Images

Figure CN119337861A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of document parsing, and in particular, to a method, apparatus, device and readable storage medium for parsing documents based on semantic reasoning. Background Art
[0002] Currently, the parsing of standard documents is mostly done through their inherent format tags. After obtaining the standard text, the format tags are added to the standard text, and then the parsing process is performed to structure it.
[0003] In the above method, manual processing is required to manually tag, and errors are inevitable. For the parser, it is also necessary to constantly enrich the tag library to handle new format tags. This brings about the complexity of the parser structure.
[0004] Therefore, how to improve the efficiency and accuracy of the document parsing process is a technical problem that needs to be solved. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method for parsing documents based on semantic reasoning. The technical solution of the embodiments of the present application can achieve the effect of improving the efficiency and accuracy of the document parsing process.
[0006] In a first aspect, an embodiment of the present application provides a method for parsing documents based on semantic reasoning, comprising: extracting keywords of a document to be parsed according to preset keywords of the document to be parsed in the current language application scenario to obtain a keyword set; determining word relationships of keywords in the keyword set according to the grammar corresponding to the document to be parsed, wherein the word relationships include: at least one of logical relationships, connection relationships and sequential relationships; and aggregating keywords in the keyword set according to word relationships through a preset algorithm to obtain a semantic structure of the document to be parsed.
[0007] In the above embodiments, the present application uses the pure document content to deduce and parse its structure, which breaks away from the old path of tag-based parsing and no longer requires manual formatting of documents to complete parsing. Instead, the final document semantic structure is generated through the document's own lexical, grammatical and semantics, thereby achieving the effect of improving the efficiency and accuracy of the document parsing process.
[0008] In some embodiments, it is characterized in that before extracting the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario to obtain a keyword set, it also includes: defining corresponding defined keywords in different language application scenarios, wherein the language application scenarios include: machine language application scenarios, assembly language application scenarios or high-level language application scenarios; determining the current language application scenario and preset keywords according to the document language of the document to be parsed, wherein the document language includes: machine language, assembly language or high-level language.
[0009] In the above embodiments of the present application, by defining corresponding definition keywords in different language application scenarios, the words of the document can be directly analyzed according to the language application scenarios during the lexical analysis process, thereby achieving an accurate lexical analysis effect.
[0010] In some embodiments, the word relationships of the key words in the key word set are determined according to the grammar corresponding to the document to be parsed, including: obtaining the grammar corresponding to the document language according to the document language of the document to be parsed; and analyzing the word relationships of the key words in the key word set through grammar analysis.
[0011] In the above-mentioned embodiments of the present application, by performing grammatical analysis of the document to be parsed through the language of the document to be parsed, the word relationship of the key words in the document to be parsed can be accurately obtained.
[0012] In some embodiments, keywords in a keyword set are summarized according to word relationships through a preset algorithm to obtain the semantic structure of the document to be parsed, including: semantically checking and summarizing keywords in a keyword set according to word relationships through an inference algorithm to obtain the semantic structure of the document to be parsed.
[0013] In the above-mentioned embodiments of the present application, the semantic analysis of the document to be parsed can be accurately performed through the inference algorithm to obtain the final semantic structure of the document.
[0014] In a second aspect, an embodiment of the present application provides a device for parsing a document based on semantic reasoning, comprising:
[0015] The lexical analysis module is used to extract the key words of the document to be parsed according to the preset key words of the document to be parsed in the current language application scenario to obtain a key word set;
[0016] A syntax analysis module, used to determine the word relationship of the key words in the key word set according to the syntax corresponding to the document to be parsed, wherein the word relationship includes: at least one of a logical relationship, a connection relationship and a sequence relationship;
[0017] The semantic analysis module is used to summarize the key words in the key word set according to the word relationship through a preset algorithm to obtain the semantic structure of the document to be parsed.
[0018] Optionally, the device further comprises:
[0019] A definition module is used for the lexical analysis module to extract the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario, and before obtaining the keyword set, to define the corresponding definition keywords in different language application scenarios, wherein the language application scenarios include: machine language application scenarios, assembly language application scenarios or high-level language application scenarios;
[0020] According to the document language of the document to be parsed, the current language application scenario and preset keywords are determined, wherein the document language includes: machine language, assembly language or high-level language.
[0021] Optionally, the syntax analysis module is specifically used to:
[0022] According to the document language of the document to be parsed, obtain the grammar corresponding to the document language;
[0023] The word relationship of the key words in the key word set is analyzed by grammar.
[0024] Optionally, the semantic analysis module is specifically used for:
[0025] The inference algorithm is used to semantically check and summarize the keywords in the keyword set according to the word relationship to obtain the semantic structure of the document to be parsed.
[0026] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method provided in the first aspect are performed.
[0027] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the method provided in the first aspect are performed.
[0028] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A flowchart of a method for parsing documents based on semantic reasoning provided in an embodiment of the present application;
[0031] Figure 2 A flowchart of an implementation method for parsing documents based on semantic reasoning provided in an embodiment of the present application;
[0032] Figure 3 A schematic block diagram of a device for parsing documents based on semantic reasoning provided in an embodiment of the present application;
[0033] Figure 4 A schematic diagram of the structure of a device for parsing documents based on semantic reasoning provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0035] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0036] The present application is applied to the scenario of document parsing, and the specific scenario is to parse the document by performing lexical analysis, grammatical analysis and semantic analysis on the document.
[0037] At present, the parsing of standard documents is mostly done through the internal format tags. After obtaining the standard text, the format tags are added to the standard text, and then the parsing process is performed to structure it. In the above method, manual processing is required. Errors are inevitable when labeling manually. For the parser, it is also necessary to constantly enrich the tag library to handle the newly appeared format tags. This brings about the complexity of the parser structure.
[0038] To this end, the present application extracts the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario to obtain a keyword set; determines the word relationship of the keywords in the keyword set according to the grammar corresponding to the document to be parsed, wherein the word relationship includes: at least one of a logical relationship, a connection relationship and a sequence relationship; summarizes the keywords in the keyword set according to the word relationship through a preset algorithm to obtain the semantic structure of the document to be parsed. The method of using pure document content to deduce and parse its structure jumps out of the old path of tag-based parsing, and there is no need to manually format the document to complete the parsing. Instead, the final document semantic structure is generated through the lexical, grammatical and semantics of the document itself, so as to improve the efficiency and accuracy of the document parsing process.
[0039] In an embodiment of the present application, the execution subject may be a semantic reasoning-based document parsing device in a semantic reasoning-based document parsing system. In actual applications, the semantic reasoning-based document parsing device may be an electronic device such as a terminal device or a server, and no limitation is made here.
[0040] Combine the following Figure 1 The method for parsing documents based on semantic reasoning in an embodiment of the present application is described in detail.
[0041] Please see Figure 1 , Figure 1 A flowchart of a method for parsing documents based on semantic reasoning provided in an embodiment of the present application, such as Figure 1 The method for parsing documents based on semantic reasoning shown includes:
[0042] Step 110: extracting keywords of the document to be parsed according to preset keywords of the document to be parsed in the current language application scenario to obtain a keyword set.
[0043] The documents to be parsed include but are not limited to documents in formats such as TXT, PDF, DOC, DOCX, XLSX, Markdown, RTF, CSV, HTML, XML, and PPT. The preset keywords include information such as the category, attributes, and specific keywords of the keywords.
[0044] In some embodiments of the present application, it is characterized in that before extracting the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario to obtain the keyword set, Figure 1 The method shown also includes: defining corresponding definition keywords under different language application scenarios, wherein the language application scenarios include: machine language application scenarios, assembly language application scenarios or high-level language application scenarios; determining the current language application scenario and preset keywords according to the document language of the document to be parsed, wherein the document language includes: machine language, assembly language or high-level language.
[0045] In the above process, the present application defines corresponding key words in different language application scenarios, and can directly analyze the words of the document according to the language application scenarios during the lexical analysis process to achieve accurate lexical analysis.
[0046] The current language application scenario is one of the language application scenarios, and different preset keywords are defined correspondingly for different language application scenarios.
[0047] Optionally, define corresponding keywords in different language application scenarios, for example, define keywords such as document title, cover metadata, chapter and sub-chapter that appear in special document formats, including numerical chapters, chapter or section numbers, etc.
[0048] Step 120: Determine the word relationship of the key words in the key word set according to the grammar corresponding to the document to be parsed.
[0049] The word relationship includes at least one of a logical relationship, a connection relationship and a sequence relationship. The grammar includes a markup language, a hypertext markup language, a Word document language, a requirement document grammar and a grammar combining R language and Markdown.
[0050] In some embodiments of the present application, word relationships among key words in a key word set are determined based on the grammar corresponding to the document to be parsed, including: obtaining the grammar corresponding to the document language based on the document language of the document to be parsed; and analyzing the word relationships among key words in the key word set through grammar analysis.
[0051] In the above process, the present application performs grammatical analysis of the document to be parsed through the language of the document to be parsed, so as to accurately obtain the word relationship of the key words in the document to be parsed.
[0052] Among them, different document languages may correspond to one or more grammars.
[0053] Optionally, word relationships of key words in the key word set are determined by grammatical analysis, including marking word relationships according to a grammatical structure, and determining word relationships of key words in the document to be parsed.
[0054] Step 130: Summarize the keywords in the keyword set according to word relationships using a preset algorithm to obtain the semantic structure of the document to be parsed.
[0055] The preset algorithm may use an inference algorithm. The semantic structure includes the lexical connection relationship and the semantic connection relationship of the keywords.
[0056] In some embodiments of the present application, keywords in a keyword set are summarized according to word relationships through a preset algorithm to obtain the semantic structure of the document to be parsed, including: semantically checking and summarizing the keywords in the keyword set according to word relationships through an inference algorithm to obtain the semantic structure of the document to be parsed.
[0057] In the above process, the present application can accurately perform semantic analysis on the document to be parsed through the inference algorithm to obtain the final semantic structure of the document.
[0058] The semantic check includes the order, logic and connection of words. Keywords can be summarized according to word relationships in a structure tree, for example, with chapter keywords as parent nodes and sub-chapter keywords as child nodes.
[0059] In the above Figure 1 In the process shown, the present application extracts the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario to obtain a keyword set; determines the word relationship of the keywords in the keyword set according to the grammar corresponding to the document to be parsed, wherein the word relationship includes: at least one of a logical relationship, a connection relationship and a sequence relationship; summarizes the keywords in the keyword set according to the word relationship through a preset algorithm to obtain the semantic structure of the document to be parsed. The method of using pure document content to deduce and parse its structure jumps out of the old path of tag-based parsing, and there is no need to manually format the document to complete the parsing. Instead, the final document semantic structure is generated through the lexical, grammatical and semantics of the document itself, so as to improve the efficiency and accuracy of the document parsing process.
[0060] Combine the following Figure 2 The implementation method of document parsing based on semantic reasoning in an embodiment of the present application is described in detail.
[0061] Please see Figure 2 , Figure 2 A flowchart of an implementation method of parsing documents based on semantic reasoning provided in an embodiment of the present application, such as Figure 2 The implementation method of parsing documents based on semantic reasoning shown includes:
[0062] The following is an example of parsing a specific document.
[0063] Step 210: Lexical analysis.
[0064] Specific: Define keywords for special document formats, and search for document titles, cover metadata, prefaces, chapters, sub-chapter, chapter numbers, and chapter contents based on the keywords.
[0065] Step 220: Syntax analysis.
[0066] Specifically: According to the field of the document, sort out the grammar of the keywords, and fix this grammar into the algorithm with code. The algorithm analyzes the relationship between the keywords. The relationship can be inclusion relationship and sequential relationship, etc. Inclusion relationship, for example, the main chapter includes sub-chapters, sequential relationship, for example, the first chapter is connected to the second chapter.
[0067] Step 230: semantic analysis.
[0068] Specifically: Based on the semantic composition of the document, the specific structure of the document is inferred through an inference algorithm, and then a directory tree is generated.
[0069] Figure 2 For example, for standard documents, the numerical chapters or string templates such as chapter number and section number are keywords in the lexical structure. The numbers of the chapters below the chapter number must be continuous, which is the grammatical requirement of this document. The second chapter must be a referenced chapter, and the references of this article are summarized, which is a semantic requirement. Based on this lexical, grammatical and semantic analysis and judgment, the document structure can be intelligently derived.
[0070] also, Figure 2 The specific methods and steps shown can be found in Figure 1 The method shown will not be described in detail here.
[0071] Previous article Figure 1-Figure 2 Describes a method for parsing documents based on semantic reasoning. Figure 3-Figure 4 An apparatus for parsing documents based on semantic reasoning is described.
[0072] Please refer to Figure 3 , is a schematic block diagram of a device 300 for parsing documents based on semantic reasoning provided in an embodiment of the present application, and the device 300 may be a module, program segment or code on an electronic device. Figure 1 The method embodiment corresponds to and can be executed Figure 1The various steps involved in the method embodiment and the specific functions of the device 300 can be found in the description below. To avoid repetition, the detailed description is appropriately omitted here.
[0073] Optionally, the device 300 includes:
[0074] The lexical analysis module 310 is used to extract the key words of the document to be parsed according to the preset key words of the document to be parsed in the current language application scenario to obtain a key word set;
[0075] The syntax analysis module 320 is used to determine the word relationship of the key words in the key word set according to the syntax corresponding to the document to be parsed, wherein the word relationship includes at least one of a logical relationship, a connection relationship and a sequence relationship;
[0076] The semantic analysis module 330 is used to summarize the keywords in the keyword set according to word relationships through a preset algorithm to obtain the semantic structure of the document to be parsed.
[0077] Optionally, the device further comprises:
[0078] A definition module is used for the lexical analysis module to extract the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario, and before obtaining the keyword set, to define the corresponding definition keywords in different language application scenarios, wherein the language application scenario includes: machine language application scenario, assembly language application scenario or high-level language application scenario; according to the document language of the document to be parsed, determine the current language application scenario and preset keywords, wherein the document language includes: machine language, assembly language or high-level language.
[0079] Optionally, the syntax analysis module is specifically used to:
[0080] According to the document language of the document to be parsed, the grammar corresponding to the document language is obtained; and the word relationship of the key words in the key word set is analyzed through the grammar.
[0081] Optionally, the semantic analysis module is specifically used for:
[0082] The inference algorithm is used to semantically check and summarize the keywords in the keyword set according to the word relationship to obtain the semantic structure of the document to be parsed.
[0083] Please refer to Figure 4 4 is a schematic block diagram of a device for parsing documents based on semantic reasoning provided in an embodiment of the present application. The device may include a memory 410 and a processor 420. Optionally, the device may also include: a communication interface 430 and a communication bus 440. The device is similar to the above Figure 1 The method embodiment corresponds to and can be executed Figure 1 The various steps involved in the method embodiment and the specific functions of the device can be found in the description below.
[0084] Specifically, the memory 410 is used to store computer-readable instructions.
[0085] Processor 420 is used to process the readable instructions stored in the memory and can execute Figure 1 The steps in the method.
[0086] The communication interface 430 is used for signaling or data communication with other node devices, for example, for communication with a server or a terminal, or for communication with other device nodes, but the embodiments of the present application are not limited thereto.
[0087] The communication bus 440 is used to realize direct connection and communication among the above components.
[0088] The communication interface 430 of the device in the embodiment of the present application is used to communicate signals or data with other node devices. The memory 410 can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 410 can also be at least one storage device located away from the aforementioned processor. The memory 410 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 420, the electronic device executes the aforementioned Figure 1 The method process shown. The processor 420 can be used on the device 300 and is used to perform the functions in the present application. Exemplarily, the above-mentioned processor 420 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and the embodiments of the present application are not limited thereto.
[0089] The embodiment of the present application also provides a readable storage medium, when the computer program is executed by a processor, Figure 1 The method process in the method embodiment shown is executed by the electronic device.
[0090] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.
[0091] In summary, the embodiments of the present application provide a method, apparatus, device and readable storage medium for parsing documents based on semantic reasoning, the method comprising: extracting the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario to obtain a keyword set; determining the word relationship of the keywords in the keyword set according to the grammar corresponding to the document to be parsed, wherein the word relationship includes: at least one of a logical relationship, a connection relationship and a sequence relationship; and summarizing the keywords in the keyword set according to the word relationship through a preset algorithm to obtain the semantic structure of the document to be parsed. This method can achieve the effect of improving the efficiency and accuracy of the document parsing process.
[0092] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0093] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0094] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0095] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0096] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0097] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for parsing documents based on semantic reasoning, characterized in that: include: Extracting keywords of the document to be parsed according to preset keywords of the document to be parsed in the current language application scenario to obtain a keyword set; Determine the word relationship of the key words in the key word set according to the grammar corresponding to the document to be parsed, wherein the word relationship includes: at least one of a logical relationship, a connection relationship and a sequence relationship; The key words in the key word set are summarized according to the word relationship through a preset algorithm to obtain the semantic structure of the document to be parsed.
2. The method according to claim 1, characterized in that: Before extracting the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario to obtain the keyword set, the method further includes: Defining corresponding definition keywords in different language application scenarios, wherein the language application scenarios include: machine language application scenarios, assembly language application scenarios or high-level language application scenarios; The current language application scenario and the preset keyword are determined according to the document language of the document to be parsed, wherein the document language includes: machine language, assembly language or high-level language.
3. The method according to claim 1 or 2, characterized in that: The step of determining the word relationship of the key words in the key word set according to the grammar corresponding to the document to be parsed includes: According to the document language of the document to be parsed, acquiring the grammar corresponding to the document language; The word relationships of the key words in the key word set are analyzed by the grammar.
4. The method according to claim 1 or 2, characterized in that: The step of aggregating the keywords in the keyword set according to the word relationship by a preset algorithm to obtain the semantic structure of the document to be parsed includes: The keyword words in the keyword word set are semantically checked and summarized according to the word relationship through an inference algorithm to obtain the semantic structure of the document to be parsed.
5. A device for parsing documents based on semantic reasoning, characterized in that: include: The lexical analysis module is used to extract the key words of the document to be parsed according to the preset key words of the document to be parsed in the current language application scenario to obtain a key word set; A syntax analysis module, used to determine the word relationship of the key words in the key word set according to the syntax corresponding to the document to be parsed, wherein the word relationship includes: at least one of a logical relationship, a connection relationship and a sequence relationship; The semantic analysis module is used to summarize the key words in the key word set according to the word relationship through a preset algorithm to obtain the semantic structure of the document to be parsed.
6. The device according to claim 5, characterized in that The device also includes: A definition module, used for the lexical analysis module to extract the keywords of the document to be parsed according to the preset keywords of the document to be parsed in the current language application scenario, before obtaining the keyword set, to define the corresponding definition keywords in different language application scenarios, wherein the language application scenario includes: a machine language application scenario, an assembly language application scenario or a high-level language application scenario; The current language application scenario and the preset keyword are determined according to the document language of the document to be parsed, wherein the document language includes: machine language, assembly language or high-level language.
7. The device according to claim 5 or 6, characterized in that The syntax analysis module is specifically used for: According to the document language of the document to be parsed, acquiring the grammar corresponding to the document language; The word relationships of the key words in the key word set are analyzed by the grammar.
8. The device according to claim 5 or 6, characterized in that The semantic analysis module is specifically used for: The keyword words in the keyword word set are semantically checked and summarized according to the word relationship through an inference algorithm to obtain the semantic structure of the document to be parsed.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 4 are executed.
10. A computer-readable storage medium, characterized in that: include: A computer program, when the computer program is run on a computer, causes the computer to execute the method according to any one of claims 1 to 4.