Optimization method and system for generating mathematical formula format based on large language model

By building a multi-level scoring and library system, identifying user proficiency and intentions, and dynamically adjusting the generated mathematical formula format, the problems of instability and frequent errors in generating mathematical formulas in large language models are solved, and higher generation accuracy and user experience are achieved.

CN119647410BActive Publication Date: 2025-06-06BEIJING CORAL REEF INTELLIGENT TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411790325.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-06-06
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

When generating mathematical formulas, existing large language models have problems such as unstable output results and output formats, frequent formula errors, and inaccurate analysis that do not meet user expectations.

Method used

Build a proficiency scoring system, intention library, keyword library and multi-level template library, evaluate user proficiency through multi-dimensionality, identify user intentions, dynamically select the best template, and adjust the formula format through format conversion functions to improve the accuracy and stability of the generated results.

Benefits of technology

It improves the accuracy of user intention recognition, ensures that the generated mathematical formulas are more in line with user expectations, reduces the probability of misunderstandings and errors, reduces the workload of user manual corrections, and improves work efficiency and format flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647410B_ABST
    Figure CN119647410B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing, and in particular to an optimization method and system for generating a mathematical formula format based on a large language model. The method mainly includes: constructing a proficiency scoring system, an intent library, a keyword library, and a multi-level template library; determining the user's current proficiency level of using the large language model; based on intent information and keywords, obtaining a template that matches the question input text and generating an initial mathematical formula result; and dynamically converting the initial mathematical formula result according to the user's format requirements to obtain a final mathematical formula result. The present invention improves the user's overall experience by improving the stability and accuracy of the large language model when generating mathematical formulas, and can dynamically adjust the format of the mathematical formula according to user needs to improve flexibility and practicality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to an optimization method and system for generating a mathematical formula format based on a large language model. Background Art

[0002] With the widespread application of large language models (such as GPT-4, LLM, etc.), they have gradually made progress in generating mathematical formula parsing. However, existing technologies still face some challenges and problems, including: instability of large language model output results and output format, frequent formula errors, and inaccurate parsing that does not meet user expectations. For example, a high-frequency user inputs in a large language model: Please generate a mathematical formula with $$ package and suitable for Markdown; the large language model responds with the output: This is a mathematical formula in LaTeX format: E=mc 2 ; A novice user inputs into the big language model: Please generate a mathematical formula; the big language model responds with the output: [a^2 + b^2 = c^2]. From the above examples, we can see that the existing big language model has limitations in recognizing the type and format of mathematical formulas required by users. For short user questions, the big language model is often unable to accurately judge the user's needs, which can easily lead to misunderstanding of user intent, errors in formula rendering, and the need for users to manually correct the formula format.

[0003] In view of this, the present invention provides an optimization method and system for generating a mathematical formula format based on a large language model. Summary of the invention

[0004] Based on this, it is necessary to provide an optimization method and system for generating mathematical formula formats based on a large language model to address the above technical problems.

[0005] According to a first aspect of the present invention, an optimization method for generating a mathematical formula format based on a large language model is provided, comprising: constructing a proficiency scoring system, an intent library, a keyword library and a multi-level template library; wherein, the proficiency scoring system is constructed with language complexity, format familiarity and interaction mode frequency as scoring factors, and a preset scoring weight is assigned to each scoring factor; the intent library is a collection of multiple intent information, each of which is used to refer to a certain mathematical formula type or a certain mathematical formula format required by the user, and each of the intent information corresponds to an intent vector; the keyword library includes multiple keyword theme sets Each intent information in the intent library is associated with a keyword theme set, and the keyword theme set includes multiple keywords, which are used to describe and identify words or phrases of the associated intent information; the multi-level template library includes multiple level template library sets, and a mapping relationship is formed between the level template library sets and the preset proficiency levels. The level template library set is a set containing multiple templates, and each template corresponds to an intent information; the user's question input text is obtained, and based on the proficiency scoring system, the user's current proficiency comprehensive score of the large language model is calculated, and the user's current proficiency comprehensive score is compared with the preset proficiency level. The method comprises the following steps: according to the mapping relationship between the levels, determining the user's current proficiency level in using the large language model; based on the user's current proficiency level in using the large language model, determining the associated level template library and the multiple intent information of the corresponding level template library according to the mapping relationship between the preset proficiency level and the level template library set, and determining the corresponding multiple intent vectors based on the obtained multiple intent information; using the cosine similarity formula to calculate the cosine similarity between the question input text and each determined intent vector, obtaining the cosine similarity of each intent vector, using the obtained cosine similarity as the matching score of the corresponding intent information, and obtaining multiple intent information matching the question input text; according to the obtained multiple intent information matching the question input text, determining the keyword theme set associated with each intent information, and obtaining the matching result of the target keyword contained in the question input text; based on the matching scores of the multiple intent information matching the question input text and the matching result of the target keyword, obtaining a template matching the question input text, and outputting the obtained template matching the question input text to the large language model to generate an initial mathematical formula result; constructing a format conversion function, and performing dynamic format conversion processing on the initial mathematical formula result according to the user's format requirements to obtain a final mathematical formula result.

[0006] Optionally, constructing the intent library includes: pre-defining multiple intent information, inputting each intent information into the Word2vec model, generating an intent vector corresponding to each intent information, constructing the intent library based on the intent information and the corresponding intent vector, and assigning the same preset intent weight to each intent information.

[0007] Optionally, constructing the keyword library includes: based on each intent information, defining associated keywords and constructing a corresponding keyword theme set; based on the keyword theme set, constructing the keyword library, and assigning the same preset keyword weight to each keyword, the preset intent weight is greater than the preset keyword weight, and the sum of the preset intent weight and the preset keyword weight is 1.

[0008] Optionally, constructing the multi-level template library includes: based on preset proficiency levels, defining an associated level template library set, the level template library including multiple templates, the level template library set including multiple templates, each of the templates is constructed through a type of intent information and its associated keyword theme set, and is used to generate a mathematical formula type or mathematical formula format corresponding to the intent information based on the keywords in the included intent information and its associated keyword theme set; based on the level template library, constructing a multi-level template library.

