A method for generating crystal material structure based on semantic understanding, computer readable storage medium and computer program product

By combining large language models and material crystal structure databases, a natural language interaction method based on semantic understanding is realized, which solves the problem of accessing and querying material crystal structure databases in the prior art, and improves the ease of use and research efficiency of the database.

CN118820284BActive Publication Date: 2024-12-27TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411281879.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-27
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

The existing technology is difficult to access and query the database of material crystal structures in an easy and efficient manner, which limits the progress of material informatics research.

Method used

Using a semantic understanding method, the large language model is combined with the material crystal structure database, and the natural language query is converted into structured data to realize the query of databases such as Materials Project, including the construction of elemental material structure, common crystal structure, and general crystal State material database query and element substitution query.

Benefits of technology

It provides natural language interaction methods other than web pages, REST APIs, and Python libraries, which lowers the threshold for researchers to use, improves the ease of use of Materials Project database, and simplifies the process of querying crystal structure information by material researchers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820284B_ABST
    Figure CN118820284B_ABST
Patent Text Reader

Abstract

A method for generating crystal material structure based on semantic understanding includes: first, using a large language model to structure the user's natural language query; second, for the query of single-element materials, the crystal structure is constructed through the single-element crystal structure database; then, for the query of the specified common crystal structure type, the structure is constructed using the material simulation tool library; for the chemical formula that is not single-element and does not specify the common structure, the general crystalline material database query is performed; if there is no matching result in the database query, the possible related crystal structure is queried by element substitution; finally, the crystal structure information obtained by the query is converted into a suitable file format for output. This method realizes the effective integration of unstructured data and structured data through natural language processing technology, and simplifies the query process of crystal structure information by material researchers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a material crystal structure database and an application of a large language model, and in particular to a method for generating a crystal material structure based on semantic understanding. Background Art

[0002] Since the "Materials Genome Project", the data-driven materials informatics research paradigm based on high-throughput and machine learning has become increasingly important. The materials database represented by the Materials Project is one of its cornerstones. The Materials Project materials database contains more than 100,000 entries for batteries, photovoltaics, thermoelectrics, catalysis, etc., which can be accessed through web pages, REST APIs or Python libraries. How to enable researchers to access the Materials Project database more conveniently and efficiently, thereby promoting materials informatics research, is a challenge faced by existing technologies.

[0003] It should be noted that the information disclosed in the above background technology section is only used for understanding the background of the present application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0004] In recent years, generative large language models based on trillion-level parameters and training sets, represented by OpenAI's Generative Pre-trained Transformer (GPT), are gradually replacing traditional natural language processing tools. GPT-4 has demonstrated a level comparable to that of ordinary people and domain experts in areas such as reading comprehension and code. The inventors proposed a solution of the present invention by combining access to a material crystal structure database with large language model technology.

[0005] The main purpose of the present invention is to solve the problems existing in the above-mentioned background technology and provide a method for generating crystal material structure based on semantic understanding.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for generating a crystal material structure based on semantic understanding comprises the following steps:

[0008] S1. Query sentence structuring: Use a large language model to convert the natural language query sentence input by the user into structured data;

[0009] S2. Single-element material structure construction: Based on the structured data obtained in step S1, if the query object is confirmed to be a single-element material, its crystal structure is constructed based on the single-element crystal structure database;

[0010] S3, common crystal structure construction: based on the structured data obtained in step S1, if the user query specifies a common crystal structure type, its crystal structure is constructed based on its definition using the material simulation tool library;

[0011] S4. Querying a general crystalline material database: For the chemical formula contained in the structured data obtained in step S1, if it does not belong to a single material and does not specify a common crystal structure type, access the crystalline material database for query;

[0012] S5. Element substitution query: For queries with no matching results in the crystal material database, search for possible related crystal structures by replacing elements of the same main group;

[0013] S6. Crystal material file format conversion: According to the crystal structure information obtained by the query, convert and output the appropriate crystal structure data file.

[0014] Further:

[0015] The large language model is GPT-4, and the structured data is output in JSON format for query parameter parsing in subsequent steps.

[0016] Step S1 specifically includes:

[0017] Guide users to enter natural language query statements through user interface prompts and user prompt templates;

[0018] Use large language models and system prompts to convert user input into structured data;

