Chemical information processing method and device, equipment and storage medium

By analyzing and converting chemical formula strings in documents into natural language text, the problem of difficult to understand and process chemical information is solved, and the efficiency of text processing is improved.

CN119047433APending Publication Date: 2024-11-29BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411195763.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

Due to its professionalism, chemical information displayed in existing documents or web pages is difficult to understand and process related texts, such as reading aloud, searching, matching and other operations.

Method used

By determining the chemical formula string in the text to be processed, analyzing its syntax tree, generating the target chemical text, and performing text processing operations based on natural language text, the professionalism of chemical information is reduced and the efficiency of text processing is improved.

Benefits of technology

It realizes the rapid conversion of professional chemical information into natural language text, reduces the difficulty of understanding, and improves the efficiency of text processing operations, such as reading aloud, search, matching, etc.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047433A_ABST
    Figure CN119047433A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a chemical information processing method and device, equipment and a storage medium. The method comprises the steps of determining a to-be-processed text in response to a target interaction operation, and determining a to-be-processed first chemical character string from the to-be-processed text; determining a target chemical formula name corresponding to the first chemical formula character string as a target chemical text; the target chemical formula name is determined by querying pre-constructed mapping information based on at least one analysis character string corresponding to the first chemical formula character string; and generating a natural language text corresponding to the to-be-processed text based on the target chemical text and a non-chemical text in the to-be-processed text, and executing a text processing operation corresponding to the target interaction operation based on the natural language text. Therefore, the professional chemical related character string can be converted into the natural language text more quickly, the difficulty of understanding the chemical information is reduced, and the efficiency of performing related text processing on the chemical information subsequently is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a chemical information processing method, device, equipment and storage medium. Background Art

[0002] The typeset chemical information displayed in existing documents or web pages is often directly embedded in the form of professional chemical strings. However, since chemical information involves chemical formulas, chemical equations, ions, etc., it is highly professional. Therefore, the typeset chemical information is difficult to understand and difficult to perform related text processing (such as reading, searching, matching, etc.). Summary of the invention

[0003] In order to solve the above technical problems, the embodiments of the present disclosure provide a chemical information processing method, device, equipment and storage medium.

[0004] In a first aspect, the present disclosure provides a chemical information processing method, the method comprising:

[0005] In response to the target interactive operation, determining a text to be processed, and determining a first chemical formula character string to be processed from the text to be processed;

[0006] Determine a target chemical formula name corresponding to the first chemical formula string as a target chemical text; wherein the target chemical formula name is determined by querying pre-constructed mapping information based on at least one parsed string corresponding to the first chemical formula string; the parsed string is obtained by traversing a syntax tree corresponding to the first chemical formula string; a child node of the syntax tree records a unit string in the first chemical formula string; the unit string includes a chemical element, or a string formed by concatenating a chemical element, a preset subscript identifier and a subscript value;

[0007] Based on the target chemical text and the non-chemical text in the text to be processed, a natural language text corresponding to the text to be processed is generated, and a text processing operation corresponding to the target interactive operation is performed based on the natural language text.

[0008] In a second aspect, the present disclosure also provides a chemical information processing device, the device comprising:

[0009] A character string determination module, used for determining the text to be processed in response to the target interactive operation, and determining the first chemical formula character string to be processed from the text to be processed;

[0010] A target chemical text acquisition module is used to determine a target chemical formula name corresponding to a first chemical formula string as a target chemical text; wherein the target chemical formula name is determined by querying pre-constructed mapping information based on at least one parsed string corresponding to the first chemical formula string; the parsed string is obtained by traversing a syntax tree corresponding to the first chemical formula string; a child node of the syntax tree records a unit string in the first chemical formula string; the unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier and a subscript value;

[0011] The text processing operation module is used to generate natural language text corresponding to the text to be processed based on the target chemical text and the non-chemical text in the text to be processed, and to perform text processing operations corresponding to the target interactive operation based on the natural language text.

[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0013] processor;

[0014] A memory for storing executable instructions;

[0015] The processor is used to read executable instructions from the memory and execute the executable instructions to implement the chemical information processing method described in any embodiment of the present disclosure.

[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the chemical information processing method described in any embodiment of the present disclosure.

[0017] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which is used to execute the chemical information processing method described in any embodiment of the present disclosure.

[0018] The chemical information processing method, apparatus, device and storage medium of the disclosed embodiment can determine the text to be processed in response to the target interactive operation, and determine the first chemical formula string to be processed from the text to be processed; query the pre-constructed mapping information based on at least one parsed string corresponding to the first chemical formula string, determine the target chemical formula name corresponding to the first chemical formula string, and use the target chemical formula name as the target chemical text; wherein the parsed string is obtained by traversing the syntax tree corresponding to the first chemical formula string; the child node of the syntax tree records the unit string in the first chemical formula string; the unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier and a subscript value; based on the target chemical text and the non-chemical text in the text to be processed, generate a natural language text corresponding to the text to be processed, and perform the text processing operation corresponding to the target interactive operation based on the natural language text, so as to achieve faster conversion of the professional chemical-related string in the text to be processed corresponding to the target interactive operation into the target chemical text, and then generate the natural language text corresponding to the text to be processed according to the target chemical text, thereby reducing the difficulty of understanding chemical information and improving the efficiency of subsequent execution of text processing operations corresponding to the target interactive operation (such as reading aloud, searching, matching, dialogue, etc.). BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0020] Figure 1 A schematic diagram of a process of chemical information processing provided by an embodiment of the present disclosure;

[0021] Figure 2 A schematic diagram of a tree structure corresponding to a first chemical formula character string provided in an embodiment of the present disclosure;

[0022] Figure 3 A schematic diagram of a syntax tree provided in an embodiment of the present disclosure;

[0023] Figure 4 A schematic diagram of a chemical formula prefix tree provided in an embodiment of the present disclosure;

[0024] Figure 5 A schematic diagram of a process for constructing a chemical formula prefix tree provided in an embodiment of the present disclosure;

[0025] Figure 6 A schematic diagram of a process for determining a chemical formula name provided in an embodiment of the present disclosure;

[0026] Figure 7A schematic diagram of another chemical information processing method provided by an embodiment of the present disclosure;

[0027] Figure 8 A schematic diagram of a chemical equation recognition method provided by an embodiment of the present disclosure;

[0028] Fig. 9 A schematic diagram of the structure of a chemical information processing device provided by an embodiment of the present disclosure;

[0029] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0031] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0032] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0033] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0036] The chemical information processing method provided by the embodiments of the present disclosure can be applied to the scenario of interpreting typeset professional chemical information, and can also be applied to the dialogue scenario. For example, it can be applied to the scenario of reading typeset chemical information aloud, and can also be applied to text processing scenarios such as searching / retrieval / matching typeset chemical information. The method can be performed by a chemical information processing device, which can be implemented by software and / or hardware, and the device can be integrated in an electronic device capable of performing text processing. Among them, the electronic device can include but is not limited to smart phones, personal digital assistants (PDA), tablet computers (Tablet Personal Computer, TabletPC), laptop computers, desktop computers or servers, etc.

[0037] Figure 1 FIG. 1 is a flow chart of a chemical information processing method provided by an embodiment of the present disclosure. Figure 1 As shown, the chemical information processing method may include the following steps:

[0038] S110 . In response to the target interactive operation, determine a text to be processed, and determine a first chemical formula character string to be processed from the text to be processed.

[0039] The target interaction operation can be understood as an interaction operation between a user and an electronic device. For example, the target interaction operation can be an interaction operation that triggers a dialogue or triggers a reading.

[0040] The text to be processed can be understood as the text corresponding to the target interactive operation. Exemplarily, the text to be processed can be the conversation content corresponding to the conversation, or the reading text corresponding to the reading. The reading text can be the text corresponding to the typesetting source code in the web page typesetting system, wherein the typesetting source code at least includes the text content corresponding to the first chemical formula string and the typesetting command for controlling the document structure and format.