[0009] Optionally, the step of obtaining the user's question input text and calculating the user's current comprehensive proficiency score for the large language model based on the proficiency scoring system includes: obtaining the user's question input text and calculating the scores of language complexity, format familiarity and interaction mode frequency respectively based on the proficiency scoring system, and calculating the user's current comprehensive proficiency score for the large language model according to the preset scoring weight of each scoring factor; the calculation process of the language complexity score includes: obtaining high-frequency mathematical professional terms, classifying and storing the high-frequency mathematical professional terms according to the preset term complexity level, constructing a high-frequency professional term vocabulary, and performing a classification on each term complexity. The high-frequency mathematical professional terms are determined by capturing the frequency of occurrence of mathematical professional terms through a front-end lightweight database, and mathematical professional terms with a frequency of occurrence greater than a first preset interval are regarded as high-frequency mathematical professional terms; a word segmentation tool is used to perform word segmentation on the question input text to obtain multiple word segmentation results, and the total number of word segmentation results is recorded; each word segmentation result is traversed in the high-frequency professional terminology vocabulary to obtain the term occurrence frequency of each word segmentation result and the term complexity level to which the corresponding word segmentation result belongs; the preset term weight of the term occurrence frequency of each word segmentation result and the term complexity level to which the corresponding word segmentation result belongs is calculated The product of the complexity scores of the word segmentation results is obtained, and the complexity scores of all the word segmentation results are summed to obtain the total score of the language complexity; the total score of the language complexity is divided by the total number of word segmentation results to obtain the relative score of the language complexity, and the relative score of the language complexity is used as the score of the language complexity; the calculation process of the score of the format familiarity includes: obtaining high-frequency mathematical formula formats and constructing a high-frequency mathematical formula format list; wherein the high-frequency mathematical formula format is determined by capturing the frequency of occurrence of the mathematical formula format through the front-end lightweight database, and the mathematical formula format with an occurrence frequency greater than the second preset interval is used as the high-frequency mathematical formula format. format; using a preset regular expression to retrieve the target mathematical formula output format contained in the question input text to obtain a target search result, and using a clarity evaluation strategy to analyze the target search result to obtain a target analysis result, and determining the clarity level corresponding to the target analysis result according to the mapping relationship between the analysis result and the preset clarity level; determining the format familiarity score of the corresponding question input text according to the mapping relationship between the clarity level and the preset format familiarity score; the calculation process of the score of the interaction mode frequency includes: according to a preset first time window, recording the number of interactions between the user and the large language model in the first time window;According to the preset second time window, wherein the second time window includes at least one first time window, the number of interactions in each first time window is normalized to obtain a normalized value of the number of interactions in each first time window, the average value of all normalized values ​​of the number of interactions in the second time window is calculated, and the average value of all normalized values ​​of the number of interactions in the second time window is used as the score of the frequency of the interaction mode. ;

[0010] Optionally, based on the user's current proficiency level in using the large language model, according to the mapping relationship between the preset proficiency level and the level template library set, determining the associated level template library and multiple intent information corresponding to the level template library, and based on the obtained multiple intent information, determining the corresponding multiple intent vectors, including: based on the user's current proficiency level in using the large language model, according to the mapping relationship between the preset proficiency level and the level template library set, determining the associated level template library; based on the determined level template library, obtaining multiple intent information corresponding to all templates contained in the level template library, and based on the obtained multiple intent information, determining the corresponding multiple intent vectors.

[0011] Optionally, the cosine similarity formula is used to calculate the cosine similarity between the question input text and each determined intent vector, obtain the cosine similarity of each intent vector, use the obtained cosine similarity as the matching score of the corresponding intent information, and obtain multiple intent information matching the question input text, including: inputting the question input text into the Word2vec model, outputting multiple word vectors; performing vector aggregation processing on all word vectors to obtain a user input vector; calculating the cosine similarity between the user input vector and each determined intent vector, and using the obtained cosine similarity as the matching score of the corresponding intent information, and the cosine similarity formula is: ; In the formula, represents the cosine similarity between the user input vector and the nth intention vector, represents the user input vector, (n) represents the nth intention vector, represents the norm of the user input vector, represents the norm of the nth intention vector, represents the dot product; the obtained cosine similarities are sorted from high to low, and if the multiple cosine similarities in the first order are greater than the third preset interval, the intent information corresponding to the multiple cosine similarities in the first order is used as the multiple intent information matching the question input text.

[0012] Optionally, the method determines a keyword topic set associated with each intent information based on the obtained multiple intent information that matches the question input text, and obtains a matching result of a target keyword contained in the question input text, including: determining a keyword topic set associated with each intent information based on the obtained multiple intent information that matches the question input text; using natural language processing technology to identify the target keywords included in the question input text, and traversing the target keywords in each keyword topic set, if the target keyword matches the corresponding keyword in the keyword topic set, outputting a matching result of the target keyword with a matching score of 1, and if the target keyword does not match the corresponding keyword in the keyword topic set, outputting a matching result of the target keyword with a matching score of 0.

[0013] Optionally, the step of obtaining a template matching the question input text based on the matching scores of the multiple intent information matching the question input text and the matching results of the target keywords, and outputting the obtained template matching the question input text to the large language model to generate an initial mathematical formula result includes: using a final matching score formula to calculate a final matching score of each intent information matching the question input text, wherein the final matching score formula is: m =(X m ×Weight 1 )+(Y×weight 2 ); where M m represents the final matching score M of the mth intent information that matches the question input text, X m Indicates the matching score and weight of the mth intent information 1 represents the preset intention weight, Y represents the matching result of the target keyword corresponding to the mth intention information, and the weight 2 Represents the preset keyword weight; sorts the final matching scores of each intent information from high to low, and selects the template corresponding to the intent information with the highest final matching score as the template that matches the question input text, and outputs the obtained template that matches the question input text to the large language model to generate an initial mathematical formula result.

[0014] According to a second aspect of the present invention, an optimization system for generating a mathematical formula format based on a large language model is provided, comprising: a construction module for constructing a large language model proficiency scoring system, an intent library, a keyword library and a multi-level template library; wherein the proficiency scoring system is constructed with language complexity, format familiarity and interaction mode frequency as scoring factors, and a preset scoring weight is assigned to each scoring factor; the intent library is a collection of multiple intent information, each of which is used to refer to a certain mathematical formula type or a certain mathematical formula format required by a user, and each of the intent information corresponds to an intent vector; the keyword library includes multiple keyword theme sets, and each intent information in the intent library is used to construct a proficiency scoring system, and a pre-set ... intent information. Each piece of information is associated with a keyword theme set, and the keyword theme set includes multiple keywords, which are used to describe and identify words or phrases of associated intent information; the multi-level template library includes multiple level template library sets, and a mapping relationship is formed between the level template library sets and the preset proficiency levels. The level template library set is a set containing multiple templates, and each template corresponds to a type of intent information; a question acquisition module is used to obtain the user's question input text; a proficiency comprehensive score calculation module is used to calculate the user's current proficiency comprehensive score of the large language model based on the proficiency scoring system; a proficiency level determination module is used to determine the proficiency level of the user according to the relationship between the proficiency comprehensive score and the preset proficiency level. The mapping relationship between the user's current proficiency level in using the large language model is determined; an intention vector determination module is used to determine the associated level template library and the multiple intention information of the corresponding level template library based on the user's current proficiency level in using the large language model, according to the mapping relationship between the preset proficiency level and the level template library set, and determine the corresponding multiple intention vectors based on the obtained multiple intention information; an intention matching module is used to use the cosine similarity formula to calculate the cosine similarity between the question input text and each determined intention vector, obtain the cosine similarity of each intention vector, use the obtained cosine similarity as the matching score of the corresponding intention information, and obtain multiple intention information matching the question input text; A keyword matching module is used to determine the keyword topic set associated with each intent information based on the obtained multiple intent information matching the question input text, and obtain the matching results of the target keywords contained in the question input text; a mathematical formula result output module is used to obtain a template matching the question input text based on the matching scores of the multiple intent information matching the question input text and the matching results of the target keywords, and output the obtained template matching the question input text to the large language model to generate an initial mathematical formula result; a format dynamic conversion module is used to construct a format conversion function, and dynamically convert the initial mathematical formula result according to the user's format requirements to obtain a final mathematical formula result.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention can more accurately identify the real needs of users by evaluating the current proficiency of users in using large language models in multiple dimensions, and improve the accuracy of user intent recognition, so as to ensure that the mathematical formulas generated by the large language model are more in line with the user's expectations and reduce the probability of misunderstanding and error generation; by constructing an intent library, a keyword library and a multi-level template library, the large language model can dynamically select the optimal template according to user needs, and quantify the matching degree of intent and keywords through weight distribution, so that the mathematical formula finally generated is more in line with user needs; by improving the accuracy and stability of mathematical formula generation, the workload of manual correction by users can be effectively reduced, which not only improves the work efficiency of users, but also reduces the troubles caused by format errors; by constructing a format conversion function, the format of the mathematical formula can also be dynamically adjusted according to user needs to improve flexibility and practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a system principle block diagram of the present invention.