[0019] Validate the format and content of the generated structured data.

[0020] Step S2 specifically includes:

[0021] Convert chemical formulas into a specialized data format suitable for material simulation, using the pymatgen library for format conversion and verification;

[0022] Confirm whether the converted chemical formula belongs to one of the predefined single-element material list. If so, continue with the subsequent steps; otherwise, return the query result;

[0023] According to the confirmed single-element material, query the WebElements database to obtain its specific crystal structure parameters, including space group symbols and crystal structure constants;

[0024] Use the ase.spacegroup library and the obtained structural parameters to build an atomic structure model of a single material.

[0025] Step S3 specifically includes:

[0026] Check whether there is an explicit requirement or description for the crystal structure in the structured query parameters, and whether the specified crystal structure is one of the predefined common crystal structures;

[0027] If the specified crystal structure is a common crystal structure, but the user does not provide the unit cell parameters, the default unit cell parameters of the corresponding crystal structure are used;

[0028] Based on the crystal structure type and unit cell parameters, the crystal structure is constructed through the ase.build module.

[0029] The common crystal structures include simple cubic (sc), face-centered cubic (fcc), body-centered cubic (bcc), hexagonal close-packed (hcp), diamond, zinc blende, rocksalt, cesium chloride, and fluorite.

[0030] Step S4 specifically includes:

[0031] Use the mp-api library to establish a session with the new API endpoint of the Materials Project database for crystal structure data retrieval;

[0032] According to the structured query parameters obtained in step S1, searching for crystal structure entries matching the user's chemical formula in the Materials Project database;

[0033] If there are multiple matching crystal structure entries, the following analysis is performed to determine the most stable and plausible crystal structure:

[0034] i. List the matching crystal structures and their formation energies, data sources and entry IDs;

[0035] ii. The crystal structure with the lowest formation energy is preferred, as it is considered to be the most thermodynamically stable;

[0036] iii. Among the low formation energy structures, experimentally determined structures are preferred;

[0037] iv. If there are still multiple options, select the crystal structure that was first entered into the database;

[0038] If no matching crystal structure is found, step S5 is executed, which specifically includes:

[0039] i. Convert the user chemical formula to pymatgen's Formula format and process it into a dictionary;

[0040] ii. Obtain a list of elements in the same main group for each element and perform a Cartesian product operation to obtain possible chemical formula substitutions;

[0041] iii. Requery the Materials Project database using the replaced chemical formula set;

[0042] iv. If there are still no matching entries after re-querying, execute the error reporting procedure.

[0043] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method for generating a crystal material structure based on semantic understanding.

[0044] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the method for generating a crystal material structure based on semantic understanding is implemented.

[0045] The present invention has the following beneficial effects:

[0046] The present invention provides a method for generating crystal material structures based on semantic understanding, which can realize a fourth natural language interaction-based query material crystal structure database such as Materials Project database in addition to web pages, REST API, and Python library. The natural language interface eliminates the need for researchers to learn the Materials Project programming interface, and improves the ease of use of the Materials Project database.

[0047] The existing programming language based on abstract syntax tree is a completely precise, structured, machine-oriented human-computer interaction method, while the fuzzy, generative large language model is more user-friendly. The human-computer interaction method based on natural language (rather than API interface or library function) is applied to the query of materials database, which can reduce the thinking burden and usage threshold of materials researchers, communicate and integrate non-structured data such as natural language-based literature and structured data such as Materials Project, and accelerate the practical application of materials research and artificial intelligence large language model.

[0048] The embodiment of the present invention implements an easy-to-use natural language-based Materials Project query interface by encapsulating the programming query syntax of Materials Project and the query process logic based on material domain knowledge.

[0049] Other beneficial effects of the embodiments of the present invention will be further described below. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] FIG1 is a flow chart of a method for generating a crystal material structure based on semantic understanding according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope and application of the present invention.

[0052] The embodiment of the present invention realizes the effective integration of unstructured data and structured data through natural language processing technology, and simplifies the query process of crystal structure information by material researchers.

[0053] A method for generating a crystal material structure based on semantic understanding, the method comprising the following steps:

[0054] (a) Query sentence structuring: Use a large language model to convert the natural language query sentences entered by users into structured data;