[0041] The first chemical formula string may be a chemical formula string constructed according to the syntax of a certain typesetting system, which complies with the professional expression form of chemical formulas specified by an authority. In the disclosed embodiment, the first chemical formula string may be a chemical formula string extracted from the text to be processed, wherein the first chemical formula string may include at least one of an element symbol, an atomic number, a bracket, a charge mark (such as an ion charge), etc. For example, the first chemical formula string may be the string "H2SO4".

[0042] In some embodiments, the electronic device may respond to a target interaction operation, wherein the target interaction operation includes a text to be processed. Then, the target interaction operation is parsed to obtain the text to be processed. Thereafter, the text to be processed is recognized, and the first chemical formula string to be processed is determined from the text to be processed. Thus, the text to be processed can be obtained by interacting with the user, and the first chemical formula string to be processed can be determined in the process of recognizing the text to be processed.

[0043] In some other embodiments, the electronic device may respond to a target interaction operation, and the response to the target interaction operation includes identification information corresponding to the text to be processed. Then, the target interaction operation is parsed to obtain the identification information corresponding to the text to be processed, and the text to be processed is obtained from a preset database based on the identification information corresponding to the text to be processed. After that, the text to be processed is identified, and the first chemical formula string to be processed is determined from the text to be processed. Thus, the method of obtaining the text to be processed from the preset database can determine the first chemical formula string to be processed.

[0044] In some other embodiments, the electronic device may receive, in response to the target interaction operation, a first chemical formula string sent by at least one upstream service (such as a text reading engine) in communication connection with the electronic device. For example, the first chemical formula string may be a string contained in the text to be processed that is identified during the upstream service parsing the target interaction operation. Thus, it is possible to receive the first chemical formula string sent by at least one upstream service (such as a text reading engine), providing support for the subsequent correct processing (such as reading, searching, matching, dialogue, etc.) of the first chemical formula string by at least one upstream service.

[0045] S120, determining a target chemical formula name corresponding to the first chemical formula string as a target chemical text; wherein the target chemical formula name is determined by querying pre-constructed mapping information based on at least one parsed string corresponding to the first chemical formula string; the parsed string is obtained by traversing a syntax tree corresponding to the first chemical formula string; a child node of the syntax tree records a unit string in the first chemical formula string; the unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier and a subscript value.

[0046] The mapping information includes a correspondence between at least one unit character string and an initialization formula name.

[0047] The syntax tree may be generated by parsing the first chemical formula character string based on a preset subscript identifier.

[0048] The preset subscript identifier is an identifier preset to identify a superscript and a subscript in a chemical formula string. The preset subscript identifier can be an identifier added before the superscript and the subscript, respectively, to distinguish the superscript and the subscript. Exemplarily, the superscript identifier can be represented by "^", and the subscript identifier can be represented by "_".

[0049] Figure 2 A schematic diagram of a tree structure corresponding to a first chemical formula string in a related technology provided by an embodiment of the present disclosure. Figure 2 As shown, taking the chemical formula "H2SO4" as an example, the typesetting syntax of the chemical formula can be parsed into the node information of the tree structure, the element information stored in each node, etc. Among them, the tree structure includes three levels of nodes, the first level node is the root node, which can be used as the access and parsing entry corresponding to its child node (i.e., the next node of the root node); the second level node is obtained by dividing the single character and the subscript character in the original string corresponding to the first level node, and the single character "S" is listed first. Then, the subscript characters "H" and "O" are further split to obtain the third level nodes, and the third level nodes include the single character "H" corresponding to the subscript character "H", the single character "2" (i.e., the subscript of the subscript character "H") and the superscript (NULL) (i.e., indicating that the subscript character "H" has no superscript), and the single character "O" corresponding to the subscript character "O", the single character "4" (i.e., the subscript of the subscript character "O") and the superscript (NULL) (i.e., indicating that the subscript character "O" has no superscript). It is understandable that the second-level node corresponding to the third-level node may not store specific character content, but instead use it as an entry for access and parsing corresponding to the third-level node.

[0050] Specifically, after determining the first chemical formula string to be processed, the electronic device parses the first chemical formula string based on the syntax of the typesetting system and the preset subscript identifier to obtain a syntax tree, that is, in the parsing process, based on the preset subscript identifier, Figure 2 The complex tree structure corresponding to the first chemical formula string shown is simplified to Figure 3 The syntax tree shown in Figure 1 is because Figure 2 The complex tree structure shown has the problem of complex structure, the relationship between each character is not direct and clear, and it also occupies a lot of resources. Therefore, after obtaining the first chemical formula string, the typesetting syntax corresponding to the first chemical formula string and the complex tree structure corresponding to the first chemical formula string determined based on the typesetting syntax are obtained, and the preset subscript identifier is obtained at the same time. Then, the single character and the character with subscript, as well as the subscript information corresponding to the character with subscript, are determined from the complex tree structure, and the preset subscript identifier is added between the character corresponding to the character with subscript and the subscript. Figure 2The complex tree structure shown in FIG. 1 is partially flattened to obtain a syntax tree. Thus, a syntax tree with a simplified tree structure can be obtained, and at the same time, the representation between each element and the subscript is clearer.

[0051] Figure 3 A schematic diagram of a syntax tree provided by an embodiment of the present disclosure. Figure 3 As shown, the chemical formula H2SO4 is used as an example for explanation. Figure 2 The grammatical information in can determine that the character "H" is a subscripted character, and its subscript is "2", the character "O" is a subscripted character, and its subscript is "4", and the character "S" is a single character, that is, a character without a subscript. Therefore, according to the preset subscript identifier, the character "H" and the character "O" are added with subscript identifiers, and the subscripted character "H_2" and the subscripted character "O_4" with the preset subscript identifier added are obtained. After that, it is directly placed in Figure 2 In the second-level node shown in the figure, a syntax tree is generated. The first-level node in the syntax tree is the root node, the second-level node is the child node, and each circle in the child node represents a unit string. The unit string is divided into a unit string containing only chemical elements, such as the character "S", and a unit string consisting of a chemical element, a preset subscript identifier and a subscript value, such as the character "H_2" and the character "O_4", according to whether the chemical element contains a subscript.

[0052] In the embodiment of the present disclosure, after the syntax tree is obtained, the syntax tree is traversed to obtain at least one parsed string of the first chemical formula string.

[0053] The parsed string can be understood as a string obtained by parsing the first chemical formula string. For example, Figure 3 The characters "H_2", "S", and "O_4" are shown.

[0054] Specifically, after generating the syntax tree, the electronic device traverses the child nodes of the syntax tree and obtains at least one parsed string of the first chemical formula string according to the unit string in the first chemical formula string recorded in the child node. At this point, the electronic device converts the first chemical formula string into one or more independent strings.

[0055] In the disclosed embodiment, after obtaining at least one parsed string, based on the sequence between at least one parsed string, a search is performed from front to back in pre-constructed mapping information, at least the last parsed string is searched, and based on the correspondence between at least one unit string and the initial chemical formula name in the mapping information, the initial chemical formula name corresponding to the last parsed string is determined, and the initial chemical formula name is determined as the target chemical formula name corresponding to the first chemical formula string, thereby obtaining the target chemical text.

[0056] In some embodiments, after acquiring the first chemical formula string to be processed, the electronic device can process the first chemical formula string locally to obtain the target chemical formula name corresponding to the first chemical formula string and use it as the target chemical text. Thus, the first chemical formula string can be directly processed, which improves the convenience of processing the first chemical formula string and reduces data transmission loss.