[0017] Figure 2 It is the overall flow chart of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific implementation methods in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0019] Embodiment 1

[0020] Reference Figure 1 , an optimization method for generating a mathematical formula format based on a large language model, the method comprising the following steps.

[0021] S1. Build a proficiency scoring system, intent library, keyword library and multi-level template library.

[0022] In some embodiments, constructing a proficiency scoring system includes: constructing a proficiency scoring system using language complexity, format familiarity, and interaction mode frequency as scoring factors, and assigning a preset scoring weight to each scoring factor.

[0023] In some embodiments, the language complexity score is used to evaluate the complexity of mathematical terms and expressions used by the user; the format familiarity score is used to determine the user's familiarity with the format of mathematical formulas; and the interaction mode frequency is used to record the way and frequency of the user's interaction with the large language model.

[0024] In some embodiments, a corresponding preset scoring weight is set according to the importance of each scoring factor, for example, the preset scoring weight assigned to language complexity is 0.4, the preset scoring weight assigned to format familiarity is 0.4, and the preset scoring weight assigned to interaction mode frequency is 0.2.

[0025] In some embodiments, constructing an intent library includes: pre-defining multiple intent information, inputting each intent information into a Word2vec model, generating an intent vector corresponding to each intent information, constructing an intent library based on the intent information and the corresponding intent vector, and assigning the same preset intent weight to each intent information.

[0026] In some embodiments, the intent library is a collection of multiple intent information, each of which is used to refer to a certain mathematical formula type or a certain mathematical formula format required by the user, and each of which corresponds to an intent vector.

[0027] In some embodiments, before setting the intent information, some intent categories need to be defined first, for example, (1) requesting to generate a mathematical formula in a specific format (such as LaTeX, Markdown, etc.), (2) requesting to explain or describe a mathematical formula, (3) requesting to solve a mathematical problem, (4) requesting feedback or suggestions, etc., and then further refining each intent category to obtain multiple specific intent information, each of which has a specific identifier and description, for example, (1) the intent to output a formula for a question (such as outputting a format such as Markdown, Latex, etc. after asking the question), (2) the intent to ask or Describe the intention of a mathematical formula (such as asking a question or explaining a linear algebra formula, explaining how to write a calculus formula, etc.), (3) other intentions other than asking questions or formulas (such as submitting feedback on the output format, leaving the question, etc.); then, summarize all the defined intent information to form an intent library; finally, assign a preset intent weight to each intent information. For example, the weight of each intent information is set to 0.7, which is used to indicate that when recognizing the user's question input text, the matching result of the intent information has a major influence. The higher the weight of the intent information, the more the large language model tends to choose the intent information when judging the user's intent.

[0028] In some embodiments, constructing a keyword library includes: based on each intent information, defining associated keywords and constructing a corresponding keyword theme set; based on the keyword theme set, constructing a keyword library, and assigning the same preset keyword weight to each keyword, wherein the preset intent weight is greater than the preset keyword weight, and the sum of the preset intent weight and the preset keyword weight is 1.

[0029] In some embodiments, the keyword library includes multiple keyword topic sets, each intent information in the intent library is associated with a keyword topic set, and the keyword topic set includes multiple keywords, which are used to describe and identify words or phrases associated with the intent information, so as to help the large language model recognize and understand the user's intent.

[0030] In some embodiments, when defining keywords, they need to be set according to each type of intent information to ensure that the set keywords can accurately reflect the core content of the corresponding intent information, thereby facilitating the large language model to better and more accurately understand user needs, so as to more accurately output the corresponding content.

[0031] In some embodiments, all defined keyword theme sets are aggregated to form a keyword library, and each keyword theme set represents a specific theme. For example, for the intention information of generating formulas in LaTeX format, the keyword theme set is K={LaTeX, format, formula}.

[0032] In some embodiments, a preset keyword weight is assigned to each keyword. For example, the weight of each keyword is set to 0.3, which is used to reflect the role of the keyword in assisting intent recognition, that is, it provides support when identifying intent, but is not a decisive factor.

[0033] In some embodiments, a multi-level template library is constructed, including: based on preset proficiency levels, defining an associated level template library set, the level template library including multiple templates, the level template library set including multiple templates, each of the templates is constructed through a type of intent information and its associated keyword theme set, and is used to generate a mathematical formula type or mathematical formula format corresponding to the intent information based on the keywords in the included intent information and its associated keyword theme set; based on the level template library, a multi-level template library is constructed.

[0034] In some embodiments, the multi-level template library includes multiple level template library sets, and a mapping relationship is formed between the level template library sets and the preset proficiency levels. The level template library set is a set containing multiple templates, and each template corresponds to a type of intent information.

[0035] In some embodiments, the multi-level template library is a set of predefined level template library sets for generating mathematical formulas in a specific format. Each template corresponds to a kind of intent information. When constructing a template, it is necessary to determine a certain intent. and its associated keyword topic set, wherein the associated keyword topic set refers to the intention A collection of related specific words or phrases, the template is used to generate a mathematical formula type or mathematical formula format corresponding to the intent information based on the included intent information and the keywords in the associated keyword topic set.

[0036] In some embodiments, a mapping relationship is formed between a level template library set and a preset proficiency level, wherein the preset proficiency levels include primary users, intermediate users, and advanced users, and for each user group, a corresponding level template library set is constructed, that is, the constructed level template library set includes a primary template library set, an intermediate template library set, and an advanced template library set.