[0055] (b) Single-element material structure construction: For single-element materials, their crystal structures are constructed based on the single-element crystal structure database;

[0056] (c) Construction of common crystal structures: For common crystal structure types, their crystal structures are constructed based on their definitions;

[0057] (d) General crystalline material database query: Based on the user's query statement, select the appropriate API to access the crystalline material database;

[0058] (e) Element substitution query: For queries with no matching results in the crystal material database, possible related crystal structures are searched by replacing the same main group elements;

[0059] (f) Crystal material file format conversion: Based on the user query statement, convert and output the appropriate crystal structure data file.

[0060] In step a above, OpenAI's GPT-4 large language model is used for natural language processing, and the JSON mode of the GPT-4 large language model is used to output structured data in JSON format;

[0061] In some embodiments, in the above step b, a crawled WebElements single-element crystalline structure database is used;

[0062] In some embodiments, in the above step c, the Atomic Simulation Environment (ase) library is used to construct the common crystal structures such as fcc / bcc / hcp supported by it;

[0063] In some embodiments, in the above step d, the crystal structure is queried using the Materials Project database;

[0064] In some embodiments, in the above step e, the material chemical formula is processed using the pymatgen library;

[0065] In some embodiments, in the above step f, the crystal structure is converted using an ase library.

[0066] Given a natural language description of a material that a user wants to find, the embodiment of the present invention can search the Materials Project database on behalf of the user through the following steps to return the material structure information required by the user:

[0067] 1. Use GPT-4 to extract structured information from natural language descriptions;

[0068] 2. For single-element materials, use the Python ase software library to build and return the crystal structure based on the single-element material crystal structure data in the WebElements database;

[0069] 3. For common crystal structures such as face-centered cubic, use the Python ase software library to build and return the crystal structure;

[0070] 4. For general compounds, use the Python mp-api library to query the Materials Project and return the best matching crystal structure.

[0071] • In the case where no compound is found, an attempt is made to search for compounds with similar elemental composition and the best matching crystal structure is returned.

[0072] • In cases where there are multiple matches in the database, preference is given to structures that are most stable relative to the convex hull of the thermodynamic phase diagram, structures observed experimentally, and structures recorded earlier.

[0073] Example

[0074] 1. Use OpenAI GPT-4 large language model to analyze user requests and extract structured information from free text. Based on OpenAI's ChatCompletion interface, gpt-4-1106-preview model and JSON mode function, through prompt engineering, based on system prompts and user prompt templates, GPT-4-Turbo outputs structured query parameters in JSON format:

[0075] (a) Prompt the user to enter a query statement in free text format.

[0076] (b) Based on the system prompt and user prompt template, construct a request to the ChatCompletionAPI end point.

[0077] (c) Retrieve the request result, check and parse the string generated by the generative AI that (theoretically) conforms to the JSON format. This string is the structured query parameters extracted from the free text query statement entered by the user.

[0078] Example 1. User input and natural language processing based on large models

[0079] (a) The user enters the natural language query sentence "I'm looking for Lithium's crystal structure in cif format";

[0080] (b) The system prompts "The user wants to search for a crystal structure. Parse the user's query into JSON format";

[0081] (c) The system returns structured query parameters in JSON format

[0082] {

[0083] "chemical-formula": "Li",

[0084] "file-format": "cif"

[0085] }

[0086] 2. For single-element materials, generate their crystal structures based on the WebElements periodic single-element experimental crystal structure database and ase library:

[0087] (a) Convert the chemical formula to the Formula format of the pymatgen library and check whether it belongs to one of the 118 single-element materials. If it is a single-element material, extract its element symbol.

[0088] (b) Load the WebElements periodic table database. This database contains the crystal structures of 118 (incomplete) single-element materials, including their space group symbol codes, Bravais lattice types, crystal structure constants and angles, stored in JSON format.

[0089] (c) Query the WebElements database to obtain the space group symbol and crystal structure constants of a given elemental material.

[0090] (d) Based on the structural parameters of the single material, the atomic structure is constructed using the ase.spacegroup library and converted and output into the format requested by the user. If the user does not specify the crystal structure output file format, the default output is the cif format file.

[0091] Example 2. Li element

[0092] (a) WebElements database entries for Li