[0057] In other embodiments, after acquiring the first chemical formula string to be processed, the electronic device may send the first chemical formula string to a server for chemical information processing, and the server may process the first chemical formula string and receive a target chemical formula name corresponding to the first chemical formula string sent by the server as a target chemical text. Thus, the resource consumption caused by the electronic device performing the processing of the first chemical formula string can be reduced, and the processing efficiency of the first chemical formula string can be improved.

[0058] S130, based on the target chemical text and the non-chemical text in the text to be processed, generate a natural language text corresponding to the text to be processed, and perform a text processing operation corresponding to the target interactive operation based on the natural language text.

[0059] The non-chemical text refers to other texts in the text to be processed except the first chemical formula character string, such as words, numbers, etc.

[0060] The text processing operation corresponding to the target interactive operation may include displaying, reading aloud, searching and matching based on natural language text, etc., which is not limited here.

[0061] Specifically, after obtaining the target chemical text, the electronic device determines the target position of the target chemical text in the text to be processed based on the position information of the first chemical formula character string in the text to be processed; based on the target position, the target chemical text is placed in the text to be processed, a natural language text corresponding to the text to be processed is generated, and a text processing operation corresponding to the target interactive operation is performed based on the natural language text.

[0062] In the disclosed embodiment, in response to a target interactive operation, a text to be processed can be determined, and a first chemical formula string to be processed can be determined from the text to be processed; based on at least one parsed string corresponding to the first chemical formula string, pre-constructed mapping information is queried to determine a target chemical formula name corresponding to the first chemical formula string, and the target chemical formula name is used as a target chemical text; wherein the parsed string is obtained by traversing a syntax tree corresponding to the first chemical formula string; a child node of the syntax tree records a unit string in the first chemical formula string; a unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier, and a subscript value; based on the target chemical text and non-chemical text in the text to be processed, a natural language text corresponding to the text to be processed is generated, and a text processing operation corresponding to the target interactive operation is performed based on the natural language text, so as to achieve a faster conversion of professional chemical-related strings in the text to be processed corresponding to the target interactive operation into the target chemical text, and then generate a natural language text corresponding to the text to be processed according to the target chemical text, thereby reducing the difficulty of understanding chemical information and improving the efficiency of subsequent text processing operations (such as reading, searching, matching, dialogue, etc.) corresponding to the target interactive operation.

[0063] In some embodiments of the present disclosure, determining the text to be processed in response to the target interactive operation may specifically include: in response to the interactive operation that triggers the execution of the dialogue function, determining the dialogue content as the text to be processed.

[0064] The conversation content may be the conversation content input by the user or the response content of the large model.

[0065] In the large model dialogue scenario, by processing the first chemical formula string into natural language text, the large model can be easily recognized and the user can understand it, thereby improving dialogue efficiency.

[0066] Furthermore, executing a text processing operation corresponding to the target interactive operation based on the natural language text may specifically include: displaying the natural language text in the dialogue interface.

[0067] In some embodiments, the electronic device can answer the user's conversation question by displaying the natural language text on the conversation interface. For example, the user's target interaction operation is to ask the name of a chemical formula, and at this time, the user's conversation question is answered by displaying the natural language text.

[0068] In other embodiments, the electronic device can display the natural language text on the dialogue interface so that the user can continue to trigger the dialogue function based on the displayed natural language text. For example, after seeing the natural language text on the dialogue interface, the user can continue to ask questions about the natural language text to facilitate subsequent discussion of chemical knowledge related to the first chemical formula string.

[0069] In other embodiments of the present disclosure, determining the text to be processed in response to the target interactive operation may specifically include: in response to the interactive operation that triggers the execution of the text reading function, determining the text content to be read aloud as the text to be processed.

[0070] Furthermore, executing a text processing operation corresponding to the target interactive operation based on the natural language text may specifically include: performing a reading process based on the natural language text.

[0071] In some embodiments, after obtaining the natural language text, the electronic device may perform text-to-speech processing on the natural language text, and then read the natural language text aloud.

[0072] In other embodiments, after obtaining the natural language text, the electronic device may send the natural language text to the reading engine, so that the reading engine performs reading processing based on the natural language text.

[0073] In the embodiment of the present disclosure, by determining the text to be read aloud as the text to be processed, the first chemical formula character string to be processed in the text to be read aloud is processed to obtain the natural language text corresponding to the text to be read aloud, which facilitates the correct reading of the text content and improves the user experience.

[0074] In an embodiment of the present disclosure, pre-constructed mapping information is queried based on at least one parsed string corresponding to a first chemical formula string to determine a target chemical formula name corresponding to the first chemical formula string. Specifically, the method may include: querying a pre-constructed chemical formula prefix tree based on the parsed string to determine the target chemical formula name corresponding to the first chemical formula string as a target chemical text; wherein a tree node of the chemical formula prefix tree records the correspondence between a unit string of the chemical formula and an initialization chemical formula name corresponding to each unit string included in a path from a root node to the tree node.

[0075] The chemical formula name can be understood as the name of the chemical formula in the natural language field specified by the authority. For example, the chemical formula name of the chemical formula "H2SO4" is "sulfuric acid".

[0076] Specifically, after obtaining at least one parsed string, the electronic device queries the target chemical formula name corresponding to the first chemical formula string from the pre-constructed chemical formula prefix tree according to the connection relationship between the parsed strings. Then the target chemical formula name is determined as the target chemical text in the natural language of the first chemical formula string. Thus, the target chemical formula name corresponding to the first chemical formula string can be obtained by querying the chemical formula prefix tree. Since the chemical formula prefix tree is based on a character as the root node, the characters that can form a new chemical formula with the characters in the root node are obtained, and tree nodes are created downward in sequence based on the characters. Therefore, in the query process, there is no need to traverse the entire chemical formula prefix tree. As long as the root node corresponding to the first character of the first chemical formula string is queried in the chemical formula prefix tree, the target chemical formula name corresponding to the first chemical formula string can be quickly queried, which improves the search efficiency of the target chemical formula name corresponding to the first chemical formula string.

[0077] Figure 4 A schematic diagram of a chemical formula prefix tree provided in an embodiment of the present disclosure. Figure 4 As shown, the chemical formula prefix tree includes multiple tree nodes, each of which includes a corresponding unit string and / or chemical formula name. For example, the chemical formula name of the character "H_2" is "hydrogen", the chemical formula name of the character "H_2S" is "hydrogen sulfide", etc. The character "H_2C" has no corresponding chemical formula name, and there is no corresponding chemical formula name at the node corresponding to the character "C".

[0078] Based on the parsed string query, the pre-built chemical formula prefix tree is determined to determine the target chemical formula name corresponding to the first chemical formula string. The specific method is as follows: Take the first chemical formula string as H2SO4 as an example. First, search for the node corresponding to the character "H_2" from the chemical formula prefix tree. If found, continue to search whether the next node of the character "H_2" node contains the node of the character "S". If it does, continue to search for the node containing the character "O_4". If the node corresponding to the character "O_4" is found, determine the chemical formula name "sulfuric acid" corresponding to the node where the character "O_4" is located, and determine it as the target chemical formula name whose first chemical formula string is H2SO4. For example, Figure 4 The query path where the gray circle is located.

[0079] The chemical information processing method provided by the above-mentioned embodiment of the present disclosure can parse the first chemical formula string through a preset subscript identifier to generate a syntax tree, wherein the child nodes of the syntax tree record the unit string in the first chemical formula string; wherein the unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier and a subscript value, and then traverse the syntax tree to obtain at least one parsed string of the first chemical formula string, and by adding the preset subscript identifier in the process of parsing the first chemical formula string, the obtained syntax tree structure is flat and the hierarchy is concise, which saves storage space and reduces computing power requirements, and also improves the efficiency of traversing the syntax tree to obtain the parsed string and the subsequent query efficiency; further, according to each parsed string, a pre-constructed chemical formula prefix tree is queried to determine the target chemical formula name corresponding to the first chemical formula string as the target chemical text in natural language, thereby realizing a faster conversion of professional chemical-related strings into natural language text, reducing the difficulty of understanding chemical information, and improving the efficiency of subsequent related text processing (such as reading aloud, searching, matching, dialogue, etc.) of chemical information.