[0037] In some embodiments, for templates in the primary template library set, for example, for the intention information of generating a formula in LaTeX format, the corresponding template is: \text{the formula is: ${text}$}; for the intention information of explaining basic concepts, the corresponding template is: \text{explanation: ${text}$}; for templates in the intermediate template library set, for example, for the intention information of generating a formula with explanations, the corresponding template is: \text{the formula is: ${text}$, where ${explanation}$}; for the intention information of explaining a theorem or formula, the corresponding template is For templates in the advanced template library collection, for example, for the intention information of generating multi-part formulas, the corresponding template is: \text{theorem: ${theorem}$, explanation: ${text}$}; for the intention information of in-depth explanation and application, the corresponding template is: \text{formula: ${text}$, detailed explanation: ${detailedExplanation}$, application example: ${example}$}.

[0038] S2. Obtain the user's question input text, calculate the user's current comprehensive proficiency score for using the large language model based on the proficiency scoring system, and determine the user's current proficiency level for using the large language model based on the mapping relationship between the comprehensive proficiency score and the preset proficiency level.

[0039] In some embodiments, the user's question input text is obtained, and based on the proficiency scoring system, a comprehensive proficiency score of the user's current use of the large language model is calculated, including: obtaining the user's question input text, and based on the proficiency scoring system, respectively calculating the scores of language complexity, format familiarity, and interaction mode frequency, and calculating the comprehensive proficiency score of the user's current use of the large language model according to the preset scoring weight of each scoring factor.

[0040] In some embodiments, the calculation process of the language complexity score includes: obtaining high-frequency mathematical professional terms, classifying and storing the high-frequency mathematical professional terms according to preset term complexity levels, building a high-frequency professional term vocabulary, and assigning preset term weights to each term complexity level; wherein the high-frequency mathematical professional terms are determined by capturing the frequency of occurrence of mathematical professional terms through a front-end lightweight database, and mathematical professional terms with an occurrence frequency greater than a first preset interval are regarded as high-frequency mathematical professional terms; using a word segmentation tool to perform word segmentation processing on the question input text to obtain multiple word segmentation results, and recording the total number of word segmentation results. number; traverse each word segmentation result in the high-frequency professional terminology vocabulary to obtain the term occurrence frequency of each word segmentation result and the term complexity level to which the corresponding word segmentation result belongs; calculate the product of the term occurrence frequency of each word segmentation result and the preset term weight of the term complexity level to which the corresponding word segmentation result belongs to obtain the complexity score of each word segmentation result, and sum up the complexity scores of all word segmentation results to obtain the total score of language complexity; divide the total score of language complexity by the total number of word segmentation results to obtain the relative score of language complexity, and use the relative score of language complexity as the score of language complexity.

[0041] In some embodiments, high-frequency mathematical professional terms with a high frequency of occurrence are captured and classified and stored according to the term complexity level (i.e., three levels: elementary terms, intermediate terms, and advanced terms), wherein the term complexity level is used to reflect the depth and difficulty of the mathematical professional terms in mathematical theory. For example, the complexity of "linear function" is simple difficulty, which belongs to elementary terms; the complexity of "Fourier transform" is complex difficulty, which belongs to advanced terms; the complexity of "derivative" is medium difficulty, which belongs to intermediate terms; and preset term weights are assigned to different term complexity levels. For example, the weight of elementary terms is 1, the weight of intermediate terms is 2, and the weight of advanced terms is 3.

[0042] In some embodiments, a word segmentation tool (such as Jieba library) is used to segment the user's question input text, and the length of the question input text is recorded. For example, the user's question input text is: "I want to know about Fourier transform and linear function", and the word segmentation results may include: ["I", "want", "know", "Fourier transform", "and", "linear function"], and the total number of word segmentation results is recorded as 6, and each word segmentation result is traversed in the high-frequency professional terminology vocabulary, for example, traversing ["I", "want", "know", "Fourier transform", "and", "linear function"], and the statistical results may include: {"Fourier transform" : 1 times, "linear function": 1 times}; then, calculate the product of the term occurrence frequency of each word segmentation result and the preset term weight of the term complexity level to which the corresponding word segmentation result belongs, and obtain the complexity score of each word segmentation result, and sum the complexity scores of all word segmentation results to obtain the total score of language complexity, for example, the total score = 1×3 (i.e. Fourier transform) + 1×1 (i.e. linear function) = 4; finally, divide the total score of language complexity by the total number of word segmentation results to obtain the relative score of language complexity, and use the relative score of language complexity as the score of language complexity, for example, the score of language complexity is: 4 / 6≈0.67.

[0043] In some embodiments, the calculation process of the format familiarity score includes: obtaining high-frequency mathematical formula formats and constructing a high-frequency mathematical formula format list; wherein the high-frequency mathematical formula format is determined by capturing the frequency of occurrence of the mathematical formula format through a front-end lightweight database, and the mathematical formula format with an occurrence frequency greater than a second preset interval is used as the high-frequency mathematical formula format; using a preset regular expression to retrieve the target mathematical formula output format contained in the question input text to obtain a target search result, and using a clarity evaluation strategy to analyze the target search result to obtain a target analysis result, and determining the clarity level corresponding to the target analysis result based on the mapping relationship between the analysis result and the preset clarity level; determining the format familiarity score corresponding to the question input text based on the mapping relationship between the clarity level and the preset format familiarity score.

[0044] In some embodiments, a list of high-frequency math formula formats is created, for example, format_keywords["LaTeX", "Markdown", "MathML"]; regular expressions are used to search for specific sentence formats, for example, pattern=r"Please use | Please output".

[0045] In some embodiments, the clarity evaluation strategy is used to evaluate the specific degree of the specified format based on the search results, which is divided into two levels: high clarity and low clarity. For example, in the case of high clarity, the user's question input text is: "Please output the formula of the linear function in LaTeX format", and the search result obtained after regular expression search is: ["LaTeX"], then the search result clearly specifies the format and belongs to the high clarity level. Therefore, it is scored 1, and the format familiarity score of the corresponding question input text is determined to be 1; for the case of low clarity, the user's question input text is: "Please output the formula of the linear function", and the search result obtained after regular expression search is: [], then the search result does not specify the format and belongs to the low clarity level. Therefore, it is scored 0, and the format familiarity score of the corresponding question input text is determined to be 0.

[0046] In some embodiments, the process of calculating the score of the interaction mode frequency includes: according to a preset first time window, recording the number of interactions between the user and the large language model in the first time window; according to a preset second time window, wherein the second time window includes at least one first time window, normalizing the number of interactions in each first time window to obtain a normalized value of the number of interactions in each first time window, calculating an average of all normalized values ​​of the number of interactions in the second time window, and using the average of all normalized values ​​of the number of interactions in the second time window as the score of the interaction mode frequency.