[0093] {

[0094] "Li": {

[0095] "SpaceGroup": "Im-3m",

[0096] "SpaceGroupNumber": 229,

[0097] "Structure": "bcc",

[0098] "CellParameters": {

[0099] "a": 351,

[0100] "b": 351,

[0101] "c": 351,

[0102] "alpha": 90.0,

[0103] "beta": 90.0,

[0104] "gamma": 90.0

[0105] }

[0106] }

[0107] }

[0108] (b) The atomic structure of Li in ase.Atoms format:

[0109] Atoms(symbols='Li2', pbc=True, cell=[3.5, 3.5, 3.5], spacegroup_kinds=...)

[0110] (c) The atomic structure of Li in cif format:

[0111] data_image0

[0112] _chemical_formula_structural Li2

[0113] _chemical_formula_sum "Li2"

[0114] _cell_length_a 3.5

[0115] _cell_length_b 3.5

[0116] _cell_length_c 3.5

[0117] _cell_angle_alpha 90

[0118] _cell_angle_beta 90

[0119] _cell_angle_gamma 90

[0120] _space_group_name_H-M_alt "P 1"

[0121] _space_group_IT_number 1

[0122] loop_

[0123] _space_group_symop_operation_xyz

[0124] 'x, y, z'

[0125] loop_

[0126] _atom_site_type_symbol

[0127] _atom_site_label

[0128] _atom_site_symmetry_multiplicity

[0129] _atom_site_fract_x

[0130] _atom_site_fract_y

[0131] _atom_site_fract_z

[0132] _atom_site_occupancy

[0133] Li Li11.00.000000.000000.000001.0000

[0134] Li Li21.00.500000.500000.500001.0000

[0135] 3. For common crystal structures, generate the corresponding crystal structure based on the crystal structure framework and the given lattice parameters and chemical composition.

[0136] Here, "common crystal structures" refer to simple cubic (sc), face-centered cubic (fcc), body-centered cubic (bcc), hexagonal close-packed (hcp), diamond, zincblende, rock salt, cesium chloride, and fluorite.

[0137] (a) Check whether there is a clear requirement or description for the crystal structure in the structured query parameters, and whether the specified crystal structure is one of the common crystal structures mentioned above.

[0138] (b) If the specified crystal structure is a common crystal structure but the user does not provide the unit cell parameters, the default unit cell parameters of the corresponding crystal structure are used.

[0139] (c) Based on the crystal structure type and unit cell parameters, the crystal structure is constructed through the ase.build module and converted into the output file format required by the user.

[0140] Example 3. fcc-Fe

[0141] (a) Structured query parameters:

[0142] {

[0143] "chemical-formula": "Fe",

[0144] "lattice-type": "fcc",

[0145] "file-format": "cif"

[0146] }

[0147] (b) Structural query parameters after completing the unit cell parameters:

[0148] {

[0149] "chemical-formula": "Fe",

[0150] "lattice-type": "fcc",

[0151] "lattic-constant": 404,

[0152] "file-format": "cif"

[0153] }

[0154] (c) Summary of the generated lattice structure in ase.Atoms format

[0155] Atoms(symbols='Fe', pbc=True, cell=[[0.0, 2.02, 2.02], [2.02, 0.0,2.02], [2.02,

[0156] 2.02, 0.0]])

[0157] (d) The generated crystal structure in cif format

[0158] data_image0

[0159] _chemical_formula_structural Fe

[0160] _chemical_formula_sum "Fe1"

[0161] _cell_length_a 2.85671

[0162] _cell_length_b 2.85671

[0163] _cell_length_c 2.85671

[0164] _cell_angle_alpha 60

[0165] _cell_angle_beta 60

[0166] _cell_angle_gamma 60

[0167] _space_group_name_H-M_alt "P 1"

[0168] _space_group_IT_number 1

[0169] loop_

[0170] _space_group_symop_operation_xyz

[0171] 'x, y, z'

[0172] loop_

[0173] _atom_site_type_symbol

[0174] _atom_site_label

[0175] _atom_site_symmetry_multiplicity

[0176] _atom_site_fract_x

[0177] _atom_site_fract_y

[0178] _atom_site_fract_z

[0179] _atom_site_occupancy

[0180] Fe Fe11.00.000000.000000.000001.0000

[0181] 4. For general crystal structures, query their crystal structures from Materials Project.