[0080] In some embodiments, based on the above technical solution, Figure 5 As shown, the chemical formula prefix tree can be pre-built as follows:

[0081] S510, obtaining a list of chemical objects; wherein the list of chemical objects records the correspondence between the second chemical formula character string and the initial chemical formula name of the chemical object; the chemical object includes at least one of a chemical ion, a chemical nuclide, a chemical element, a chemical single substance and a chemical compound.

[0082] The second chemical formula character string and the initial chemical formula name of the chemical object in the chemical object list may be the chemical formula provided by the website of the authoritative organization and the chemical formula name corresponding thereto.

[0083] Chemical ions can be understood as atoms (or atomic groups) with electric charge, such as sodium ions (Na+), chloride ions (Cl-), etc.

[0084] Chemical nuclides can be understood as an atom with a certain number of protons and a certain number of neutrons. For example, the element hydrogen has three nuclides: 1H (1 proton and 0 neutrons, i.e. ordinary hydrogen), 2H (1 proton and 1 neutron, i.e. deuterium) and 3H (1 proton and 2 neutrons, i.e. tritium).

[0085] Chemical elements can be understood as a general term for a class of atoms with the same nuclear charge number (i.e., the number of protons). Elements are the basic units that make up matter. All matter is composed of elements, such as oxygen (O), iron (Fe), carbon (C), etc., which are all common chemical elements.

[0086] Chemical elements can be understood as pure substances composed of the same element, such as metal elements: iron (Fe), copper (Cu), aluminum (Al), etc.; non-metal elements: oxygen (O), nitrogen (N), hydrogen (H), etc.

[0087] A chemical compound can be understood as a pure substance composed of two or more different elements. The atoms in a compound are bound together by chemical bonds (such as ionic bonds, covalent bonds, etc.), such as water (HO), sodium chloride (NaCl), etc.

[0088] In some examples, when constructing a chemical formula prefix tree, the electronic device may obtain a list of chemical objects from an authority website by crawling or other means based on a preset interface.

[0089] In other examples, when constructing the chemical formula prefix tree, the electronic device may directly obtain the chemical object list from a preset database based on the identification information of the chemical object list, thereby obtaining the chemical object list.

[0090] S520. For any second chemical formula string, add a first connecting character between any two adjacent characters, and add a preset subscript identifier corresponding to the subscript type before the subscript value, generate key information of the second chemical formula string, and determine the initialization chemical formula name corresponding to the second chemical formula string as the value information, and generate a chemical object database with a key-value pair structure.

[0091] Among them, the first connecting character can be understood as a connecting character pre-set for connecting two adjacent characters. The first connecting character can be a connecting character added between two characters respectively to distinguish two adjacent characters in the second chemical formula string. At the same time, the first connecting character can also be used as a character for dividing tree nodes when constructing a chemical formula prefix tree. Exemplarily, the first connecting character can be "#". The subscript type can include a superscript and a subscript.

[0092] The chemical object database stores information related to the second chemical formula string and the initial chemical formula name corresponding to the second chemical formula string. The information related to the second chemical formula string and the initial chemical formula name corresponding to the second chemical formula string is stored in a key-value pair structure, and can be classified and stored according to the type of chemical object, which is explained in the following way with a specific example:

[0093] / / element

[0094] 1{"H","hydrogen"},

[0095] 2{"H#e","helium"},

[0096] …

[0097] / / Single quality

[0098] 13{"H_2","hydrogen"},

[0099] 14{"N_2","nitrogen"},

[0100] …

[0101] / / Compounds

[0102] 25{"K#F","Potassium fluoride"},

[0103] 26{"K#C#l","potassium chloride"},

[0104] …

[0105] / / ion

[0106] 34{"H^+","hydrogen ion"},

[0107] 35{"L#i^+","lithium ion"},

[0108] …

[0109] / / Organic matter

[0110] 44{"C#H_4","methane"},

[0111] 45{"C_6#H_12#O_6","Glucose"},

[0112] …

[0113] / / Nuclide reading isotope

[0114] 54{"_6^12#C","Carbon 6 12"},

[0115] 55{"_6^13#C","Carbon 6 13"},

[0116] …

[0117] In the chemical object database, data is stored in the form of key-value pairs. Taking "{"C_6#H_12#O_6","glucose"}" as an example, "C_6#H_12#O_6" is the key information, representing the second chemical formula string "C6H 12O6", every two adjacent characters in the chemical formula string are connected by the first connecting character "#". For example, the character "C", the character "H", and the character "O" are connected by "#", where the character "C", the character "H", and the character "O" are all subscripted characters, and all are subscripts. For subscripted characters, a preset subscript identifier is added before the subscript, such as using "_" to identify the subscript. For the character "C" with the number "6" as the subscript, a subscript identifier is added before the number "6", and the subscripted character "C_6" with the added subscript identifier is connected as a whole to its adjacent characters through the first connecting character "#". For two adjacent numbers, they are kept continuous, such as the two numbers "1" and "2" in the subscript of the character "H" are kept continuous; "Glucose" is the value information, representing the initialization chemical formula name corresponding to the chemical formula string.

[0118] Specifically, after obtaining the list of chemical objects, the electronic device parses the second chemical formula string for each second chemical formula string in the list of chemical objects. Afterwards, by adding a first connecting character (such as "#") between two adjacent characters obtained after parsing the second chemical formula string, the numbers are kept continuous; for characters with subscripts, a subscript mark (such as "_") is added before the subscript, and a superscript mark (such as "^") is added before the superscript, and the subscript characters with superscript marks and / or subscript marks are connected as a whole with their adjacent characters through the first connecting character to generate the key information of the second chemical formula string. Then, through the corresponding relationship between the second chemical formula string of the chemical object and the initial chemical formula name, the initial chemical formula name corresponding to the standard chemical is determined, and the initial chemical formula name is determined as value information, and then a chemical object database is constructed. In the disclosed embodiment, by generating a chemical object database with a key-value pair structure, the query efficiency of the initial chemical formula name corresponding to the chemical formula string is improved, thereby improving the construction efficiency of the generated chemical formula prefix tree.

[0119] In some examples, the electronic device may perform construction of a chemical object database based on a larger-scale generative model.

[0120] In other examples, the electronic device may also construct a chemical object database based on a preset algorithm.

[0121] S530, dividing each tree node based on the first connecting character in the key information, and storing the value information in the last divided tree node, inserting each key-value pair information in the chemical object database into a preset prefix tree to generate a chemical formula prefix tree.

[0122] The preset prefix tree is a prefix tree pre-constructed according to preset rules.

[0123] Specifically, after obtaining the chemical object database, the electronic device divides each tree node by the first connecting character in the key information, determines the unit string corresponding to each tree node and the upper and lower hierarchical relationship between each tree node. Then, according to the unit string corresponding to each tree node and the upper and lower hierarchical relationship between each tree node, the unit string is inserted into the preset prefix tree, and the value information is stored at the position of the last tree node to generate a chemical formula prefix tree.

[0124] The chemical information processing method provided by the above-mentioned embodiments of the present disclosure can construct a chemical object database with a key-value pair structure, and then construct a chemical formula prefix tree by storing the value information in the last tree node of the division, thereby avoiding the repeated construction of different chemical formula strings containing at least one identical string, saving construction resources, and improving the query rate.

[0125] Figure 6 A schematic diagram of a process for determining the name of a chemical formula provided in an embodiment of the present disclosure. The process of determining the name of a chemical formula can be applied to a chemical formula expressed in the form of "substance nX", which indicates that the main substance is combined with a certain molecule (characterized as X) in a certain proportion (characterized as the number of molecules n) to form a compound with a specific chemical formula and properties. The molecule X here can be a water molecule "H2O", or it can be an acid radical ion, a hydroxide ion, and the like. In the embodiment of the present disclosure, molecule X is taken as a water molecule "H2O" as an example, that is, "substance nX" is illustrated by taking a crystalline hydrate as an example.