[0047] In some embodiments, for example, the user's interaction records in the past week are as follows (in days): 5 times on Monday, 3 times on Tuesday, 8 times on Wednesday, 4 times on Thursday, 6 times on Friday, 2 times on Saturday, and 1 time on Sunday; first, the number of interactions per day is normalized, and normalization is to scale the logarithmic value of each interaction number to a specific range (usually 0-1), and the normalization formula is: normalized value = number of interactions per day / max (number of interactions), therefore, the normalized value of the number of interactions on Monday is: 5 / 8=0.625, the normalized value of the number of interactions on Tuesday is: 3 / 8=0.375, the normalized value of the number of interactions on Wednesday is: 8 / 8=1, the normalized value of the number of interactions on Thursday is: 4 / 8=0.5, the normalized value of the number of interactions on Friday is: 6 / 8=0.75, and the normalized value of the number of interactions on Saturday is: 2 / 8=0.25, the normalized value of the number of interactions on Sunday is: 1 / 8=0.125, and the average of all normalized values ​​for a week is calculated, that is, (0.625+0.375+1+0.5+0.75+0.25+0.125) / 7≈0.518. Finally, the comprehensive proficiency score of the user currently using the large language model is: language complexity×0.4+format familiarity×0.4+interaction mode frequency×0.2, for example: 0.67×0.4+1×0.4+0.518×0.2=0.7716; based on the comprehensive proficiency score, the preset proficiency level is set, that is, the comprehensive proficiency score of the beginner user is [0, 0.4), the comprehensive proficiency score of the intermediate user is [0.4, 0.8), and the comprehensive proficiency score of the advanced user is [0.8, 1]. The proficiency level of the user is an intermediate user.

[0048] S3. Based on the user's current proficiency level of the large language model, determine the associated level template library and the multiple intent information of the corresponding level template library according to the mapping relationship between the preset proficiency level and the level template library set, and determine the corresponding multiple intent vectors based on the obtained multiple intent information.

[0049] In some embodiments, based on the user's current proficiency level in using the large language model, according to the mapping relationship between the preset proficiency level and the level template library set, the associated level template library and multiple intent information corresponding to the level template library are determined, and based on the obtained multiple intent information, the corresponding multiple intent vectors are determined, including: based on the user's current proficiency level in using the large language model, according to the mapping relationship between the preset proficiency level and the level template library set, the associated level template library is determined; based on the determined level template library, multiple intent information corresponding to all templates contained in the level template library is obtained, and based on the obtained multiple intent information, the corresponding multiple intent vectors are determined.

[0050] In some embodiments, in order to determine which intent vectors to use for subsequent cosine similarity calculations, the user's proficiency level, that is, an intermediate user, can be determined as the intermediate template library set associated with the user. By utilizing the association between the templates in the intermediate template library set and the corresponding intent information, the various intent information of the corresponding level template library can be determined, and based on the various intent information of the corresponding level template library, the corresponding multiple intent vectors can be determined.

[0051] S4. Use the cosine similarity formula to calculate the cosine similarity between the question input text and each determined intent vector, obtain the cosine similarity of each intent vector, use the obtained cosine similarity as the matching score of the corresponding intent information, and obtain multiple intent information matching the question input text.

[0052] In some embodiments, a cosine similarity formula is used to calculate the cosine similarity between the question input text and each determined intent vector, obtain the cosine similarity of each intent vector, use the obtained cosine similarity as the matching score of the corresponding intent information, and obtain multiple intent information matching the question input text, including: inputting the question input text into a Word2vec model and outputting multiple word vectors; performing vector aggregation processing on all word vectors to obtain a user input vector; calculating the cosine similarity between the user input vector and each determined intent vector, and using the obtained cosine similarity as the matching score of the corresponding intent information, wherein the cosine similarity formula is: ; In the formula, represents the cosine similarity between the user input vector and the nth intention vector, represents the user input vector, (n) represents the nth intention vector, represents the norm of the user input vector, represents the norm of the nth intention vector, represents the dot product; the obtained cosine similarities are sorted from high to low, and if the multiple cosine similarities in the first order are greater than the third preset interval, the intent information corresponding to the multiple cosine similarities in the first order is used as the multiple intent information matching the question input text.

[0053] In some embodiments, the question input text is input into the Word2Vec model to obtain a vector representation of each word. For example, the user's question input text is: I want to know how to output Latex mathematical formulas. The word vectors output after the Word2Vec model may include: the vector representation of "want" is [0.1, 0.2, 0.3], the vector representation of "know" is [0.2, 0.3, 0.4], the vector representation of "how" is [0.1, 0.3, 0.3], the vector representation of "output" is [0.3, 0.4, 0.5], the vector representation of "Latex" is [0.4, 0.5, 0.6], the vector representation of "mathematics" is [0.5, 0.6, 0.7], and the vector representation of "formula" is [0.6, 0.7, 0.8]. All word vectors are vector aggregated, that is, the average pooling formula is used for vector aggregation processing. The average pooling formula is: =([0.1, 0.2, 0.3]+[0.2, 0.3, 0.4]+[0.1, 0.3, 0.3]+[0.3, 0.4, 0.5]+[0.4, 0.5, 0.6]+[0.5, 0.6, 0.7]+[0.6, 0.7, 0.8]) / 7=[0.31, 0.43, 0.51]; Subsequently, the cosine similarity between the user input vector and each determined intention vector is calculated, and the obtained cosine similarity is used as the matching score of the corresponding intention information, where, for example, the determined intention information includes three types, namely, the first intention information related to generating a formula in LaTeX format, the second intention information related to the interpretation of mathematical formulas, and the third intention information related to how to use the LaTeX tool. Intent information, the vector of the first intent information is expressed as V1=[0.9, 0.1, 0.0], the vector of the second intent information is expressed as V2=[0.2, 0.8, 0.0], and the vector of the third intent information is expressed as V1=[0.1, 0.1, 0.8]. According to the cosine similarity formula, the cosine similarity of the user input vector and the three intent vectors is calculated. The dot product in the formula refers to the sum of the products of the corresponding elements of the two vectors, which is used to reflect the degree of "overlap" of the two vectors in the same direction. The larger the value, the more similar the two vectors are in direction. If the dot product is zero, it means that the two vectors are orthogonal, that is, there is no similarity. The norm in the formula refers to the length of a vector, which indicates the "size" of the vector in space. In this example, represents the length of the user input vector, and represents the length of the nth intention vector; finally, the calculated cosine similarities are sorted from high to low, and the intention vectors with multiple cosine similarities ranked in front and whose cosine similarities are greater than the third preset interval are selected, and the intention information corresponding to the selected multiple intention vectors is used as the multiple intention information matching the question input text.

[0054] S5. According to the obtained multiple intention information matching the question input text, determine the keyword theme set associated with each intention information, and obtain the matching result of the target keyword contained in the question input text.