[0182] (a) Use the mp-api library to establish a session with the Materials Project new API endpoint.

[0183] (b) Based on the structured query parameters extracted above, search the Materials Project database for entries that match the chemical formula provided by the user.

[0184] When there are multiple database crystal structure entries that match the chemical formula provided by the user, the following methods are used to analyze and retrieve the crystal structure that is most likely to meet the user's requirements, has the highest accuracy, and is the most stable and reliable:

[0185] i. The crystal structure to which the chemical formula is matched, the energy above hull, the nature of the data source (theoretical calculation or experiment), and a list of entry IDs.

[0186] ii. Prioritize returning to the crystal structure with the lowest formation energy, which is therefore the most thermodynamically stable structure and the most likely to exist naturally.

[0187] iii. If there are multiple stable crystal structures with low formation energy, the experimentally determined crystal structure will be returned first. The calculated crystal structure may not be accurate enough or has not been verified by synthesis.

[0188] iv. If there are still multiple possible crystal structure options, choose the crystal structure with the earliest entry time, which is often the most common traditional crystal structure. The new crystal structure is more likely to be a theoretically proposed, exotic and novel model, which is not suitable for querying common crystal structures.

[0189] Example 4. NaCl

[0190] i. Structured query parameters:

[0191] {

[0192] "chemical-formula": "NaCl",

[0193] "file-format": "cif"

[0194] }

[0195] ii. The Materials Project database entry ID that matches the chemical formula:

[0196] [1018810, 1077015, 1077288, 990084, 1064484, 1069676, 1095060,1120767, 22851,

[0197] 22862, 1078558, 1189265, 1080771]

[0198] iii. Among them, the star-marked entries IDs are: 22851, 22862, 1078558.

[0199] iv. The entry ID with the lowest energy above hull: 22862.

[0200] v. The CIF format crystal structure of this entry:

[0201] # generated using pymatgen

[0202] data_NaCl

[0203] _symmetry_space_group_name_H-M 'P 1'

[0204] _cell_length_a 5.58812644

[0205] _cell_length_b 5.58812644

[0206] _cell_length_c 5.58812644

[0207] _cell_angle_alpha 90.00000000

[0208] _cell_angle_beta 90.00000000

[0209] _cell_angle_gamma 90.00000000

[0210] _symmetry_Int_Tables_number 1

[0211] _chemical_formula_structural NaCl

[0212] _chemical_formula_sum 'Na4 Cl4'

[0213] _cell_volume 174.50130186

[0214] _cell_formula_units_Z 4

[0215] loop_

[0216] _symmetry_equiv_pos_site_id

[0217] _symmetry_equiv_pos_as_xyz

[0218] 1 'x, y, z'

[0219] loop_

[0220] _atom_type_symbol

[0221] _atom_type_oxidation_number

[0222] Na+ 1.0

[0223] Cl- -1.0

[0224] loop_

[0225] _atom_site_type_symbol

[0226] _atom_site_label

[0227] _atom_site_symmetry_multiplicity

[0228] _atom_site_fract_x

[0229] _atom_site_fract_y

[0230] _atom_site_fract_z

[0231] _atom_site_occupancy

[0232] Na+ Na010.000000000.000000000.000000001

[0233] Na+ Na110.000000000.500000000.500000001

[0234] Na+ Na210.500000000.000000000.500000001

[0235] Na+ Na310.500000000.500000000.000000001

[0236] Cl- Cl410.000000000.000000000.500000001

[0237] Cl- Cl510.000000000.500000000.000000001

[0238] Cl- Cl610.500000000.000000000.000000001

[0239] Cl- Cl710.500000000.500000000.500000001

[0240] (c) When no crystal structures matching the user-provided chemical formula are found, the possibility that qualitatively similar structures exist is considered.

[0241] For example, double perovskite materials all have similar crystal structures, but due to the high diversity of element combinations, there are thousands of possible chemical formulas, and not every chemical formula has an entry in the Materials Project, even if its structure is relatively certain. For another example, NaCl has a rock salt structure, and K and Na are in the same main group and have similar chemical structures, so it can be inferred that KCl also has a rock salt structure. In order to make full use of the data entries of the Materials Project, when there is a possible structure that is stereotypically similar to the user's query structure, it will also be returned and recommended to the user to use such a related crystal structure.