[0126] Crystalline hydrates are a special class of compounds. When they are crystallized from aqueous solutions or other solvents, a certain number of water molecules will be bound inside the crystals. These water molecules bound in the crystals are called crystal water, and substances containing crystal water are called crystal hydrates. The general naming usually follows the reading rule of "X hydrate Y", where X refers to the number of crystal waters and Y refers to the name of the compound before the second connecting character "˙". However, there are some special cases, such as the chemical formula string NH3·H2O. If it follows the previous reading rules, it should be "monohydrated ammonia", but the correct chemical formula name is "monohydrated ammonia". Therefore, for the latter special case, when constructing the chemical formula prefix tree, it is added to the chemical formula prefix tree so that the accurate chemical formula name can be queried.

[0127] like Figure 6 As shown, based on the parsed string query, a pre-built chemical formula prefix tree is determined to determine the target chemical formula name corresponding to the first chemical formula string, which may specifically include the following steps:

[0128] S610. In the process of querying the chemical formula prefix tree in the order of each parsed string, if the parsed string is the second connecting character and there is no next-layer tree node in the chemical formula prefix tree that is closest to the tree node queried once, determine the first chemical formula name corresponding to the queried parsed string.

[0129] The second connecting character can be understood as a connecting character used to distinguish between a main substance and a certain molecule combined with it in a chemical name. The second connecting character can be a connecting character connecting a compound molecule and a crystal water molecule in a crystalline hydrate. Exemplarily, the second connecting character is “˙”.

[0130] In some examples, when the electronic device searches the chemical formula prefix tree in the order of each parsed string, if it is determined that the parsed string contains a second connecting character, and when it is determined that there is no next-level tree node in the chemical formula prefix tree when the second connecting character is found, the chemical formula name corresponding to the tree node that is most adjacent to the first search before the second connecting character is determined as the first chemical formula name corresponding to the parsed string that has been searched. Then, the target chemical formula name is determined based on the first chemical formula name.

[0131] For example, for the crystalline compound CuSO4·5H2O, the second connecting character in the parsed string is “˙”. When the parsed string “O_4” is queried from the chemical formula prefix tree in the order of the parsed string, it is determined that there is no next-level tree node in the chemical formula prefix tree. At this time, the chemical formula name “copper sulfate” of the tree node corresponding to “O_4” is determined as the first chemical formula name.

[0132] In other examples, when the electronic device searches the chemical formula prefix tree in the order of each parsed string, if it is determined that the parsed string contains the second connecting character, and when the second connecting character is found, it is determined that there is a next layer of tree nodes in the chemical formula prefix tree, the parsed string query operation is continued until all parsed strings are searched. The chemical formula name corresponding to the last tree node is determined as the target chemical formula name corresponding to the first chemical formula string.

[0133] For example, for the crystalline compound NH3·H2O, the second connecting character in the parsed string is “˙”. When the parsed string “H_3” is queried from the chemical formula prefix tree in the order of the parsed strings, it is determined that there is a next-level tree node in the chemical formula prefix tree, and the query is continued until the last parsed string “O” is queried. The chemical formula name “ammonia monohydrate” corresponding to the parsed string “O” is determined as the target chemical formula name of the crystalline compound NH3·H2O.

[0134] S620. Continue to query the chemical formula prefix tree based on the order of each parsed string after the second connection character to determine the second chemical formula name.

[0135] Specifically, after the electronic device determines the first chemical formula name, it determines each parsed string after the second connection character, and queries the second chemical formula name corresponding to each parsed string after the second connection character from the pre-constructed chemical formula prefix tree.

[0136] Exemplarily, for the crystalline compound CuSO4·5H2O, after determining that the first chemical formula name corresponding to the parsed string of CuSO4 before the second connection character “˙” is “copper sulfate”, it determines that the second chemical formula name corresponding to the parsed string of 5H2O after the second connection character “˙” is pentahydrate.

[0137] S630. If the second chemical formula name includes a combination of numbers and a preset chemical formula name, or the second chemical formula name includes a preset chemical formula name, splice the second chemical formula name, the name connection text, and the first chemical formula name to generate the target chemical formula name.

[0138] Among them, the name connection text can be the text connecting the two chemical formula strings before and after the second connection character. Exemplarily, in crystalline hydrates, the name connection text can be “hepta-” and the preset chemical formula name can be “water”.

[0139] Specifically, after the electronic device determines the second chemical formula name, when it determines that the second chemical formula name includes a combination of numbers and a preset chemical formula name, or the second chemical formula name includes a preset chemical formula name, it determines that the first chemical formula string is a crystalline hydrate, and splices the second chemical formula name, the name connection text, and the first chemical formula name to generate the target chemical formula name.

[0140] Exemplarily, for the crystalline compound CuSO4·5H2O, when the second chemical formula name is determined to be pentahydrate, it matches the second chemical formula name with the preset chemical formula name. When the match is successful, it is determined that the second chemical formula name includes a combination of numbers and a preset chemical formula name or the second chemical formula name includes a preset chemical formula name. At this time, pentahydrate, hepta-, and copper sulfate are spliced to generate the target chemical formula name “copper sulfate pentahydrate”.

[0141] In the embodiments of the present disclosure, it is possible to determine whether the first chemical formula string belongs to a crystalline hydrate based on the second connection character included in the parsed string. When it is determined to be a crystalline hydrate, in combination with the reading rules of crystalline hydrates, the target chemical formula name of the crystalline hydrate is determined, which improves the flexibility and accuracy of determining the target chemical formula name.

[0142] In some embodiments, determining the first chemical formula string to be processed from the text to be processed may specifically include: extracting the original chemical string to be processed from the text to be processed based on the start and end identifiers corresponding to the chemical information; and determining the first chemical formula string from the original chemical string.

[0143] The start and end identifiers can be understood as identifiers used to identify chemical information and the start and end boundaries of chemical information during text typesetting. For example, the start and end identifiers are "\ce{}", where "{}" can contain the original chemical string.

[0144] In some examples, if the original chemical string to be processed extracted based on the start and end identifiers only contains the chemical formula, the original chemical string is determined as the first chemical formula string.

[0145] In other examples, the starting character string of the original chemical character string to be processed extracted based on the start and end identifiers is a number and / or other character string, and the other character string may include a concentration identifier for indicating concentration, then the character string other than the number and / or other character string in the original character string is determined as the first chemical formula character string.

[0146] In some embodiments, based on the start and end identifiers corresponding to the chemical information, the original chemical string to be processed is extracted from the text to be processed. Then, based on other strings contained in the original chemical string except the first chemical formula string, the information type corresponding to the original chemical string is determined, and different chemical information processing methods are performed according to different information types, such as Figure 7 The chemical information processing method shown is used to determine the target chemical text corresponding to the original character string.

[0147] like Figure 7 As shown, when other character strings fail to match the concentration identifier, it is determined that the original chemical character string corresponds to the first information type, and steps S710 to S730 are executed; when other character strings successfully match the concentration identifier, it is determined that the original chemical character string corresponds to the second information type, and steps S740 to S760 are executed.

[0148] S710. If the original chemical character string contains other character strings except the first chemical formula character string, and the other character strings fail to match the concentration identifier, the original chemical character string is identified according to the first sorting of the original chemical character string based on the first information type to generate each first identification result; wherein the first information type includes at least one of a chemical formula type, a coefficient type, a material state type, a reaction relationship type, a reaction condition type, and a conversion relationship type.

[0149] The concentration identifier is an identifier used to indicate the concentration. For example, the concentration identifier may be "c()".