[0055] In some embodiments, based on the obtained multiple intent information that matches the question input text, a keyword topic set associated with each intent information is determined, and a matching result of a target keyword contained in the question input text is obtained, including: based on the obtained multiple intent information that matches the question input text, a keyword topic set associated with each intent information is determined; using natural language processing technology to identify the target keywords included in the question input text, and traversing the target keywords in each keyword topic set, if the target keyword matches the corresponding keyword in the keyword topic set, then the matching result of the target keyword with a matching score of 1 is output; if the target keyword does not match the corresponding keyword in the keyword topic set, then the matching result of the target keyword with a matching score of 0 is output.

[0056] In some embodiments, for the selected multiple intent information, the keyword topic set associated with each intent information is determined, and in each associated keyword topic set, the target keywords of the question input text are traversed. It should be noted that the number of target keywords is at least one, and each target keyword is traversed in each associated keyword topic set. As long as at least one keyword in the keyword topic set is matched, the matching result of the target keyword with a matching score of 1 is output; if no keyword in the keyword topic set is matched, the matching result of the target keyword with a matching score of 0 is output. For example, a selected intent information is to generate a formula in LaTeX format, and its associated keyword topic set is: K={LaTeX, format, formula}, and the user's question input text is: "I want to know how to output Latex mathematical formulas", then 2 keywords in the keyword topic set can be matched, specifically "LaTeX" and "formula", and the matching result of the target keyword with a matching score of 1 is output.

[0057] S6. Based on the matching scores of various intent information matching the question input text and the matching results of the target keywords, a template matching the question input text is obtained, and the obtained template matching the question input text is output to the large language model to generate an initial mathematical formula result.

[0058] In some embodiments, based on the matching scores of multiple intent information matching the question input text and the matching results of the target keywords, a template matching the question input text is obtained, and the obtained template matching the question input text is output to the large language model to generate an initial mathematical formula result, including: using a final matching score formula to calculate a final matching score of each intent information matching the question input text, the final matching score formula is: m =(X m ×Weight 1 )+(Y×weight 2 ); where M m represents the final matching score M of the mth intent information that matches the question input text, X m Represents the matching score and weight of the mth intent information 1 represents the preset intention weight, Y represents the matching result of the target keyword corresponding to the mth intention information, and the weight 2 Represents the preset keyword weight; sorts the final matching scores of each intent information from high to low, and selects the template corresponding to the intent information with the highest final matching score as the template that matches the question input text, and outputs the obtained template that matches the question input text to the large language model to generate an initial mathematical formula result.

[0059] In some embodiments, for example, three types of intent information are selected, and the matching score of each type of intent information (the cosine similarity between the user input vector calculated in step S4 and the corresponding intent vector determined) is, for example, 0.5 for the first intent information, 0.66 for the second intent information, and 0.81 for the third intent information. In addition, the matching results of the target keywords corresponding to the three types of intent information (the matching results obtained in step S5) are, for example, 1 for the target keyword corresponding to the first type of intent information, 1 for the target keyword corresponding to the second type of intent information, and 0 for the target keyword corresponding to the third type of intent information. The final matching score is used. The final matching score of the first intent information is calculated by the formula = (0.5×0.7)+(1×0.3)=0.65, where 0.7 represents the preset intent weight and 0.3 represents the preset keyword weight. The final matching score of the second intent information is = (0.66×0.7)+(1×0.3)=0.762, and the final matching score of the third intent information is = (0.81×0.7)+(0×0.3)=0.567. The final matching score of the second intent information is the highest, that is, the template corresponding to the second intent information is selected as the template that matches the question input text, and the obtained template that matches the question input text is output to the large language model to generate the initial mathematical formula result.

[0060] S7. Construct a format conversion function to dynamically convert the initial mathematical formula result according to the user's format requirements to obtain the final mathematical formula result.

[0061] In some embodiments, in order to dynamically adjust the format of mathematical formulas according to user needs, a format conversion function is also provided, wherein the format conversion function includes a format conversion function from Markdown to HTML, a format conversion function from LaTeX to HTML, and a format conversion function from HTML to Markdown.

[0062] In some embodiments, the format conversion function from Markdown to HTML uses the markdown-it library to convert Markdown formatted text into HTML; for example, the input Markdown text is #HelloWorld, and the converted HTML is <h1> HelloWorld< / h1> .

[0063] In some embodiments, the format conversion function from LaTeX to HTML uses the MathJax library to convert the LaTeX mathematical formula to HTML; for example, the input LaTeX formula is E=mc^2, and the converted HTML is<spanclass="mathjax"> E=mc^2.

[0064] In some embodiments, the format conversion function from HTML to Markdown uses the turndown library to convert HTML formatted text into Markdown; for example, the input HTML text is <h1> HelloWorld< / h1> , the converted Markdown is #HelloWorld.

[0065] In some embodiments, after the format conversion is completed, a rendering area that can render three formats is implemented in the system interface based on the react-markdown library to directly render the format selected by the user. Through the above steps, the system can dynamically convert the format of the initial mathematical formula result according to the user's choice, and display the final mathematical formula result on the interface.

[0066] Embodiment 2

[0067] This embodiment provides an optimization system 200 based on a large language model to generate a mathematical formula format, based on the above embodiment 1. Figure 2, implementing the optimization method for generating mathematical formula format based on a large language model of embodiment 1, the system includes: a construction module 210, a question acquisition module 220, a proficiency comprehensive score calculation module 230, a proficiency level determination module 240, an intention vector determination module 250, an intention matching module 260, a keyword matching module 270, a mathematical formula result output module 280, and a format dynamic conversion module 290.

[0068] In some embodiments, the construction module 210 is used to construct a large language model proficiency scoring system, an intent library, a keyword library and a multi-level template library; wherein, the proficiency scoring system is constructed with language complexity, format familiarity and interaction mode frequency as scoring factors, and a preset scoring weight is assigned to each scoring factor; the intent library is a collection containing multiple intent information, each of which is used to refer to a certain mathematical formula type or a certain mathematical formula format required by the user, and each of the intent information corresponds to an intent vector; the keyword library includes multiple keyword theme sets, each of the intent information in the intent library is associated with a keyword theme set, and the keyword theme set includes multiple keywords, which are used to describe and identify the vocabulary or phrases of the associated intent information; the multi-level template library includes multiple level template library sets, and a mapping relationship is formed between the level template library sets and the preset proficiency levels. The level template library set is a collection containing multiple templates, and each of the templates corresponds to a type of intent information.

[0069] In some embodiments, the question acquisition module 220 is used to acquire the user's question input text.

[0070] In some embodiments, the proficiency comprehensive score calculation module 230 is used to calculate the proficiency comprehensive score of the user's current use of the large language model based on the proficiency scoring system.

[0071] In some embodiments, the proficiency level determination module 240 is used to determine the user's current proficiency level of using the large language model based on a mapping relationship between the comprehensive proficiency score and a preset proficiency level.