[0242] i. Convert the chemical formula provided by the user into pymatgen.Formula format and then into dictionary format.

[0243] ii. For each element in the component, get its main group number and get a list of all elements in the same main group from pymatgen.core.Element.

[0244] iii. Based on the chemical component dictionary, or a set of chemical elements, a list of replaceable elements in the same main group is obtained. Based on the itertools library, a Cartesian product of the list is performed to obtain a list of all possible chemical element components obtained by replacing elements in the same main group. Combining each chemical element component obtained by replacement with the stoichiometric number of the original component, all possible chemical formulas that can be obtained by replacing elements in the same main group are obtained.

[0245] iv. Based on the set of chemical formulas obtained by replacing elements of the same main group, re-query the Materials Project for matching crystal structure entries. When there are multiple entries that match, the most stable and reliable experimentally measured crystal structure with the earliest entry time should be selected through the above method.

[0246] v. If no matching crystal structure entry is found, an error is reported.

[0247] Example 5. Fe2Te3

[0248] i. Structured query parameters:

[0249] {

[0250] "chemical-formula": "Fe2Te3",

[0251] "file-format": "cif"

[0252] }

[0253] ii. List of elements obtained by replacing O with elements of the same main group:

[0254] ['O', 'S', 'Se', 'Te', 'Po']

[0255] iii. List of chemical formulas obtained by performing homologous substitution on the entire chemical formula: [

[0257] {'Fe': 2, 'O': 3},

[0258] {'Fe': 2, 'S': 3},

[0259] {'Fe': 2, 'Se': 3},

[0260] {'Fe': 2, 'Te': 3},

[0261] {'Ru': 2, 'O': 3},

[0262] {'Ru': 2, 'S': 3}, ... ]

[0265] iv. First, find the crystal structure of the chemical components that match the main group substitution in Materials Project.

[0266] Body structure: Fe2O3.

[0267] (d) Convert the crystal structure found by the query into the file format required by the user and write the file.

[0268] Taking the single substance Li and the compound Fe3Te4 as examples, the data and behaviors involved in the present invention are described in detail below.

[0269] Example 6. Elemental Li

[0270] 1. The user enters the natural language query sentence "Give me the crystal structure of Lithium please";

[0271] 2. Analyze the user request using the gpt-4-1106-preview model by requesting OpenAI's ChatCompletion endpoint to obtain the target chemical formula Li and the target file structure cif;

[0272] 3. Li is a single substance. By querying the WebElements database, its space group is 229 and the unit cell parameter is 351pm;

[0273] 4. Use the ase library to build the crystal structure;

[0274] 5. Convert it into cif format according to user requirements and return it to the user.

[0275] Example 7. Compound Fe3Te4

[0276] 1. The user enters the natural language query "Fe3Te4in xyz format";

[0277] 2. By requesting OpenAI's ChatCompletion endpoint, the gpt-4-1106-preview model is used to analyze the user request and obtain the target chemical formula Fe3Te4 and the target file structure xyz;

[0278] 3. Fe3Te4 is not a single substance, nor is it marked as a common crystal structure such as fcc. No matches were found when querying the Materials Project database using the mp-api library;

[0279] 4. Try to replace the same main group elements to get the chemical formula Fe3Te4; use the mp-api library to query the MaterialsProject database and find multiple matches; select the earliest experimental structure with the lowest energy above hull;

[0280] 5. Convert it into xyz format according to user requirements and return it to the user.

[0281] In summary, this invention targets some common crystal material structure generation application scenarios, combines Materials Project database query, GPT-4 large language model and built-in logic, and implements a crystal material structure generation method based on semantic understanding.

[0282] An embodiment of the present invention further provides a storage medium for storing a computer program, which at least performs the above method when executed.

[0283] An embodiment of the present invention further provides a control device, comprising a processor and a storage medium for storing a computer program; wherein the processor is configured to execute at least the method described above when executing the computer program.

[0284] An embodiment of the present invention further provides a processor, wherein the processor executes a computer program and at least executes the method described above.

[0285] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a ferromagnetic random access memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The storage medium described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0286] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0287] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0288] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0289] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.