[0150] The first information type may be an information type used to represent a chemical equation, and may specifically include at least one of a chemical formula type, a coefficient type, a material state type, a reaction relationship type, a reaction condition type, and a conversion relationship type.

[0151] Among them, the chemical formula type can be understood as the name of the chemical formula; the material state type can be understood as the state of each chemical formula, such as gas, precipitate, etc.; the reflection relationship type can be understood as the calculation relationship between each chemical formula, such as +, -, etc.; the reaction condition type can be understood as the conditions required to perform a chemical reaction, such as heating conditions, catalysts, etc.; the conversion relationship type can be understood as the process of mutual conversion through chemical reactions, such as using equal signs, arrows, etc. to represent the conversion relationship type.

[0152] Specifically, after extracting the original chemical string to be processed, the electronic device determines other strings in the original chemical string except the first chemical formula string, and matches the other strings with the concentration identifier. If the other strings fail to match the concentration identifier, the original chemical string is determined to be a first information type, and based on the first information type, each string is identified according to the first sorting corresponding to each string in the original chemical string to generate a first recognition result. The storage method of the first recognition result can be any one of a stack, a queue, a sequence table, etc., to determine the order of the recognition results of each string.

[0153] Figure 8 A schematic diagram of a chemical equation recognition method provided by an embodiment of the present disclosure is shown in FIG. Figure 8 As shown, the following original chemical string (1) is used as an example for explanation:

[0154]

[0155] The original chemical character string (1) contains other character strings except the first chemical formula character string, and the other character strings do not contain the concentration identifier. At this time, based on the first information type, the original chemical character string (1) is identified in order from left to right to obtain the identification result of each character string, and the identification result is stored in the form of a stack, that is, pushed into the stack, so as to obtain Figure 8 The results shown in the left box are: coefficient 2, molecular formula: sodium peroxide, combine: +, coefficient 2, molecular formula: water, equation: conditional heating, coefficient 4, molecular formula: sodium hydroxide, combine: +, molecular formula: oxygen, material state: gas. The equation can be used to determine that the original chemical string is a chemical equation.

[0156] In some examples, the chemical formula type in the first recognition result, i.e., the target chemical formula name corresponding to each first chemical formula string contained in the original chemical string, such as "molecular formula: sodium peroxide", can be obtained by executing steps S110 to S140 when performing the recognition operation of the original chemical string after the original chemical string is acquired.

[0157] In other examples, the chemical formula type in the first recognition result may also be pre-acquired and stored in a preset database based on the implementation of steps S110 to S140. In this step, the chemical formula type can be directly obtained from the preset database without repeatedly performing the recognition step of the target chemical formula name corresponding to each first chemical formula character string contained in the original chemical character string.

[0158] S720: If each first recognition result includes a conversion relationship identifier corresponding to the conversion relationship type, the first recognition result is converted into a corresponding first partial text based on the text expression of the chemical equation.

[0159] Specifically, after obtaining each first recognition result, the electronic device determines whether the first recognition result contains a conversion relationship identifier. If it does, the first recognition result is converted into a corresponding first partial text based on the text expression of the chemical equation.

[0160] Among them, converting the first recognition result to the corresponding first partial text may specifically include: if the first recognition result is the target chemical formula name, and the previous adjacent first recognition result of the first recognition result is not a coefficient value, then concatenating the default coefficient text and the target chemical formula name to generate the first partial text corresponding to the first recognition result.

[0161] The default coefficient text can be "1". Generally, when the coefficient is 1, the coefficient value "1" is not written by default, that is, the default coefficient.

[0162] like Figure 8 As shown, the first recognition result obtained contains the conversion relationship identifier "equation: conditional heating". Therefore, according to the text expression of the chemical equation, the first recognition result is converted from bottom to top to obtain the first partial text corresponding to each first recognition result, such as Figure 8 The results shown in the right box, such as converting "coefficient 2" to "2", converting "combine: +" to "and", converting "equation: conditional heating" to "generated under heating conditions", where "equation" is converted to "generate", etc. At the same time, since the first adjacent recognition result of "molecular formula: oxygen" is "combine: +", which is not a coefficient value, the default coefficient text "1" is added when converting "molecular formula: oxygen" to generate the first local text "1 oxygen".

[0163] S730 , concatenating the first partial texts according to the first sorting to generate a target chemical text corresponding to the original chemical character string.

[0164] Specifically, after obtaining the first partial text, the electronic device concatenates the first partial text according to a first order to generate a target chemical text corresponding to the original chemical character string.

[0165] like Figure 8 As shown, after obtaining the first partial text, the first partial text is spliced ​​from bottom to top to obtain "2 sodium peroxides and 2 waters generate 4 sodium hydroxide and 1 oxygen gas under heating conditions", which is determined as the target chemical text.

[0166] S740: If the original chemical character string contains other character strings except the first chemical formula character string, and the other character strings successfully match the concentration identifier, based on the second information type, the original chemical character string is identified according to the first sorting of the original chemical character string to generate each second identification result; wherein the second information type includes a chemical formula type, a calculation relationship type, and a conversion relationship type.

[0167] The second information type may be an information type used to represent a chemical formula and / or chemical equation containing ion concentration.

[0168] Specifically, the specific implementation of identifying the original chemical string according to the first sorting of the original chemical string and generating each second recognition result is similar to the specific implementation of identifying the original chemical string according to the first sorting of the original chemical string and generating each first recognition result in the above S710, and will not be repeated here.

[0169] The following is an example of the original chemical string (2):

[0170]

[0171] The original chemical character strings are recognized from left to right to obtain recognition results for each character string. The second recognition results are molecular formula: hypochlorous acid, combine: +, molecular formula: hypochlorite ion, equation: =, molecular formula: bicarbonate ion, combine: +, molecular formula: carbonic acid.

[0172] S750: Based on the textual expression of the concentration relationship formula, convert the second recognition result into a corresponding second partial text.

[0173] Specifically, after obtaining the second recognition result, the electronic device converts the second recognition result into a corresponding second partial text based on the text expression of the concentration relationship formula.

[0174] Taking the second recognition result corresponding to the original chemical character string (2) as an example, the second recognition result is converted, such as converting "molecular formula: hypochlorous acid" to "hypochlorous acid", converting "combine: +" to "add", converting "equation: =" to "equal", etc., to obtain the second partial text.

[0175] S760: Based on the first sorting and the second sorting between the concentration identifier in the original chemical string and the first chemical formula string, concatenate the concentration text and each second partial text to generate a target chemical text corresponding to the original chemical string.

[0176] The second order may be that the first chemical formula character string is in front and the concentration identifier is in the back.

[0177] The concentration text can be "Concentration".

[0178] Specifically, after obtaining the second partial text, the electronic device concatenates the concentration text and each second partial text based on the first sorting and the second sorting between the concentration identifier in the original chemical string and the first chemical formula string to generate a target chemical text corresponding to the original chemical string.

[0179] Exemplarily, after the second partial text and the concentration text of the original chemical character string (2) are concatenated, the corresponding target chemical text obtained is "the concentration of hypochlorous acid plus the concentration of hypochlorite ions is equal to the concentration of bicarbonate ions plus the concentration of carbonic acid".

[0180] The information processing method provided in the embodiment of the present disclosure can extract the original chemical string to be processed based on the start and end identifiers. Afterwards, the information type corresponding to the original chemical string is determined according to other identifiers in the original chemical string except the first chemical formula string. Then, different chemical information processing methods are used to determine the target chemical text according to different information types. When other strings fail to match the concentration identifier, the original chemical string is determined to be a chemical equation, and the target chemical text is generated based on the text expression of the chemical equation; when other strings successfully match the concentration identifier, the original chemical string is determined to be a chemical formula and / or chemical equation containing ion concentrations, and the target chemical text is generated based on the text expression of the concentration relationship. In this way, different original chemical strings can be flexibly processed according to other strings except the first chemical formula string, and a target chemical text that meets the reading specifications of the original chemical string is generated, thereby improving the accuracy of the obtained target chemical text.