[0072] In some embodiments, the intention vector determination module 250 is used to determine the associated level template library and multiple intention information of the corresponding level template library based on the user's current proficiency level of using the large language model and the mapping relationship between the preset proficiency level and the level template library set, and determine the corresponding multiple intention vectors based on the obtained multiple intention information.

[0073] In some embodiments, the intent matching module 260 is used to use the cosine similarity formula to calculate the cosine similarity between the question input text and each determined intent vector, obtain the cosine similarity of each intent vector, use the obtained cosine similarity as the matching score of the corresponding intent information, and obtain multiple intent information that matches the question input text.

[0074] In some embodiments, the keyword matching module 270 is used to determine a keyword topic set associated with each intention information based on the obtained multiple intention information matched with the question input text, and obtain matching results of target keywords contained in the question input text.

[0075] In some embodiments, the mathematical formula result output module 280 is used to obtain a template that matches the question input text based on the matching scores of multiple intent information matching the question input text and the matching results of the target keywords, and output the obtained template that matches the question input text to the large language model to generate an initial mathematical formula result.

[0076] In some embodiments, the format dynamic conversion module 290 is used to construct a format conversion function, and dynamically convert the initial mathematical formula result according to the format requirements of the user to obtain the final mathematical formula result.

[0077] Obviously, it should be understood by those skilled in the art that the above-mentioned various steps of the present invention can be performed in a manner different from the present invention, and the simulation method and experimental equipment include but are not limited to the above description. The above-mentioned various steps of the present invention can be performed in an order different from that here in some cases, and the steps shown or described above can be performed separately. Therefore, the present invention is not limited to any specific combination of hardware and software.

[0078] The above contents are further detailed descriptions of the present invention in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.

Claims

1. An optimization method for generating mathematical formula format based on a large language model, characterized in that: include: Construct a proficiency scoring system, an intent library, a keyword library and a multi-level template library; wherein, the proficiency scoring system is constructed with language complexity, format familiarity and interaction mode frequency as scoring factors, and a preset scoring weight is assigned to each scoring factor; the intent library is a collection of multiple intent information, each of which is used to refer to a certain mathematical formula type or a certain mathematical formula format required by the user, and each of which corresponds to an intent vector; the keyword library includes multiple keyword theme sets, each of which is associated with a keyword theme set, and the keyword theme set includes multiple keywords, which are used to describe and identify words or phrases of the associated intent information; the multi-level template library includes multiple level template library sets, and a mapping relationship is formed between the level template library sets and the preset proficiency levels. The level template library set is a collection of multiple templates, and each template corresponds to a type of intent information; Obtain the user's question input text, calculate the user's current proficiency comprehensive score for using the large language model based on the proficiency scoring system, and determine the user's current proficiency level for using the large language model based on the mapping relationship between the comprehensive proficiency score and the preset proficiency level; Based on the user's current proficiency level of the large language model, according to the mapping relationship between the preset proficiency level and the level template library set, determine the associated level template library and multiple intent information corresponding to the level template library, and determine multiple corresponding intent vectors based on the obtained multiple intent information; The cosine similarity formula is used to calculate the cosine similarity between the question input text and each determined intent vector, and the cosine similarity of each intent vector is obtained. The obtained cosine similarity is used as the matching score of the corresponding intent information, and multiple intent information matching the question input text is obtained; According to the obtained multiple intention information matching the question input text, determine the keyword topic set associated with each intention information, and obtain the matching result of the target keyword contained in the question input text; Based on the matching scores of multiple intent information matching the question input text and the matching results of the target keywords, a template matching the question input text is obtained, and the obtained template matching the question input text is output to the large language model to generate an initial mathematical formula result; Construct a format conversion function to dynamically convert the initial mathematical formula result according to the user's format requirements to obtain the final mathematical formula result.

2. The optimization method for generating a mathematical formula format based on a large language model according to claim 1, characterized in that: Building the intent library includes: Predefine multiple intent information, input each intent information into the Word2vec model, generate the intent vector corresponding to each intent information, build the intent library based on the intent information and the corresponding intent vector, and assign the same preset intent weight to each intent information.

3. The optimization method for generating a mathematical formula format based on a large language model according to claim 2, characterized in that: Constructing the keyword library includes: Based on each type of intent information, define related keywords and build corresponding keyword topic sets; Based on the keyword topic set, a keyword library is constructed, and each keyword is assigned the same preset keyword weight, the preset intention weight is greater than the preset keyword weight, and the sum of the preset intention weight and the preset keyword weight is 1.

4. The optimization method for generating a mathematical formula format based on a large language model according to claim 3, characterized in that: Constructing the multi-level template library includes: Based on a preset proficiency level, an associated level template library set is defined, the level template library includes a plurality of templates, the level template library set includes a plurality of templates, each of the templates is constructed by a kind of intent information and its associated keyword theme set, and is used to generate a mathematical formula type or a mathematical formula format corresponding to the intent information according to the included intent information and the keywords in the associated keyword theme set; Based on the hierarchical template library, a multi-level template library is constructed.

5. The optimization method for generating a mathematical formula format based on a large language model according to claim 1, characterized in that: The step of obtaining the user's question input text and calculating the user's current comprehensive proficiency score of the large language model based on the proficiency scoring system includes: Obtain the user's question input text, and based on the proficiency scoring system, calculate the scores of language complexity, format familiarity, and interaction mode frequency respectively. According to the preset scoring weight of each scoring factor, calculate the user's current comprehensive proficiency score of the large language model; The calculation process of the language complexity score includes: Obtain high-frequency mathematical professional terms, classify and store the high-frequency mathematical professional terms according to preset term complexity levels, build a high-frequency professional term vocabulary, and assign preset term weights to each term complexity level; wherein the high-frequency mathematical professional terms are determined by capturing the frequency of occurrence of mathematical professional terms through a front-end lightweight database, and mathematical professional terms with a frequency of occurrence greater than a first preset interval are regarded as high-frequency mathematical professional terms; Use a word segmentation tool to segment the question input text, obtain multiple word segmentation results, and record the total number of word segmentation results; Traverse each word segmentation result in the high-frequency professional terminology database to obtain the term occurrence frequency of each word segmentation result and the term complexity level to which the corresponding word segmentation result belongs; Calculate the product of the term occurrence frequency of each word segmentation result and the preset term weight of the term complexity level to which the corresponding word segmentation result belongs, obtain the complexity score of each word segmentation result, and sum the complexity scores of all word segmentation results to obtain the total score of language complexity; The total score of language complexity is divided by the total number of word segmentation results to obtain the relative score of language complexity, and the relative score of language complexity is used as the score of language complexity; The calculation process of the format familiarity score includes: Obtain high-frequency mathematical formula formats and construct a high-frequency mathematical formula format list; wherein the high-frequency mathematical formula formats are determined by capturing the frequency of occurrence of mathematical formula formats through a front-end lightweight database, and mathematical formula formats with a frequency of occurrence greater than a second preset interval are used as high-frequency mathematical formula formats; Using a preset regular expression, searching for the target mathematical formula output format contained in the question input text to obtain a target search result, and using a clarity evaluation strategy to analyze the target search result to obtain a target analysis result, and determining the clarity level corresponding to the target analysis result according to a mapping relationship between the analysis result and a preset clarity level; Determining the format familiarity score of the corresponding question input text according to the mapping relationship between the clarity level and the preset format familiarity score; The calculation process of the score of the interaction mode frequency includes: According to the preset first time window, the number of interactions between the user and the large language model in the first time window is recorded; According to a preset second time window, wherein the second time window includes at least one first time window, the number of interactions in each first time window is normalized to obtain a normalized value of the number of interactions in each first time window, the average of all normalized values ​​of the number of interactions in the second time window is calculated, and the average of all normalized values ​​of the number of interactions in the second time window is used as the score of the interaction mode frequency.