[0290] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0291] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0292] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0293] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0294] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art of the present invention, several equivalent substitutions or obvious variations can be made without departing from the concept of the present invention, and the performance or use is the same, which should be regarded as belonging to the protection scope of the present invention.

Claims

1. A method for generating crystal material structure based on semantic understanding, characterized in that: The following steps are involved: S1. Query statement structuring: using a large language model to convert a natural language query statement input by a user into structured data; specifically including: guiding a user to input a natural language query statement through a user interface prompt and a user prompt template; using a large language model and a system prompt, converting the user input into structured data, wherein the structured data is output in JSON format for query parameter parsing in subsequent steps, formatting and content verification of the structured data output in JSON format, and returning structured query parameters, wherein the information contained in the structured query parameters includes a single material, or a specified common crystal structure type, or a chemical formula that does not belong to a single material and does not specify a common crystal structure type; S2. Single-element material structure construction: Based on the structured query parameters obtained in step S1, if the query object is confirmed to be a single-element material, its crystal structure is constructed based on the single-element crystal structure database; S3, common crystal structure construction: based on the structured query parameters obtained in step S1, if the user query specifies a common crystal structure type, its crystal structure is constructed based on its definition using the material simulation tool library; S4. Querying a general crystalline material database: For the chemical formula contained in the structured query parameters obtained in step S1, if it does not belong to a single material and does not specify a common crystal structure type, access the crystal material database to query and obtain the most stable and reliable crystal structure; S5. Element substitution query: For queries with no matching results in the crystal material database, find related crystal structures by replacing elements from the same main group; S6. Crystal material file format conversion: convert and output the crystal structure data file according to the crystal structure information obtained by query; Step S4 specifically includes: Use the mp-api library to establish a session with the new API endpoint for the Materials Project database. According to the structured query parameters obtained in step S1, searching for crystal structure entries matching the user's chemical formula in the Materials Project database; If there are multiple matching crystal structure entries, the following analysis is performed to determine the most stable and plausible crystal structure: i. List the matching crystal structures and their formation energies, data sources and entry IDs; ii. The crystal structure with the lowest formation energy is preferred, as it is considered to be the most thermodynamically stable; iii. Among the low formation energy structures, experimentally determined structures are preferred; iv. If there are still multiple options, select the crystal structure that was first entered into the database; If no matching crystal structure is found, step S5 is executed, which specifically includes: i. Convert the user chemical formula to pymatgen's Formula format and process it into a dictionary; ii. Get a list of elements in the same main group for each element and perform a Cartesian product operation to obtain the chemical formula replacement; iii. Requery the Materials Project database using the replaced chemical formula set; iv. If there are still no matching entries after re-querying, execute the error reporting procedure.

2. The method for generating crystal material structure based on semantic understanding according to claim 1, characterized in that: The large language model is GPT-4.

3. The method for generating crystal material structure based on semantic understanding according to claim 1, characterized in that: Step S2 specifically includes: Convert chemical formulas into a specialized data format suitable for material simulation, using the pymatgen library for format conversion and verification; Confirm whether the converted chemical formula belongs to one of the predefined single-element material list. If so, continue with the subsequent steps; otherwise, return the query result; According to the confirmed single-element material, query the WebElements database to obtain its specific crystal structure parameters, including space group symbols and crystal structure constants; Use the ase.spacegroup library and the obtained structural parameters to build an atomic structure model of a single material.

4. The method for generating crystal material structure based on semantic understanding according to claim 1, characterized in that: Step S3 specifically includes: Check whether there is an explicit requirement or description for the crystal structure in the structured query parameters, and whether the specified crystal structure is one of the predefined common crystal structures; If the specified crystal structure is a common crystal structure, but the user does not provide the unit cell parameters, the default unit cell parameters of the corresponding crystal structure are used; Based on the crystal structure type and unit cell parameters, the crystal structure is constructed through the ase.build module.

5. The method for generating crystal material structure based on semantic understanding according to claim 4, characterized in that: The common crystal structures include simple cubic, face-centered cubic, body-centered cubic, hexagonal closest packing, diamond type, sphalerite structure, rock salt structure, cesium chloride structure, and fluoride structure.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for generating a crystal material structure based on semantic understanding as described in any one of claims 1 to 5 is implemented.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating a crystal material structure based on semantic understanding as described in any one of claims 1 to 5 is implemented.