[0181] The following is an embodiment of a chemical information processing device provided in an embodiment of the present invention. The device and the chemical information processing methods of the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the chemical information processing device, reference can be made to the embodiments of the above-mentioned chemical information processing methods.

[0182] Fig. 9 FIG. 2 shows a schematic diagram of the structure of a chemical information processing device provided by an embodiment of the present disclosure. Fig. 9 As shown, the chemical information processing device 900 may include:

[0183] A character string determination module 910 is used to determine the text to be processed in response to the target interactive operation, and determine the first chemical formula character string to be processed from the text to be processed;

[0184] The target chemical text acquisition module 920 is used to determine the target chemical formula name corresponding to the first chemical formula string as the target chemical text; wherein the target chemical formula name is determined by querying pre-built mapping information based on at least one parsed string corresponding to the first chemical formula string; the parsed string is obtained by traversing the syntax tree corresponding to the first chemical formula string; the child node of the syntax tree records the unit string in the first chemical formula string; the unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier and a subscript value;

[0185] The text processing operation module 930 is used to generate a natural language text corresponding to the text to be processed based on the target chemical text and the non-chemical text in the text to be processed, and to perform a text processing operation corresponding to the target interactive operation based on the natural language text.

[0186] The chemical information processing device provided by the above-mentioned embodiments of the present disclosure can determine the text to be processed in response to the target interactive operation, and determine the first chemical formula string to be processed from the text to be processed; query the pre-constructed mapping information based on at least one parsed string corresponding to the first chemical formula string, determine the target chemical formula name corresponding to the first chemical formula string, and use the target chemical formula name as the target chemical text; wherein the parsed string is obtained by traversing the syntax tree corresponding to the first chemical formula string; the child node of the syntax tree records the unit string in the first chemical formula string; the unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier and a subscript value; based on the target chemical text and the non-chemical text in the text to be processed, generate a natural language text corresponding to the text to be processed, and perform the text processing operation corresponding to the target interactive operation based on the natural language text, so as to achieve faster conversion of the professional chemical-related string in the text to be processed corresponding to the target interactive operation into the target chemical text, and then generate the natural language text corresponding to the text to be processed according to the target chemical text, thereby reducing the difficulty of understanding chemical information and improving the efficiency of subsequent execution of text processing operations corresponding to the target interactive operation (such as reading aloud, searching, matching, dialogue, etc.).

[0187] In some embodiments, the character string determination module 910 is specifically configured to:

[0188] In response to an interactive operation that triggers execution of a dialog function, the dialog content is determined as text to be processed.

[0189] The text processing operation module 930 is specifically used for:

[0190] Display natural language text in conversational interfaces.

[0191] In some embodiments, the character string determination module 910 is further specifically configured to:

[0192] In response to an interactive operation that triggers the execution of a text reading function, the text content to be read aloud is determined as text to be processed.

[0193] The text processing operation module 930 is also specifically used for:

[0194] Reading is performed based on natural language text.

[0195] In some embodiments, the target chemical text acquisition module 920 is specifically used to:

[0196] Based on the parsed string query, a pre-constructed chemical formula prefix tree is determined to determine the target chemical formula name corresponding to the first chemical formula string as the target chemical text; wherein the tree node of the chemical formula prefix tree records the correspondence between the unit string of the chemical formula and the initialization chemical formula name corresponding to each unit string contained in the path from the root node to the tree node.

[0197] In some embodiments, the chemical information processing apparatus 900 may further include a chemical formula prefix tree construction module, which is used to:

[0198] Obtain a list of chemical objects; wherein the list of chemical objects records the correspondence between the second chemical formula character string and the initial chemical formula name of the chemical object; the chemical object includes at least one of a chemical ion, a chemical nuclide, a chemical element, a chemical single substance, and a chemical compound;

[0199] For any second chemical formula string, a first connecting character is added between any two adjacent characters, and a preset subscript identifier corresponding to the subscript type is added before the subscript value, key information of the second chemical formula string is generated, and the initialization chemical formula name corresponding to the second chemical formula string is determined as value information, and a chemical object database with a key-value pair structure is generated;

[0200] Each tree node is divided based on the first connecting character in the key information, and the value information is stored in the last tree node of the division, and each key-value pair information in the chemical object database is inserted into a preset prefix tree to generate a chemical formula prefix tree.

[0201] In some embodiments, the target chemical text acquisition module 920 is further specifically used for:

[0202] In the process of searching the chemical formula prefix tree in the order of each parsed string, if the parsed string is the second connection character and there is no next-layer tree node in the chemical formula prefix tree that is closest to the tree node that is queried once, then determining the first chemical formula name corresponding to the queried parsed string;

[0203] Continue to query the chemical formula prefix tree based on the order of each parsed character string after the second connection character to determine the second chemical formula name;

[0204] If the second chemical formula name includes a combination of numbers and preset chemical formula names, or the second chemical formula name includes a preset chemical formula name, the second chemical formula name, the name connection text and the first chemical formula name are concatenated to generate a target chemical formula name.

[0205] In some embodiments, the character string determination module 910 is further specifically configured to:

[0206] Based on the start and end identifiers corresponding to the chemical information, an original chemical character string to be processed is extracted from the text to be processed; and a first chemical formula character string is determined from the original chemical character string.

[0207] In some embodiments, the chemical information processing device 900 may further include a first information processing module for:

[0208] After extracting the original chemical character string to be processed from the text to be processed based on the start and end identifiers corresponding to the chemical information, if the original chemical character string contains other character strings except the first chemical formula character string, and the other character strings fail to match the concentration identifier, then based on the first information type, the original chemical character string is identified according to the first sorting of the original chemical character string to generate each first identification result; wherein the first information type includes at least one of a chemical formula type, a coefficient type, a material state type, a reaction relationship type, a reaction condition type, and a conversion relationship type;

[0209] If each first recognition result includes a conversion relationship identifier corresponding to the conversion relationship type, the first recognition result is converted into a corresponding first partial text based on the text expression of the chemical equation;

[0210] The first partial texts are concatenated according to the first sorting to generate a target chemical text corresponding to the original chemical character string.

[0211] In some embodiments, the first information processing module is specifically used to:

[0212] If the first recognition result is the target chemical formula name, and the previous adjacent first recognition result of the first recognition result is not a coefficient value, the default coefficient text and the target chemical formula name are concatenated to generate a first partial text corresponding to the first recognition result.

[0213] In some embodiments, the chemical information processing device 900 may further include a second information processing module for:

[0214] After extracting the original chemical character string to be processed from the text to be processed based on the start and end identifiers corresponding to the chemical information, if the original chemical character string contains other character strings except the first chemical formula character string, and the other character strings successfully match the concentration identifier, then based on the second information type, identifying the original chemical character string according to the first sorting of the original chemical character string, and generating each second recognition result; wherein the second information type includes a chemical formula type, a calculation relationship type, and a conversion relationship type;

[0215] Based on the textual expression of the concentration relationship, converting the second recognition result into a corresponding second partial text;

[0216] Based on the first sorting and the second sorting between the concentration identifier in the original chemical string and the first chemical formula string, the concentration text and each second partial text are concatenated to generate a target chemical text corresponding to the original chemical string.

[0217] The chemical information processing device provided in the embodiment of the present invention can execute the chemical information processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0218] It is worth noting that in the embodiment of the above-mentioned chemical information processing device, the various modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the various functional modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this disclosure.

[0219] The present disclosure also provides an electronic device, which may include a processor and a memory, wherein the memory may be used to store executable instructions, wherein the processor may be used to read the executable instructions from the memory and execute the executable instructions to implement the chemical information processing method in the above embodiment.

