Document analysis method and device
By identifying and parsing project keywords in health field inspection reports and using a document parser to process documents in different formats, the problem of messy report styles is solved, the style is unified, and the user experience and analysis efficiency are improved.
Patent Information
- Application Number
- CN202310265955.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2024-09-20
AI Technical Summary
The health field inspection reports provided by different data platforms are messy and inconsistent, which increases the reading and analysis costs for users.
By identifying the project keywords in the target document, use the corresponding document parser to parse the content of each project, and generate unified document parsing results, thereby achieving unified processing of documents in different formats.
It improves the analysis efficiency and user experience of document content, simplifies the processing and analysis of documents in different formats, and improves service quality.
Smart Images

Figure CN118675679A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of digital medical health technology, specifically to the field of document parsing technology, and more particularly to a document parsing method and device. Background Art
[0002] Documents can be in a variety of formats, and different data platforms often provide very different document styles.
[0003] For example, in the health field, physical examination service agencies, hospitals and other platforms all have a large number of tests, which can generate examination reports. However, the examination reports of a large number of platforms are messy and inconsistent in style, which increases the reading and analysis costs of users. Summary of the invention
[0004] Provided are a document parsing method, device, electronic device and storage medium.
[0005] According to a first aspect, a document parsing method is provided, comprising: in response to receiving a parsing task for a target document, determining project keywords for each project in the target document according to format-related information of the target document, wherein the project keywords include start keywords and end keywords; determining document content for each project in the target document according to the project keywords, wherein each project corresponds to at least one document parser; for each project, parsing the document content of the project using the document parser corresponding to the project to obtain a project parsing result for the project; and generating a parsing result for the target document from the project parsing results for each project in the target document.
[0006] According to a second aspect, a document parsing device is provided, comprising: a keyword determination unit, configured to determine, in response to receiving a parsing task for a target document, project keywords for each project in the target document according to format-related information of the target document, wherein the project keywords include start keywords and end keywords; a project determination unit, configured to determine the document content of each project in the target document according to the project keywords, wherein each project corresponds to at least one document parser; a parsing unit, configured to parse the document content of each project using the document parser corresponding to the project to obtain a project parsing result for the project; and a generating unit, configured to generate a parsing result of the target document from the project parsing results of each project in the target document.
[0007] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of any embodiment of the document parsing method.
[0008] According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute a method according to any embodiment of the document parsing method.
[0009] According to a fifth aspect, a computer program product is provided, comprising a computer program, which implements a method according to any embodiment of the document parsing method when executed by a processor.
[0010] According to the solution disclosed in the present invention, documents of different formats can be processed in a unified manner, which is convenient for subsequent analysis of document content and provision of services to users. By displaying documents with a unified style, it helps to improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0012] Figure 1 is an exemplary system architecture diagram in which some embodiments of the present disclosure may be applied;
[0013] Figure 2a is a flow chart of an embodiment of a method for parsing a document according to the present disclosure;
[0014] Figure 2b is a schematic diagram of a parser in a document parsing method according to the present disclosure;
[0015] Figure 3a is a schematic diagram of an application scenario of the document parsing method according to the present disclosure;
[0016] Figure 3b is a schematic diagram of an application scenario of the document parsing method according to the present disclosure;
[0017] Figure 4 is a flowchart of an embodiment of a method for determining format-related information according to the present disclosure;
[0018] Figure 5 is a schematic structural diagram of an embodiment of a document parsing device according to the present disclosure;
[0019] Figure 6 It is a block diagram of an electronic device used to implement the document parsing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0021] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved all comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of a document parsing method or a document parsing apparatus of the present disclosure can be applied.
[0024] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0025] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as video applications, live broadcast applications, instant messaging tools, email clients, social platform software, etc.
[0026] The terminal devices 101, 102, 103 here can be hardware or software. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0027] The server 105 may be a server that provides various services, such as a background server that provides support for the terminal devices 101, 102, and 103. The background server may parse the target document indicated by the parsing task and feed back the processing result (such as the parsing result of the target document) to the terminal device.
[0028] It should be noted that the document parsing method provided in the embodiment of the present disclosure may be executed by the server 105 or the terminal devices 101 , 102 , 103 , and accordingly, the document parsing device may be arranged in the server 105 or the terminal devices 101 , 102 , 103 .
[0029] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0030] Continue to refer Figure 2a , shows a process 200 of an embodiment of a document parsing method according to the present disclosure. The document parsing method comprises the following steps:
[0031] Step 201, in response to receiving a parsing task for a target document, determining project keywords for each project in the target document according to format-related information of the target document, wherein the project keywords include a start keyword and an end keyword.
[0032] In this embodiment, the document parsing method runs on the execution subject (eg Figure 1 If the server or terminal device shown in the figure receives the parsing task of the target document, it can obtain the project keywords of each project in the target document according to the format-related information of the target document.
[0033] In practice, the document in the present disclosure may be various inspection reports, such as a physical examination report. In addition, the document may also be an electronic publication, in which the items are sections, such as an entertainment section, a news section, and the like.
[0034] Taking the examination report as an example, the items in it are examination items. For example, the items in the physical examination report can include personal information, internal medicine, surgery, and general examination. Format-related information refers to information that affects the document format (such as typesetting format). For example, format-related information can include the brand logo corresponding to the document. For example, if the document is a physical examination report, the brand logo is the name of the physical examination institution.
[0035] The start keyword is the keyword at the start position of the item, and the end keyword is the keyword at the end position of the item. For example, the start keyword of the personal information item can be "unit name", and the end keyword can be "report description". The start keyword of the general examination item can be "general examination", and the end keyword can be "examiner". The start keyword of the internal medicine item can be "internal medicine", and the end keyword can be "examiner". The start keyword of the abnormality item is "abnormality interpretation", and the end keyword is "summary analysis".
[0036] In practice, the execution subject may determine the project keywords of each item in the target document according to the format-related information of the target document in various ways. For example, the execution subject may use a preset project keyword model, input the format-related information of the target document into the project keyword model, and obtain the keywords of each item output from the model. The project keyword model may generate keywords of each item in the target document by using the format-related information of the target document.
[0037] Step 202, determining the document content of each item in the target document according to the item keywords, wherein each item corresponds to at least one document parser.
[0038] In this embodiment, the execution subject may determine the document content of each project in the target document according to the project keyword of each project. Specifically, the execution subject may group the content of the target document according to the project keyword, thereby determining the document content of the project.
[0039] Specifically, the target document may be a document in PDF (Portable Document Format). The execution subject may parse the target document into Object data to obtain an Object data set. Furthermore, the execution subject may determine the document content of each item in the Object data set, i.e., an Object data subset.
[0040] Each of the projects has at least one corresponding document resolver. The document resolver is used to parse data of different formats in the target document. For example, electrocardiograms and cervical spine films correspond to different document resolvers.
[0041] like Figure 2b As shown, the figure shows a document parser corresponding to personal information items, a document parser corresponding to abnormal items, and a document parser corresponding to both internal medicine items and general examination items.
[0042] Step 203: For each project, the document content of the project is parsed using the document parser corresponding to the project to obtain a project parsing result of the project.
[0043] In this embodiment, the execution subject may parse the document content of each project using at least one document parser corresponding to the project to obtain the project parsing result of the project. Specifically, the execution subject may parse the object data subset of the project using at least one document parser corresponding to the project to obtain the project parsing result of the project.
[0044] Step 204: Generate a parsing result of the target document based on the item parsing results of each item in the target document.
[0045] In this embodiment, the execution subject may generate the target document's parsing result from the project parsing results of each project in the target document. For example, the execution subject may summarize, i.e., aggregate, the project parsing results of each project to generate the target document's parsing result. Alternatively, the execution subject may input the project parsing results of each project into a specified result generation model to obtain the target document's parsing result output from the model. The model may generate the target document's parsing result using the project parsing results of each project in the target document.
[0046] The method provided by the above embodiment of the present disclosure can unify the processing of documents of different formats, which is convenient for subsequent analysis of document content and provision of services to users. By displaying documents with a unified style, it helps to improve the user experience.
[0047] In some optional implementations of this embodiment, the format-related information includes a brand logo and a document version; based on the format-related information of the target document, the project keywords of each item in the target document are determined, including: determining the project keywords corresponding to the brand logo and the document version of the target document as the project keywords of each item in the target document.
[0048] In these optional implementations, format-related information may include not only brand logos, but also document versions. Taking the document as a physical examination report as an example, the document corresponding to the same physical examination institution, that is, the same brand logo, may have updated many versions. For example, in different versions of documents, the position of the same element (such as the title "Internal Medicine") may be offset. For example, the first page of the physical examination report of version 1 of brand logo A has "Physical Examination Customer Name" at height: 220, left: 110, and there is no photo of the customer for the examination in version 1. The same position of the first page of version 2, height: 220, left: 110, has the customer's photo for the examination, and the first page of version 2 report, height: 285, left: 180, has "Physical Examination Customer Name".
[0049] There are corresponding project keywords for brand logos and document versions. For example, the project keywords corresponding to version 1 of brand logo A include: the start keyword "abnormal situation" and the end keyword "summary analysis" of the abnormal project module. The project keywords corresponding to version 2 of brand logo A include: the start keyword "abnormal interpretation" and the end keyword "summary analysis" of the abnormal project module. The project keywords corresponding to version X of brand logo B include: the start keyword "internal medicine examination" and the end keyword "inspector" of the internal medicine project module. The project keywords corresponding to version Y of brand logo B include: the start keyword "internal medicine" and the end keyword "inspector" of the internal medicine project module.
[0050] These implementation methods can accurately find the project keywords of each project through the project keywords corresponding to the brand logo and document version, which helps to improve the accuracy of document parsing results.
[0051] Continue to see Figure 3a , Figure 3a FIG. 1 is a schematic diagram of an application scenario of the document parsing method according to this embodiment. Figure 3a In the application scenario determined by the brand logo, the execution subject can determine whether there is a brand logo in the parsing task. If not, the execution subject uses PDFBox to parse the document into a DOM (Document Object Model) format tree DomTree. Then, the DomTree is converted into a Java object collection, and the brand is parsed using the brand parser to obtain the brand logo.
[0052] Continue to see Figure 3b , Figure 3b FIG. 1 is a schematic diagram of an application scenario of the document parsing method according to this embodiment. Figure 3bIn the application scenario where the document version is determined, the execution subject can determine whether the document has been parsed into a Java object set. If not, the execution subject uses PDFBox to parse the file into a DomTree, and converts the DomTree into a preset programming language Java (Japanese Vexillological Association) object set. The version parser parses the version to obtain the document version. Specifically, the process of parsing the version may include: when the brand logo is determined, the execution subject may traverse and search for the version keywords corresponding to the brand logo (such as brand logo A). When the brand logo is not determined, the execution subject may traverse and search for the version keywords corresponding to each brand logo (such as brand logo A and brand logo B).
[0053] Further references Figure 4 , which shows a process 400 for determining format-related information. The process 400 includes the following steps:
[0054] Step 401 , in response to the absence of a brand logo of a target document in the parsing task, converting the target document from a PDF format into a DOM format tree to obtain a DOM document.
[0055] In this embodiment, the document parsing method runs on the execution subject (eg Figure 1 The server or terminal device shown in the figure can determine the brand logo corresponding to the document through the document when the brand logo of the target document does not exist in the parsing task. Specifically, the format of the target document is PDF format, and the above execution subject can convert the format of the target document into a DOM format tree, and use the result of the conversion as a DOM document.
[0056] Step 402: Convert the DOM document into a Java object to generate a Java object set.
[0057] In this embodiment, the execution subject may continue to convert the format of the document, specifically converting the DOM document into a Java object, and the generated conversion result is a Java object set composed of various Java objects.
[0058] Step 403: Use the brand resolver to traverse and search for each preset brand logo in the Java object collection.
[0059] In this embodiment, the execution subject may utilize a brand parser to parse out the brand logo. Specifically, the brand parser may traverse the Java object set of the target document to search for each preset brand logo.
[0060] Step 404: in response to finding any brand logo, determine the brand logo as the brand logo of the target document.
[0061] In this embodiment, if the execution subject finds any preset brand logo, the found brand logo is determined as the brand logo of the target document.
[0062] For example, the preset brand logos include brand logo A, brand logo B, brand logo C, and brand logo D. The execution subject searches whether the Java object collection includes brand logo A. If brand logo A is not included, the execution subject searches whether the Java object collection includes brand logo B. If brand logo B is found, the search stops and brand logo B is used as the brand logo of the target document.
[0063] This embodiment can determine the brand logo of the document through the document itself, thereby facilitating the determination of accurate project keywords using the brand logo.
[0064] Optionally, the step of determining format-related information also includes: in response to the document version of the target document not existing in the parsing task, using a version parser to traverse a Java object collection to search for each preset version keyword corresponding to the brand logo of the target document; in response to finding any version keyword, determining the document version indicated by the version keyword as the document version of the target document.
[0065] In this embodiment, the version parser in the present disclosure can be used only to parse the version, or it can also be a parser for parsing the brand and version. Specifically, each brand logo has a corresponding preset version keyword. When the brand logo of the target document is determined, the above-mentioned execution subject traverses the Java object collection to find out whether there is a version keyword corresponding to the brand logo. Alternatively, when the brand logo is not determined, the above-mentioned execution subject can traverse the Java object collection to find out whether there is a version keyword corresponding to each brand logo.
[0066] Once a version keyword is found, the execution subject determines the version keyword as the document version of the target document.
[0067] These implementations can determine the brand identity of the document through the brand identity, thereby helping to determine accurate project keywords using the brand identity.
[0068] In some optional implementations of the present disclosure, the method also includes: in response to receiving a parsing task for a target document, performing at least one of the following verification operations: determining whether the download link of the target document is valid, and determining whether there are duplicate creation tasks for the parsing task; in response to passing the above verification operation, persisting the parsing task, and updating the parsing task status to parsing.
[0069] In these optional implementations, the execution subject may perform a verification operation upon receiving a parsing task for a target document. Specifically, the verification operation may include determining whether the download link of the target document is valid, and may also include determining whether there is a duplicate creation task for the parsing task. The existence of a duplicate creation task means that the parsing task is a duplicate request, and a parsing task has been created before.
[0070] Specifically, when the verification operation includes the first item, i.e., determining whether the download link of the target document is valid, if it is determined that the download link of the target document is valid, the first verification operation is passed. The download link is valid means that the document can be downloaded normally. When the verification operation includes the second item, i.e., determining whether there are duplicate creation tasks for the parsing task, if it is determined that there are no duplicate creation tasks for the parsing task, the second verification operation is passed.
[0071] After the verification operation is passed, the parsing task is persisted and the parsing task status is updated to parsing, so that error rollback and parsing retry can be performed in case of task parsing failure.
[0072] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a document parsing device, which corresponds to the method embodiment shown in Figure 2. In addition to the features described below, the device embodiment may also include the same or corresponding features or effects as the method embodiment shown in Figure 2. The device can be specifically applied to various electronic devices.
[0073] like Figure 5 As shown, the document parsing device 500 of this embodiment includes: a keyword determination unit 501, an item determination unit 502, a parsing unit 503 and a generating unit 504. The keyword determination unit 501 is configured to determine the item keywords of each item in the target document according to the format-related information of the target document in response to receiving the parsing task of the target document; wherein the item keywords include a start keyword and an end keyword; the item determination unit 502 is configured to determine the document content of each item in the target document according to the item keywords, wherein each item corresponds to at least one document parser; the parsing unit 503 is configured to parse the document content of each item using the document parser corresponding to the item to obtain the item parsing result of the item; the generating unit 504 is configured to generate the parsing result of the target document from the item parsing results of each item in the target document.
[0074] In this embodiment, the specific processing of the keyword determination unit 501, the item determination unit 502, the parsing unit 503 and the generation unit 504 of the document parsing device 500 and the technical effects brought about by them can be respectively referred to the relevant descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment of Figure 2, and will not be repeated here.
[0075] In some optional implementations of this embodiment, the format-related information includes a brand logo and a document version; the keyword determination unit is further configured to determine the project keywords of each item in the target document based on the format-related information of the target document in the following manner: the project keywords corresponding to the brand logo and the document version of the target document are determined as the project keywords of each item in the target document.
[0076] In some optional implementations of this embodiment, the step of determining format-related information includes: in response to the absence of a brand logo of the target document in the parsing task, converting the target document from PDF format to a DOM format tree to obtain a DOM document; converting the DOM document to a Java object to generate a Java object collection; using a brand parser to traverse the Java object collection to search for each preset brand logo; in response to finding any brand logo, determining the brand logo as the brand logo of the target document.
[0077] In some optional implementations of the present embodiment, the step of determining format-related information also includes: in response to the document version of the target document not existing in the parsing task, using a version parser to traverse a Java object collection to search for each preset version keyword corresponding to the brand logo of the target document; in response to finding any version keyword, determining the document version indicated by the version keyword as the document version of the target document.
[0078] In some optional implementations of this embodiment, the device also includes: a first verification unit, configured to perform at least one of the following verification operations in response to receiving a parsing task for a target document: determining whether the download link of the target document is valid, and determining whether there are duplicate creation tasks for the parsing task; a second verification unit, configured to persist the parsing task in response to the verification operation, and update the parsing task status to parsing.
[0079] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0080] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0081] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0082] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0083] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the parsing method of the document. For example, in some embodiments, the parsing method of the document may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the parsing method of the document described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the parsing method of the document in any other appropriate manner (e.g., by means of firmware).
[0084] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0085] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0086] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0087] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0088] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0089] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0090] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0091] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A document parsing method, the method comprising: In response to receiving a parsing task for a target document, determining project keywords for each project in the target document according to format-related information of the target document; wherein the project keywords include a start keyword and an end keyword; Determining the document content of each item in the target document according to the item keywords, wherein each item corresponds to at least one document parser; For each project, the document content of the project is parsed using the document parser corresponding to the project to obtain the project parsing result of the project; The parsing result of the target document is generated based on the item parsing results of each item in the target document.
2. The method according to claim 1, wherein: The format-related information includes brand identification and document version; The step of determining the project keywords of each project in the target document according to the format-related information of the target document includes: The project keywords corresponding to the brand logo and the document version of the target document are determined as the project keywords of each project in the target document.
3. The method according to claim 1, wherein: The step of determining the format-related information comprises: In response to the absence of the brand logo of the target document in the parsing task, converting the target document from a portable document format (PDF) to a document object model (DOM) format tree to obtain a DOM document; Convert the DOM document into a Java object in a preset programming language to generate a Java object set; Using a brand parser to traverse and search for each preset brand logo in the Java object collection; In response to finding any brand identifier, the brand identifier is determined as the brand identifier of the target document.
4. The method according to claim 3, wherein: The step of determining the format-related information further includes: In response to the document version of the target document not existing in the parsing task, using a version parser to traverse the Java object collection to search for each preset version keyword corresponding to the brand logo of the target document; In response to finding any version keyword, the document version indicated by the version keyword is determined as the document version of the target document.
5. The method according to claim 1, wherein: The method further comprises: In response to receiving a parsing task for a target document, performing at least one of the following verification operations: determining whether a download link of the target document is valid, and determining whether there is a duplicate creation task for the parsing task; In response to passing the verification operation, the parsing task is persisted and the parsing task status is updated to parsing.
6. A document parsing device, the device comprising: A keyword determination unit is configured to, in response to receiving a parsing task for a target document, determine, according to format-related information of the target document, project keywords for each project in the target document; wherein the project keywords include a start keyword and an end keyword; an item determination unit, configured to determine the document content of each item in the target document according to the item keywords, wherein each item corresponds to at least one document parser; The parsing unit is configured to parse the document content of each project using the document parser corresponding to the project to obtain a project parsing result of the project; The generating unit is configured to generate the parsing result of the target document based on the item parsing results of each item in the target document.
7. The device according to claim 6, wherein: The format-related information includes brand identification and document version; The keyword determination unit is further configured to perform the step of determining the item keywords of each item in the target document according to the format-related information of the target document in the following manner: The project keywords corresponding to the brand logo and the document version of the target document are determined as the project keywords of each project in the target document.
8. The device according to claim 6, wherein: The step of determining the format-related information comprises: In response to the brand logo of the target document not existing in the parsing task, converting the target document from PDF format to a DOM format tree to obtain a DOM document; Convert the DOM document into a Java object to generate a Java object set; Using a brand parser to traverse and search for each preset brand logo in the Java object collection; In response to finding any brand identifier, the brand identifier is determined as the brand identifier of the target document.
9. The device according to claim 8, wherein: The step of determining the format-related information further includes: In response to the document version of the target document not existing in the parsing task, using a version parser to traverse the Java object collection to search for each preset version keyword corresponding to the brand logo of the target document; In response to finding any version keyword, the document version indicated by the version keyword is determined as the document version of the target document.
10. The device according to claim 6, wherein: The device also includes: A first verification unit is configured to, in response to receiving a parsing task for a target document, perform at least one of the following verification operations: determining whether a download link of the target document is valid, and determining whether there is a duplicate creation task for the parsing task; The second verification unit is configured to persist the parsing task in response to passing the verification operation, and update the parsing task status to parsing.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