6. The optimization method for generating a mathematical formula format based on a large language model according to claim 1, characterized in that: The method includes determining the associated level template library and multiple intent information of the corresponding level template library based on the user's current proficiency level of the large language model according to the mapping relationship between the preset proficiency level and the level template library set, and determining multiple corresponding intent vectors based on the obtained multiple intent information, including: Based on the user's current proficiency level of the large language model, determining the associated level template library according to a preset mapping relationship between the proficiency level and the level template library set; Based on the determined hierarchical template library, multiple intention information corresponding to all templates contained in the hierarchical template library is obtained, and based on the obtained multiple intention information, multiple corresponding intention vectors are determined.

7. The optimization method for generating a mathematical formula format based on a large language model according to claim 6, characterized in that: The cosine similarity formula is used to calculate the cosine similarity between the question input text and each determined intent vector, obtain the cosine similarity of each intent vector, use the obtained cosine similarity as the matching score of the corresponding intent information, and obtain multiple intent information matching the question input text, including: Input the question input text into the Word2vec model and output multiple word vectors; Perform vector aggregation processing on all word vectors to obtain the user input vector; The cosine similarity between the user input vector and each determined intent vector is calculated, and the obtained cosine similarity is used as the matching score of the corresponding intent information. The cosine similarity formula is: In the formula, represents the cosine similarity between the user input vector and the nth intention vector, represents the user input vector, (n) represents the nth intention vector, represents the norm of the user input vector, represents the norm of the nth intention vector, represents the dot product; The obtained cosine similarities are sorted from high to low. If the multiple cosine similarities in the first order are greater than the third preset interval, the intent information corresponding to the multiple cosine similarities in the first order is used as the multiple intent information matching the question input text.

8. The optimization method for generating a mathematical formula format based on a large language model according to claim 7, characterized in that: The method of determining a keyword theme set associated with each type of intent information based on the obtained multiple intent information that matches the question input text, and obtaining a matching result of the target keyword contained in the question input text, includes: Determine a keyword topic set associated with each type of intent information based on the obtained multiple intent information that matches the question input text; Natural language processing technology is used to identify the target keywords included in the question input text, and the target keywords are traversed in each keyword topic set. If the target keyword matches the corresponding keyword in the keyword topic set, the matching result of the target keyword with a matching score of 1 is output. If the target keyword does not match the corresponding keyword in the keyword topic set, the matching result of the target keyword with a matching score of 0 is output.

9. The optimization method for generating a mathematical formula format based on a large language model according to claim 8, characterized in that: The template matching the question input text is obtained based on the matching scores of the multiple intent information matching the question input text and the matching results of the target keywords, and the obtained template matching the question input text is output to the large language model to generate an initial mathematical formula result, including: The final matching score formula is used to calculate the final matching score of each intent information that matches the question input text. The final matching score formula is: M m =(X m × Weight 1) + (Y × Weight 2) Where M m represents the final matching score M of the mth intent information that matches the question input text, X m represents the matching score of the mth intent information, weight 1 represents the preset intent weight, Y represents the matching result of the target keyword corresponding to the mth intent information, and weight 2 represents the preset keyword weight; The final matching scores of each type of intent information are sorted from high to low, and the template corresponding to the intent information with the highest final matching score is selected as the template that matches the question input text, and the obtained template that matches the question input text is output to the large language model to generate an initial mathematical formula result.

10. An optimization system for generating mathematical formula format based on a large language model, characterized in that: include: A construction module is used to construct a large language model proficiency scoring system, an intent library, a keyword library and a multi-level template library; wherein, the proficiency scoring system is constructed with language complexity, format familiarity and interaction mode frequency as scoring factors, and a preset scoring weight is assigned to each scoring factor; the intent library is a collection of multiple intent information, each of which is used to refer to a certain mathematical formula type or a certain mathematical formula format required by the user, and each of the intent information corresponds to an intent vector; the keyword library includes multiple keyword theme sets, each of the intent information in the intent library is associated with a keyword theme set, and the keyword theme set includes multiple keywords, which are used to describe and identify the vocabulary or phrases of the associated intent information; the multi-level template library includes multiple level template library sets, and a mapping relationship is formed between the level template library sets and the preset proficiency levels. The level template library set is a collection of multiple templates, and each template corresponds to a type of intent information; Question acquisition module, used to obtain the user's question input text; A proficiency comprehensive score calculation module is used to calculate the user's current proficiency comprehensive score of the large language model based on the proficiency scoring system; A proficiency level determination module, used to determine the user's current proficiency level using the large language model based on a mapping relationship between the comprehensive proficiency score and a preset proficiency level; An intention vector determination module is used to determine, based on the user's current proficiency level of the large language model, the associated level template library and multiple intention information of the corresponding level template library according to the mapping relationship between the preset proficiency level and the level template library set, and determine multiple corresponding intention vectors based on the obtained multiple intention information; An intention matching module is used to calculate the cosine similarity between the question input text and each determined intention vector using a cosine similarity formula, obtain the cosine similarity of each intention vector, use the obtained cosine similarity as the matching score of the corresponding intention information, and obtain multiple intention information matching the question input text; A keyword matching module is used to determine a keyword theme set associated with each intent information based on the obtained multiple intent information matched with the question input text, and obtain a matching result of the target keyword contained in the question input text; A mathematical formula result output module is used to obtain a template that matches the question input text based on the matching scores of multiple intent information that matches the question input text and the matching results of the target keywords, and output the obtained template that matches the question input text to the large language model to generate an initial mathematical formula result; The format dynamic conversion module is used to construct a format conversion function and dynamically convert the initial mathematical formula result according to the user's format requirements to obtain the final mathematical formula result.

Citation Information

Patent Citations

  • Information matching method and system based on large language model

    CN118484510A

  • Low-code application development method and system based on AI auxiliary generation model

    CN118760427A