[0220] Fig.10 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown.

[0221] like Fig.10 As shown, the electronic device 1000 may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output interface (I / O interface) 1005 is also connected to the bus 1004.

[0222] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data.

[0223] It should be noted that Fig.10 The electronic device 1000 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure. Fig.10 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0224] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the chemical information processing method of any embodiment of the present disclosure are executed.

[0225] The embodiments of the present disclosure further provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the chemical information processing method in any embodiment of the present disclosure.

[0226] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0227] In some embodiments, the client and server may communicate using any currently known or future developed network protocol such as HTTP, and may be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0228] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0229] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the steps of the chemical information processing method described in any embodiment of the present disclosure.

[0230] In embodiments of the present disclosure, computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0231] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing 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 boxes represented in succession 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 flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0232] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0233] 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.

[0234] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0235] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0236] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A chemical information processing method, It is characterized in that include: In response to the target interactive operation, determining a text to be processed, and determining a first chemical formula character string to be processed from the text to be processed; Determine a target chemical formula name corresponding to the first chemical formula string as a target chemical text; wherein the target chemical formula name is determined by querying pre-constructed mapping information based on at least one parsed string corresponding to the first chemical formula string; the parsed string is obtained by traversing a syntax tree corresponding to the first chemical formula string; a child node of the syntax tree records a unit string in the first chemical formula string; the unit string includes a chemical element, or a string composed of a chemical element, a preset subscript identifier and a subscript value; Based on the target chemical text and the non-chemical text in the text to be processed, a natural language text corresponding to the text to be processed is generated, and a text processing operation corresponding to the target interactive operation is performed based on the natural language text.

2. The method according to claim 1, It is characterized in that The step of determining the text to be processed in response to the target interactive operation includes: In response to the interactive operation that triggers the execution of the dialogue function, determining the dialogue content as the text to be processed; The performing of the text processing operation corresponding to the target interaction operation based on the natural language text includes: The natural language text is displayed in a dialogue interface.

3. The method according to claim 1, It is characterized in that The step of determining the text to be processed in response to the target interactive operation includes: In response to an interactive operation that triggers the execution of a text reading function, determining the text content to be read aloud as the text to be processed; The performing of the text processing operation corresponding to the target interaction operation based on the natural language text includes: A reading process is performed based on the natural language text.

4. The method according to claim 1, It is characterized in that Querying pre-built mapping information based on at least one parsed string corresponding to the first chemical formula string to determine a target chemical formula name corresponding to the first chemical formula string includes: Based on the parsed character string, a pre-constructed chemical formula prefix tree is queried to determine the target chemical formula name corresponding to the first chemical formula character string as the target chemical text; wherein the tree node of the chemical formula prefix tree records the correspondence between the unit character string of the chemical formula and the initial chemical formula name corresponding to each unit character string contained in the path from the root node to the tree node.

5. The method according to claim 4, It is characterized in that The chemical formula prefix tree is pre-constructed in the following manner: Obtain a list of chemical objects; wherein the list of chemical objects records the correspondence between the second chemical formula character string of the chemical object and the initial chemical formula name; the chemical object includes at least one of a chemical ion, a chemical nuclide, a chemical element, a chemical single substance and a chemical compound; For any of the second chemical formula character strings, a first connecting character is added between any two adjacent characters, and a preset subscript identifier corresponding to the subscript type is added before the subscript value, key information of the second chemical formula character string is generated, and the initialization chemical formula name corresponding to the second chemical formula character string is determined as value information, and a chemical object database of a key-value pair structure is generated; The tree nodes are divided based on the first connecting character in the key information, and the value information is stored in the last divided tree node. Each key-value pair information in the chemical object database is inserted into a preset prefix tree to generate the chemical formula prefix tree.

6. The method according to claim 4, It is characterized in that The step of querying a pre-constructed chemical formula prefix tree based on the parsed character string to determine a target chemical formula name corresponding to the first chemical formula character string includes: In the process of searching the chemical formula prefix tree in the order of the resolved character strings, if the resolved character string is a second connecting character and there is no next-layer tree node in the chemical formula prefix tree that is closest to the tree node that is queried once, determining the first chemical formula name corresponding to the queried resolved character string; Continue to query the chemical formula prefix tree based on the order of each of the parsed character strings after the second connecting character to determine the second chemical formula name; If the second chemical formula name includes a combination of numbers and preset chemical formula names, or the second chemical formula name includes the preset chemical formula name, the second chemical formula name, the name connection text and the first chemical formula name are concatenated to generate the target chemical formula name.

7. The method according to any one of claims 1 to 6, It is characterized in that The step of determining a first chemical formula character string to be processed from the text to be processed includes: Extracting the original chemical character string to be processed from the text to be processed based on the start and end identifiers corresponding to the chemical information; The first chemical formula string is determined from the original chemical formula string.

8. The method according to claim 7, It is characterized in that After extracting the original chemical character string to be processed from the text to be processed based on the start and end identifiers corresponding to the chemical information, the method further includes: If the original chemical character string contains other character strings except the first chemical formula character string, and the other character strings fail to match the concentration identifier, the original chemical character string is identified according to the first sorting of the original chemical character string based on the first information type to generate each first identification result; wherein the first information type includes at least one of a chemical formula type, a coefficient type, a material state type, a reaction relationship type, a reaction condition type, and a conversion relationship type; If each of the first recognition results contains a conversion relationship identifier corresponding to the conversion relationship type, converting the first recognition result into a corresponding first partial text based on a text expression of a chemical equation; The first partial texts are concatenated according to the first sorting to generate a target chemical text corresponding to the original chemical character string.

9. The method according to claim 8, It is characterized in that The converting the first recognition result into a corresponding first partial text includes: If the first recognition result is the target chemical formula name, and the previous adjacent first recognition result of the first recognition result is not a coefficient value, the default coefficient text and the target chemical formula name are concatenated to generate the first partial text corresponding to the first recognition result.

10. The method according to claim 7, It is characterized in that After extracting the original chemical character string to be processed from the text to be processed based on the start and end identifiers corresponding to the chemical information, the method further includes: If the original chemical character string contains other character strings except the first chemical formula character string, and the other character strings successfully match the concentration identifier, then based on the second information type, the original chemical character string is identified according to the first sorting of the original chemical character string to generate each second identification result; wherein the second information type includes a chemical formula type, a calculation relationship type, and a conversion relationship type; Based on the textual expression of the concentration relationship, converting the second recognition result into a corresponding second partial text; Based on the first sorting and the second sorting between the concentration identifier and the first chemical formula string in the original chemical string, the concentration text and each of the second partial texts are concatenated to generate a target chemical text corresponding to the original chemical string.

11. A chemical information processing device, It is characterized in that include: A character string determination module, used for determining a text to be processed in response to a target interactive operation, and determining a first chemical formula character string to be processed from the text to be processed; A target chemical text acquisition module is used to determine a target chemical formula name corresponding to the first chemical formula string as a target chemical text; wherein the target chemical formula name is determined by querying pre-built mapping information based on at least one parsed string corresponding to the first chemical formula string; the parsed string is obtained by traversing a syntax tree corresponding to the first chemical formula string; and a child node of the syntax tree records a unit string in the first chemical formula string; The unit character string includes a chemical element, or a character string composed of a chemical element, a preset subscript identifier and a subscript value; The text processing operation module is used to generate a natural language text corresponding to the text to be processed based on the target chemical text and the non-chemical text in the text to be processed, and to perform a text processing operation corresponding to the target interactive operation based on the natural language text.

12. An electronic device, It is characterized in that include: processor; A memory for storing executable instructions; Wherein, the processor is used to read the executable instructions from the memory and execute the executable instructions to implement the chemical information processing method described in any one of claims 1 to 10.

13. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the chemical information processing method according to any one of claims 1 to 10.