Chromatographic visualization interactive method and device based on solar term climate feature matching
Through the chromatographic visual interaction method based on the matching of solar climate characteristics, the training sample set and solar term recognition algorithm are used for iterative optimization, which solves the problem of insufficient solar term recognition accuracy in the existing technology, and achieves efficient and accurate solar term recognition and diversification Chromatography displays effects.
Patent Information
- Application Number
- CN202410521069.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-04-28
AI Technical Summary
The existing solar term recognition methods have shortcomings in recognition accuracy, and it is difficult to efficiently and accurately identify solar term information from a large number of text data.
A chromatographic visual interaction method based on the matching of solar climate characteristics is adopted. By obtaining a training sample set, including solar description text samples and other user interaction texts, the solar term recognition algorithm is used for iterative optimization, the algorithm parameters are corrected, and the recognition accuracy is improved.
Efficient and accurate solar terms recognition is achieved, and the target user interaction text is recognized through an optimized solar terms recognition algorithm, and targeted visual display is carried out based on the recognition results, improving the user experience.
Smart Images

Figure CN118427684B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the fields of natural language processing and machine learning technology, and in particular to a chromatogram visualization interaction method and device based on solar term climate feature matching. Background Art
[0002] As people pay more and more attention to traditional culture, the 24 solar terms, as an important part of ancient Chinese farming culture, have an irreplaceable position in daily life, agricultural production, cultural heritage, etc. However, with the rapid development of modern society, the traditional solar term identification and inheritance methods can no longer meet people's growing needs. With the popularization of artificial intelligence and interactive applications, people can consult solar terms with computer devices equipped with intelligent algorithms through voice interaction or text interaction. With the rapid development of computer technology and artificial intelligence, some solar term identification methods based on machine learning and natural language processing have gradually emerged. These methods enable computers to automatically identify solar term information in texts by training a large amount of sample data. However, the existing methods still have certain limitations and shortcomings, such as low recognition accuracy. Therefore, how to develop an efficient and accurate solar term identification method that can automatically identify solar term information from a large amount of text data has become a problem that needs to be solved. Summary of the invention
[0003] In view of this, the embodiments of the present application at least provide a chromatogram visualization interaction method and device based on solar term climate feature matching.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] On the one hand, an embodiment of the present application provides a chromatogram visualization interaction method based on solar term climate feature matching, the method comprising: obtaining a training sample set; the training sample set comprises multiple groups of first text samples and multiple groups of second text samples, wherein each group of the first text samples comprises a solar term description text sample corresponding to a user interaction text of a preset solar term type, and each group of the second text samples comprises the remaining user interaction texts other than the preset solar term type corresponding to the solar term description text sample; the first text sample is passed into a solar term recognition algorithm for iterative optimization to obtain an optimized first optimization cost value; the second text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the second text sample is estimated according to the solar term recognition algorithm to obtain a first estimation result; the first estimation result comprises the first support coefficient of the detection item sample estimated by the solar term recognition algorithm to correspond to each of the preset solar term types; through the first support support coefficient and preset type support coefficient threshold to obtain an optimized second optimization cost value; through the first optimization cost value and the second optimization cost value, the algorithm parameters of the solar term recognition algorithm are corrected to obtain an optimized solar term recognition algorithm; the target user interaction text containing the solar term description text is obtained; the target user interaction text is passed into the optimized solar term recognition algorithm, and the solar term type corresponding to the solar term description text in the target user interaction text is estimated according to the solar term recognition algorithm to obtain a third estimation result; the third estimation result includes the third support coefficient of the solar term description text estimated by the solar term recognition algorithm to execute each of the preset solar term types; the target solar term type corresponding to the solar term description text is determined through the third estimation result; according to the solar term type, the material corresponding to the solar term type is retrieved in the preset meteorological knowledge base, and the material is displayed, and the chromatogram of the material is a solar term chromatogram that conforms to the solar term type.
[0006] In some embodiments, the training sample set also includes a sample label corresponding to the first text sample, and the sample label is used to indicate the true type of the solar term type corresponding to the solar term description text sample in the first text sample; the first text sample is passed into the solar term recognition algorithm for iterative optimization to obtain an optimized first optimization cost value, including: passing the first text sample into the solar term recognition algorithm, and estimating the solar term type corresponding to the solar term description text sample in the first text sample according to the solar term recognition algorithm to obtain a second estimation result; the second estimation result includes the second support coefficient estimated by the solar term recognition algorithm that the detection item sample corresponds to each of the preset solar term types; the optimized first optimization cost value is obtained through the sample label and the second estimation result.
[0007] In some embodiments, the solar term recognition algorithm includes a first implicit algorithm component and a second implicit algorithm component; the first text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the first text sample is estimated according to the solar term recognition algorithm to obtain a second estimation result, including: passing the first text sample into the first implicit algorithm component, and extracting the knowledge representation of the first text sample according to the first implicit algorithm component to obtain a first knowledge representation; passing the first knowledge representation into the second implicit algorithm component, and extracting the knowledge representation according to the classification representative eccentricity factor according to the second implicit algorithm component. Inner product operation is performed to obtain a knowledge vector Vector1, wherein the classification representative eccentricity factor includes multiple classification representative eccentricity vectors, each of which is mapped one-to-one to one of the preset solar term types, and the number of elements of the knowledge vector Vector1 is the same as the number of the preset solar term types; the knowledge vector Vector1 is normalized according to a normalization algorithm to obtain a knowledge vector Vector2, and the knowledge vector Vector2 is used as a second estimated result. The vector unit in the knowledge vector Vector2 represents the second support coefficient of the solar term recognition algorithm estimating that the detection item sample corresponds to the corresponding preset solar term type.
[0008] In some embodiments, obtaining the optimized first optimization cost value through the sample mark and the second estimation result includes: determining the corresponding first eccentric adjustment vector from the classification representative eccentric vector through the true type of the solar term type in the sample mark, and using the classification representative eccentric vector other than the first eccentric adjustment vector in the classification representative eccentric vector as the second eccentric adjustment vector; obtaining a first commonality measurement result between the first knowledge representation and the first eccentric adjustment vector, and obtaining a second commonality measurement result between the first knowledge representation and each of the second eccentric adjustment vectors; obtaining the difference between the first commonality measurement result and the preset critical commonality measurement result to obtain a difference value D-value1; The optimized first optimization cost value is obtained through the difference D-value1 and each of the second commonality measurement results; wherein the difference D-value1 and the first optimization cost value are negatively correlated, and the second commonality measurement result and the first optimization cost value are positively correlated; the normalization operation on the knowledge vector Vector1 according to the normalization algorithm to obtain the knowledge vector Vector2 includes: obtaining a predetermined proportional adjustment parameter; adjusting the knowledge vector Vector1 according to the proportional adjustment parameter to obtain the knowledge vector Vector3; normalizing the knowledge vector Vector3 according to the normalization algorithm to obtain the knowledge vector Vector2.
[0009] In some embodiments, the solar term recognition algorithm includes a first implicit algorithm component and a second implicit algorithm component; the second text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the second text sample is estimated according to the solar term recognition algorithm to obtain a first estimation result, including: passing the second text sample into the first implicit algorithm component, and extracting the knowledge representation of the second text sample according to the first implicit algorithm component to obtain a second knowledge representation; passing the second knowledge representation into the second implicit algorithm component, and extracting the knowledge representation according to the classification representative eccentricity factor according to the second implicit algorithm component. Multiplication operation is performed to obtain a knowledge vector Vector4; wherein, the classification representative eccentricity factor includes multiple classification representative eccentricity vectors, each of the classification representative eccentricity vectors is mapped one-to-one with one of the preset solar term types, and the number of elements of the knowledge vector Vector4 is the same as the number of the preset solar term types; the knowledge vector Vector4 is normalized according to the normalization algorithm to obtain a knowledge vector Vector5, and the knowledge vector Vector5 is used as the first estimated result. The vector unit in the knowledge vector Vector5 represents the solar term recognition algorithm estimating the first support coefficient of the detection item sample corresponding to the corresponding preset solar term type.
[0010] In some embodiments, obtaining the optimized second optimization cost value includes: determining the third commonality measurement result between the second knowledge representation and each of the classification representative eccentricity vectors; determining the critical commonality measurement result through the type support coefficient threshold; determining the difference between the maximum third commonality measurement result and the critical commonality measurement result to obtain the difference D-value3; obtaining the optimized second optimization cost value through the difference D-value3; wherein the difference D-value3 and the second optimization cost value are positively correlated.
[0011] In some embodiments, the optimized second optimization cost value is obtained by using the first support coefficient and the preset type support coefficient threshold, including: obtaining the difference between the first support coefficient corresponding to each of the preset solar term types and the type support coefficient threshold, and obtaining the difference D-value2 corresponding to each of the preset solar term types; when the difference D-value2 is greater than zero, comparing the size of each difference D-value2, and determining the second optimization cost value by the largest difference D-value2; or when the difference D-value2 is not greater than 0, determining that the value of the second optimization cost value is equal to 0; the first optimization cost value and the second optimization cost value are obtained by using the first optimization cost value and the second optimization cost value. The algorithm parameters of the solar term recognition algorithm are corrected to obtain an optimized solar term recognition algorithm, including: determining a first number of the first text samples and a second number of the second text samples in the training sample set; determining a first eccentricity factor corresponding to the first optimization cost value through the first number, and determining a second eccentricity factor corresponding to the second optimization cost value through the second number; integrating the first optimization cost value and the second optimization cost value through the first eccentricity factor and the second eccentricity factor to obtain an integrated optimization cost value; correcting the algorithm parameters of the solar term recognition algorithm through the integrated optimization cost value to obtain an optimized solar term recognition algorithm.
[0012] In some embodiments, obtaining the target user interaction text containing the solar term description text includes: obtaining the original user interaction text; performing solar term description text detection on the original user interaction text to obtain a text window containing the solar term description text; and selecting the original user interaction text through the text window to obtain the target user interaction text.
[0013] In some embodiments, the method includes performing solar term description text detection on the original user interaction text to obtain a text window containing the solar term description text; selecting the original user interaction text through the text window to obtain the target user interaction text, including: performing solar term description text detection on each segment of the original user interaction text to obtain an initial text window corresponding to each segment of the original user interaction text; classifying the obtained original user interaction text into a text sequence; obtaining the number of text paragraphs in the current text sequence, and when the number of text paragraphs is not less than a preset number of paragraphs, extracting M original user interaction texts from the text sequence based on a preset paragraph interval to obtain an interaction text set; taking the initial text window corresponding to the original user interaction text centered in the current text sequence as the target text window, and selecting each of the original user interaction texts in the interaction text set through the target text window to obtain the target user interaction text.
[0014] In some embodiments, the target solar term type corresponding to the solar term description text is determined through the third estimation result, including: comparing the third support coefficient corresponding to each of the preset solar term types with the preset type support coefficient threshold; when it contains a third support coefficient greater than the type support coefficient threshold, comparing the sizes of each of the third support coefficients, and determining the target solar term type through the preset solar term type corresponding to the largest third support coefficient; when none of the third support coefficients is greater than the type support coefficient threshold, determining the target solar term type as a pending solar term type.
[0015] On the other hand, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps in the above method when executing the computer program.
[0016] The beneficial effects of the present application include at least: the present application provides a chromatographic visualization interaction method and system based on solar term climate feature matching, and the solar term identification is performed on the target user interaction text through an optimized solar term identification algorithm to obtain the solar term type. In the iterative optimization link of the solar term identification algorithm, a training sample set is obtained, and the training sample set includes multiple groups of first text samples and multiple groups of second text samples. Each group of first text samples includes solar term description text samples corresponding to user interaction texts of preset solar term types, that is, data corresponding to known solar term types. Each group of second text samples includes the remaining user interaction texts other than the preset solar term types corresponding to the solar term description text samples, that is, data corresponding to the undetermined solar term types. The first text samples are passed into the solar term identification algorithm for iterative optimization to obtain the optimized first optimization cost value, and the second text samples are passed into the solar term identification algorithm to obtain the first support coefficient of the solar term identification algorithm estimated detection item sample corresponding to each preset solar term type. For the second text sample, the goal is that the solar term recognition algorithm does not set it to the preset solar term type. Then, the first support coefficient can be judged based on the preset type support coefficient threshold to determine whether it is large, and the optimized second optimization cost value can be obtained; thereby, the algorithm parameters of the solar term recognition algorithm are corrected by the first optimization cost value and the second optimization cost value, and the optimized solar term recognition algorithm is obtained. When the text solar term recognition is performed based on the solar term recognition algorithm, a targeted visualization is performed according to the solar term recognition result. Specifically, when the visualization is displayed, the chromatographic information corresponding to the knowledge is used for display. In summary, not only is the matching accurate and efficient, but the diversified chromatographic display effect also improves the user experience.
[0017] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0019] Figure 1 A schematic diagram of the implementation flow of a chromatogram visualization interaction method based on solar term climate feature matching provided in an embodiment of the present application.
[0020] Figure 2 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0022] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" involved are merely to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first / second / third" may be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.
[0023] The embodiment of the present application provides a chromatogram visualization interaction method based on solar term climate feature matching, which can be executed by a processor of a computer device, wherein the computer device can refer to a device with data processing capabilities such as a server, a laptop, a tablet computer, and a desktop computer.
[0024] Figure 1 A schematic diagram of the implementation process of a chromatogram visualization interaction method based on solar term climate feature matching provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes an algorithm training phase and an algorithm application phase.
[0025] In the algorithm training stage, the following steps S100 to S500 are included:
[0026] Step S100: Obtain a training sample set.
[0027] The training sample set includes multiple groups of first text samples and multiple groups of second text samples, wherein each group of the first text samples includes a solar term description text sample corresponding to a user interaction text of a preset solar term type, and each group of the second text samples includes the solar term description text sample corresponding to the remaining user interaction text other than the preset solar term type.
[0028] The training sample set refers to a set of data used to train the model in the machine learning algorithm. This set of data contains multiple samples, each of which has certain features and labels, which are used to let the algorithm learn how to predict labels based on the features. For example, the training sample set can be a series of articles or paragraphs about solar terms, which have been marked as belonging to a specific solar term type or not belonging to any solar term type.
[0029] The first text sample refers to the text sample of the solar term description and the user interaction text corresponding to the preset solar term type in the training sample set. In simple terms, it is the text content that directly describes or is related to a specific solar term. For example, an article describing the "Spring Equinox" season, which mentions solar term-related descriptions such as "Spring Equinox Day, day and night are equal, spring is in the air", can be used as a first text sample.
[0030] Solar term description text samples refer to text contents that describe solar term phenomena or characteristics. These texts may directly contain the names of solar terms, or they may simply describe the climate, phenology and other phenomena related to the solar terms. For example, sentences posted by a user on social media such as "Today is the autumnal equinox, and the weather feels much cooler", "The leaves on the trees are slowly turning yellow, autumn is really here", and "The peach blossoms outside are blooming, spring should not be far away." are all solar term description text samples. Preset solar term types refer to a series of solar term categories that have been defined before algorithm training. These categories are usually set based on the traditional 24 solar terms, such as the Beginning of Spring, Rain Water, and Awakening of Insects.
[0031] User interaction text refers to the text information entered by the user during the interaction with the computer system. In this scenario, user interaction text can refer to the description, comments or articles about the solar terms entered by the user. For example, the content entered by the user in the interactive application, "Recently, when I get up in the morning, I can always feel a fresh and cool air, which seems to indicate the arrival of autumn. During the day, the sun shines through the leaves on the ground, and the light is soft and warm, no longer as hot as in summer. At night, the stars in the sky shine brightly, and there is a faint mist around. At the same time, the leaves begin to turn yellow gradually, and some have quietly fallen, covering the earth with a golden blanket." Such content is the user interaction text. Among them, "cool air, warm but not hot sunshine", "soft light", "yellow leaves, falling leaves", etc. are all solar term description text samples. It can be understood that the richer the solar term description text samples, the more dimensions involved (such as temperature perception, light conditions, precipitation conditions, phenological phenomena, records of customary activities, etc.), and the more accurate the solar term type recognition results obtained in the end. In practical applications, in order to ensure the accuracy of the output results and improve the user experience, during the interaction process, the user can be guided to enter a solar term description text that can accurately lock the relevant dimensions of the specific solar term type through a dialogue. It can be understood that this process can be a text obtained by converting the voice issued by the user into text through voice interaction, and of course, it can also be an interactive text manually entered by the user. The interactive text entered by the user can be a text that contains all dimensions that meet the requirements of accurate recognition at one time, or it can be a text that gradually meets all dimensions of accurate recognition after being entered in batches. The embodiments of this application do not limit this.
[0032] The second text sample refers to another type of sample in the training sample set, which includes the remaining user interaction texts other than the preset solar term types corresponding to the solar term description text samples. In other words, these texts may be related to the solar term, but do not directly correspond to any preset solar term type, or have nothing to do with the preset solar term. For example, the preset solar term type is the Spring Equinox, and the second text sample describes the meteorological phenomena in summer or winter.
[0033] Step S200: passing the first text sample into the solar term recognition algorithm for iterative optimization to obtain an optimized first optimization cost.
[0034] The solar term recognition algorithm can be a text recognition model, for example, it can be a complex model based on deep learning, natural language processing or other machine learning technologies, such as BERT. The iterative optimization process is the process of repeatedly debugging and training the solar term recognition algorithm. The optimization cost value is the error result that describes the recognition accuracy of the algorithm, and in some cases, it is also called loss. As some embodiments, the training sample set also includes a sample label corresponding to the first text sample, and the sample label is used to indicate the true type of the solar term type corresponding to the solar term description text sample in the first text sample. Then, step S200, passing the first text sample into the solar term recognition algorithm for iterative optimization to obtain the optimized first optimization cost value, specifically includes:
[0035] Step S210: The first text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the first text sample is estimated according to the solar term recognition algorithm to obtain a second estimated result; the second estimated result includes the second support coefficient estimated by the solar term recognition algorithm that the detection item sample corresponds to each of the preset solar term types.
[0036] In step S210, the first text sample is input into the solar term recognition algorithm. As mentioned above, this algorithm may be a complex model based on deep learning, natural language processing or other machine learning technologies, which contains a series of parameters and rules for text analysis and pattern recognition. The solar term recognition algorithm performs a deep analysis on the input first text sample, identifies descriptions related to the solar terms, and estimates the solar term type corresponding to the text sample based on these descriptions. This estimation process will output a second estimation result, which usually includes the algorithm's support coefficients for the text sample corresponding to each preset solar term type, and these coefficients reflect the algorithm's confidence in each solar term type. For example, if a first text sample describes scenes such as "cold temperature, snowflakes flying", the solar term recognition algorithm may output a higher support coefficient for the "winter solstice" solar term type, and a lower support coefficient for other solar term types such as "vernal equinox" and "summer solstice".
[0037] As an implementation, the solar term recognition algorithm includes a first implicit algorithm component and a second implicit algorithm component. Step S210, the first text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the first text sample is estimated according to the solar term recognition algorithm to obtain a second estimation result, including:
[0038] Step S211: the first text sample is passed into the first implicit algorithm component, and knowledge representation is extracted from the first text sample according to the first implicit algorithm component to obtain a first knowledge representation.
[0039] In the solar term recognition algorithm, step S211 involves deep feature extraction and knowledge representation of the input first text sample. This process is achieved through the first implicit algorithm component (also known as the hidden layer) in the algorithm. Specifically, when the computer device passes the first text sample into the solar term recognition algorithm, the operation of the first implicit algorithm component is first triggered. This component is designed to deeply analyze and understand the input text data, and extract key information that can reflect the text theme, content and semantic features. This process can be understood as a kind of "decoding" or "translation" of the algorithm on the text data, and its purpose is to convert human language into a form that can be understood and processed by the machine learning algorithm. Under the action of the first implicit algorithm component, the input first text sample will be converted into a first knowledge representation, which is actually a set of high-dimensional vectors or numerical sets that can reflect the characteristics of the text. These vectors or numerical sets capture key semantic information in the text, such as the meaning of words, the structure of sentences, the association of contexts, etc., thereby providing an important basis for the subsequent solar term type estimation.
[0040] To understand this process more intuitively, in a simple example, suppose the first text sample describes scenes such as "the temperature gradually drops and the nights begin to get longer", which are likely related to a solar term in autumn. The first implicit algorithm component will analyze these descriptions and extract key features related to the solar term, such as "the temperature drops" may correspond to the cool climate in autumn, and "the nights get longer" reflects the change in daylight hours. These features will be encoded as part of the first knowledge representation for subsequent solar term type estimation.
[0041] It should be noted that the specific implementation of the first implicit algorithm component may vary depending on different machine learning models. For example, in a deep learning model, the first implicit algorithm component may be one or more neural network hidden layers that extract text features through complex nonlinear transformations; while in a traditional machine learning model, the first implicit algorithm component may be a series of manually designed feature extractors or statistical models. Regardless of the implementation method used, the goal is to capture the key information in the text as accurately as possible and provide strong support for the subsequent solar term type prediction.
[0042] Step S212: The first knowledge representation is passed into the second implicit algorithm component, and the second implicit algorithm component performs an inner product operation on the first knowledge representation according to the classification representative eccentricity factor to obtain a knowledge vector Vector1. The classification representative eccentricity factor includes multiple classification representative eccentricity vectors, and each of the classification representative eccentricity vectors is mapped one-to-one to one of the preset solar term types. The number of elements of the knowledge vector Vector1 is the same as the number of the preset solar term types.
[0043] Step S212 is implemented by the second implicit algorithm component, and the concept of classification representative eccentricity factor is introduced. Specifically, the first knowledge representation is passed into the second implicit algorithm component, and the role of this component is to perform a deeper analysis and processing on the input knowledge representation so as to extract more abstract and essential features related to the solar term type. During the processing, the second implicit algorithm component will perform an inner product operation on the first knowledge representation based on the classification representative eccentricity factor. The classification representative eccentricity factor here is a special weight parameter, which represents the weight of the cluster center of the cluster, which can be a matrix including multiple classification representative eccentricity vectors, and a classification representative eccentricity vector is a weight vector. In fact, this factor contains multiple classification representative eccentricity vectors, each of which corresponds to a preset solar term type one by one. In this way, the algorithm can associate and compare the input text data with the preset solar term type. The inner product operation is a commonly used operation in mathematics and machine learning, which is used to measure the similarity or correlation between two vectors. In this step, through the inner product operation, the second implicit algorithm component can calculate the degree of match between the input text and each preset solar term type, thereby obtaining a knowledge vector Vector1 with the same number of preset solar term types. Each element in the knowledge vector Vector1 represents the support coefficient of a preset solar term type, reflecting the degree of association between the input text and the solar term type. In this way, the algorithm can preliminarily determine which solar term type the input text may belong to, providing an important basis for subsequent solar term type estimation. After the inner product operation is performed on each classification representative eccentric vector and the knowledge vector Vector1, a numerical value is obtained. The numerical values after the inner product operation of all classification representative eccentric vectors and the first knowledge representation together constitute the knowledge vector Vector1.
[0044] It should be noted that the specific implementation of the second implicit algorithm component and the classification representative eccentricity factor may vary depending on different machine learning models. For example, in a deep learning model, the second implicit algorithm component may be one or more neural network hidden layers, and the classification representative eccentricity factor may be a weight parameter learned through the back propagation algorithm. Regardless of the implementation method used, the goal is to extract key features related to the solar term type through in-depth analysis and processing of the input text, providing strong support for subsequent solar term type estimation.
[0045] Step S213: Normalize the knowledge vector Vector1 according to the normalization algorithm to obtain the knowledge vector Vector2, and use the knowledge vector Vector2 as the second estimation result. The vector unit in the knowledge vector Vector2 represents the second support coefficient estimated by the solar term recognition algorithm that the detection item sample corresponds to the corresponding preset solar term type.
[0046] Step S213 involves normalizing the knowledge vector Vector1 generated in the previous step to obtain a more accurate and reliable solar term type estimation result. In this step, a specific normalization algorithm, such as a flexible maximum transfer function, is used to process the knowledge vector Vector1. The flexible maximum transfer function is a commonly used mathematical function that can be adaptively adjusted and processed according to the characteristics of the input vector, so that the output vector has better numerical stability and interpretability while maintaining the original vector information. Through the normalization operation, each element in the knowledge vector Vector1 will be readjusted to eliminate the dimension differences and numerical range differences between different elements, so that the entire vector is more standardized and easy to handle. In this process, each element in the vector will undergo certain mathematical transformations, such as scaling, translation, etc., to achieve the purpose of normalization. The normalized knowledge vector is called the knowledge vector Vector2, which will be output as the second estimation result. Each element in this vector represents the support coefficient of the solar term recognition algorithm for the input text sample corresponding to each preset solar term type. These support coefficients reflect the algorithm's confidence level for each solar term type. The larger the value, the more the algorithm tends to believe that the input text belongs to the corresponding solar term type.
[0047] For example, if the value of an element in the knowledge vector Vector2 is large, it means that the algorithm believes that the input text is more closely matched with the solar term type corresponding to the element; conversely, if the value of an element is small, it means that the algorithm believes that the input text is not closely related to the solar term type corresponding to the element.
[0048] It should be noted that the specific implementation of the normalization algorithm may vary depending on the machine learning model. However, no matter which implementation method is used, the goal is to improve the accuracy and reliability of solar term type estimation by normalizing the knowledge vector.
[0049] As an implementation mode, step S213, performing a normalization operation on the knowledge vector Vector1 according to a normalization algorithm to obtain a knowledge vector Vector2, may specifically include:
[0050] Step S2131: Obtain predetermined proportional adjustment parameters.
[0051] In step S2131, a preset and predetermined proportional adjustment parameter is obtained. This parameter will be used to adjust the knowledge vector Vector1 in subsequent steps to obtain a more optimized and applicable knowledge vector Vector3. In this step, the proportional adjustment parameter is obtained from a preset parameter set. This parameter is usually a constant with a value greater than 1, which is called a temperature scaling parameter. The function is to change the element values in the knowledge vector Vector1, but not to change the proportional relationship between the element values.
[0052] Specifically, the scaling parameter will perform the same numerical scaling operation on each element in the knowledge vector Vector1, that is, each element will be multiplied by this parameter. Since the value of this parameter is greater than 1, the numerical value of the scaled element will increase relative to the original value, but the proportional relationship between the elements remains unchanged.
[0053] The purpose of this scaling operation is usually to improve the resolution or sensitivity of the knowledge vector Vector1, so that the normalization operation in the subsequent steps can more accurately capture the key information in the vector. At the same time, since the scaling operation does not change the proportional relationship between the elements, it will not destroy the original structural features and semantic information in the knowledge vector Vector1. It should be noted that the specific value of the scaling parameter may need to be adjusted and optimized according to the actual situation. It is usually used as one of the hyperparameters of the algorithm, and the optimal value is determined by cross-validation and other methods during the training process. In addition, in practical applications, other types of scaling parameters or scaling functions can also be considered to adapt to different data distributions and application requirements.
[0054] Step S2132: Adjust the knowledge vector Vector1 according to the ratio adjustment parameter to obtain the knowledge vector Vector3.
[0055] In step S2132, the knowledge vector Vector1 is adjusted according to the scale adjustment parameter to obtain a new knowledge vector Vector3. The purpose is to further optimize the representation of the vector by numerically scaling the knowledge vector so that the key features of the solar term type can be better captured in the subsequent normalization operation.
[0056] Specifically, obtain the scaling parameter determined in step S2131, which is usually a value greater than 1 and is called a temperature scaling parameter. Then, the device applies this scaling parameter to each element in the knowledge vector Vector1 to perform numerical scaling. This means that each element in Vector1 is multiplied by the scaling parameter to obtain a new value. Since the value of the scaling parameter is greater than 1, this scaling operation increases the value of each element in Vector1, but does not change the relative size relationship between the elements, that is, the ratio between the elements remains unchanged. This scaling helps to improve the resolution of the knowledge vector, so that the subtle differences in the vector can be more prominent in subsequent normalization operations.
[0057] After the scaling operation, the new knowledge vector obtained is called Vector3. The element values in Vector3 have been optimized according to the scaling parameters, which can better reflect the degree of correlation between the input text and each preset solar term type. This optimized knowledge vector Vector3 will be used for subsequent normalization operations to further extract key features related to the solar term type, and finally obtain accurate solar term type estimation results. It should be noted that the specific value of the scaling parameter may need to be adjusted and optimized according to actual conditions. It is usually used as one of the hyperparameters of the algorithm, and the optimal value is determined by cross-validation and other methods during the training process. In addition, in practical applications, other types of scaling functions or adjustment strategies can also be considered to adapt to different data distributions and application requirements.
[0058] Step S2133: Perform normalization operation on the knowledge vector Vector3 according to the normalization algorithm to obtain the knowledge vector Vector2.
[0059] Step S2133 normalizes the knowledge vector to eliminate the dimensional differences and numerical range differences between different elements, thereby making the entire vector more standardized and easy to handle. Specifically, the knowledge vector Vector3 generated in step S2132 is obtained, and then processed using a specific normalization algorithm. The normalization algorithm can be a mathematical function (such as a Softmax function) or a numerical processing method, and its goal is to scale, translate or otherwise transform the elements in Vector3 so that the transformed vector meets certain standard conditions.
[0060] For example, the normalization algorithm can be to divide each element in Vector3 by the norm of the vector (i.e., the length of the vector) to obtain a normalized vector. The numerical range of each element in the normalized vector is on the same scale, which is convenient for subsequent processing and comparison. In addition to normalization, other normalization methods can also be used, such as standardization, maximum and minimum scaling, etc. The specific choice depends on the actual application scenario and algorithm requirements. After the normalization operation, the new knowledge vector obtained is called Vector2. The elements in Vector2 have been normalized to eliminate the dimension and numerical range differences in the original vector, so that each element in the vector has the same scale and comparability. Such normalization helps to improve the accuracy and stability of solar term type estimation, because the algorithm can more accurately capture the degree of association between the input text and each preset solar term type. It should be noted that the specific implementation of the normalization algorithm may vary depending on different machine learning models. But no matter what implementation method is used, the goal is to improve the prediction performance and robustness of the algorithm by normalizing the knowledge vector.
[0061] Step S220: Obtain an optimized first optimization cost value through the sample label and the second estimation result.
[0062] In step S220, the sample mark mentioned above is used to evaluate the estimated accuracy of the solar term recognition algorithm. By comparing the actual solar term type recorded in the sample mark and the solar term type estimated by the algorithm (i.e., the second estimated result), the difference or error between the two can be calculated. This difference or error is then converted into a numerical indicator, namely the first optimized cost value. The size of this cost value directly reflects the quality of the algorithm's estimated results. The smaller the cost value, the closer the algorithm's estimate is to the actual situation. Conversely, it means that there is a large deviation in the algorithm's estimate. The first optimized cost value is not only used to evaluate the performance of the current algorithm, but more importantly, it can also serve as an important basis for subsequent algorithm optimization and adjustment. Through continuous iteration and optimization, the accuracy and robustness of the solar term recognition algorithm can be continuously improved, so as to better adapt to various complex and changeable text input scenarios.
[0063] The first optimization cost value can be calculated using any feasible cost function, such as the cross-entropy cost function (Cross-Entropy Loss), log-likelihood loss (Log-Likelihood Loss), etc., for example:
[0064]
[0065] Among them, yi is the probability of the i-th category in the actual sample label (usually 0 or 1), is the probability of the i-th category in the second estimated result.
[0066] After obtaining the first optimized cost value, an optimization algorithm (such as gradient descent) is usually used to minimize this cost value, thereby updating the parameters of the algorithm and improving the estimated performance of the algorithm.
[0067] As an implementation manner, step S220, obtaining an optimized first optimization cost value through the sample label and the second estimation result, includes:
[0068] Step S221: Determine the corresponding first eccentricity adjustment vector from the classification representative eccentricity vector through the true type of the solar term type in the sample mark, and use the classification representative eccentricity vector other than the first eccentricity adjustment vector in the classification representative eccentricity vector as the second eccentricity adjustment vector.
[0069] The purpose of step S221 is to more accurately reflect the difference between the model prediction result and the actual mark when calculating the optimization cost value, so as to improve the prediction performance of the model. Specifically, first obtain the true type of the solar term type in the sample mark. This true type has been determined in the data annotation stage, and it represents the solar term type to which the input text actually belongs. Then, the device will determine the corresponding first eccentric adjustment vector according to this true type from the preset classification representative eccentric vector. This first eccentric adjustment vector can be understood as a weight vector, which represents the importance or influence of the current solar term type in the classification representative eccentric vector. At the same time, the device will also use the part of the classification representative eccentric vector other than the first eccentric adjustment vector as the second eccentric adjustment vector. These second eccentric adjustment vectors represent the degree of influence of other solar term types in the classification representative eccentric vector, and they will also play a certain role in calculating the optimization cost value.
[0070] In this way, step S221 provides more accurate and detailed information for subsequent steps, so that the optimized cost value can better reflect the difference between the model prediction result and the actual mark. This difference will eventually be used to update the parameters of the model and improve the prediction performance of the model. It should be noted that the classification representative eccentricity vector, the first eccentricity adjustment vector and the second eccentricity adjustment vector are all preset parameters, and their specific values may need to be adjusted and optimized according to actual conditions. In addition, in actual applications, other types of weight vectors or adjustment strategies can also be considered to adapt to different data distributions and application requirements.
[0071] Step S222: Obtain a first commonality measurement result between the first knowledge representation and the first eccentricity adjustment vector, and obtain a second commonality measurement result between the first knowledge representation and each of the second eccentricity adjustment vectors.
[0072] The goal of step S222 is to quantify the degree of association between the first knowledge representation and each solar term type by calculating the similarity, so as to provide a basis for the subsequent optimization cost value calculation. In this process, the first knowledge representation mentioned above is first obtained, which is usually a vector or a set of features, which represents the key information of the input text in the solar term recognition task. Then, the device uses a preset similarity measurement method (such as cosine similarity, Euclidean distance, etc.) to calculate the similarity between the first knowledge representation and the first eccentric adjustment vector, and this similarity is called the first commonality measurement result. The first eccentric adjustment vector is determined from the classification representative eccentric vector according to the true solar term type in the sample tag, and it represents the important characteristics of the solar term type to which the current sample belongs. Therefore, the first commonality measurement result can reflect the degree of matching between the input text and the current solar term type. In addition to calculating the similarity with the first eccentric adjustment vector, the computer device also calculates the similarity between the first knowledge representation and each second eccentric adjustment vector, and these similarities are called second commonality measurement results. The second eccentric adjustment vector represents the characteristics of other solar term types. By calculating the similarity with them, we can understand the degree of association between the input text and other solar term types.
[0073] These commonality measurement results (i.e., similarity) will provide an important basis for subsequent steps. For example, when calculating the optimization cost value, you can consider comparing the first commonality measurement result with the preset critical commonality measurement result to obtain the difference D-value1, which will be used to adjust the size of the optimization cost value. At the same time, the second commonality measurement result can also be used as one of the reference factors for calculating the optimization cost value.
[0074] It should be noted that in practical applications, parameters such as which similarity measurement method to choose and how to determine the critical commonality measurement results may need to be adjusted and optimized according to the specific data distribution and algorithm requirements. In addition, in order to improve the efficiency and accuracy of the algorithm, it is also possible to consider using more complex machine learning models or neural networks to implement the functions of this step.
[0075] Step S223: Obtain the difference between the first commonality measurement result and the preset critical commonality measurement result to obtain a difference value D-value1.
[0076] The goal of step S223 is to calculate the difference between the first commonality measurement result and the preset critical commonality measurement result, and then obtain the difference D-value1. This difference will be used in subsequent steps to adjust and optimize the performance of the model. Specifically, when executing step S223, first obtain the first commonality measurement result calculated in step S222. This first commonality measurement result reflects the degree of match or similarity between the input text and the current solar term type. Then, the device will take out the critical commonality measurement result from the preset parameters. This critical commonality measurement result is a threshold used to determine whether the degree of match between the input text and the current solar term type has reached an acceptable level. The setting of the critical commonality measurement result is usually based on experience or experimental data and can be adjusted according to actual needs.
[0077] Next, the device calculates the difference between the first commonality measurement result and the critical commonality measurement result to obtain D-value1. This difference represents the gap between the degree of match between the input text and the current solar term type and the expected level. The size and sign (positive or negative) of the difference D-value1 are of great significance. If D-value1 is positive, it means that the degree of match between the input text and the current solar term type is higher than the expected level; if it is negative, it means that the degree of match is lower than the expected level. This difference will be used to adjust the optimization cost value in subsequent steps, thereby guiding the update of model parameters to improve the accuracy of solar term type estimation.
[0078] For example, suppose the first commonality measurement result of a certain input text is 0.85, and the critical commonality measurement result is set to 0.8. Then, the difference D-value1 is 0.85-0.8=0.05, indicating that the matching degree between the input text and the current solar term type is slightly higher than expected. This information will be used in the subsequent optimization process to help the model better adapt to the data and improve performance.
[0079] Step S224: Obtain the optimized first optimization cost value through the difference D-value1 and each of the second commonality measurement results; wherein, the difference D-value1 and the first optimization cost value are negatively correlated (i.e., negatively correlated), and the second commonality measurement result and the first optimization cost value are positively correlated (i.e., positively correlated).
[0080] The purpose of step S224 is to obtain an optimized first optimization cost value through the difference D-value1 calculated in the previous step and the second commonality measurement result. The first optimization cost value is used to evaluate the accuracy of the algorithm prediction and guide the subsequent model optimization process.
[0081] When executing step S224, the difference D-value1 is first considered. As mentioned above, D-value1 represents the difference between the degree of match between the input text and the current solar term type and the preset critical commonality measurement result. This difference is inversely correlated with the first optimization cost value, that is, when D-value1 increases (indicating that the degree of match is higher than expected), the first optimization cost value should decrease accordingly, reflecting that the model performs better on this sample; conversely, when D-value1 decreases (indicating that the degree of match is lower than expected), the first optimization cost value should increase, indicating that the model needs further optimization. In addition to the difference D-value1, the device also considers the second commonality measurement results, which reflect the similarity between the input text and other solar term types. The second commonality measurement result that is positively correlated with the first optimization cost value means that when the input text is more similar to other solar term types, the first optimization cost value will also increase accordingly. This is because the model should be able to accurately distinguish different solar term types, and if the input text is incorrectly classified into other types, the cost value should reflect this.
[0082] In summary, the first optimization cost is a function of the difference D-value1 and the second commonality measurement result. The specific form of this function may vary depending on the application scenario and algorithm design, but in general, it will be a value that can comprehensively reflect the prediction accuracy of the model and the degree of optimization required.
[0083] In mathematical terms, the first optimization cost (denoted as L1) may have the following relationship with the difference D-value1 (denoted as Δ) and the second commonality measurement result (denoted as Si, where (i) represents different other solar terms types):
[0084] L1=f(Δ,S1,S2,…,S n )
[0085] Here, f() is a function designed according to a specific algorithm. It may be linear, nonlinear, or a complex function learned by a machine learning algorithm. In practical applications, the form and parameters of this function need to be determined based on the training data and algorithm requirements.
[0086] Let's take a simple linear function example:
[0087]
[0088] In this example, α and β are weight parameters that determine the degree of influence of the difference D-value1 and the second commonality metric on the first optimization cost value. -Δ reflects the negative correlation between D-value1 and the cost value, while This reflects the positive contribution of all second commonality measurement results to the cost value. Of course, this is just an exemplary formula, and a more complex and precise function form may be required in practical applications.
[0089] Step S300: The second text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the second text sample is estimated according to the solar term recognition algorithm to obtain a first estimation result. The first estimation result includes the first support coefficient estimated by the solar term recognition algorithm that the detection item sample corresponds to each of the preset solar term types.
[0090] Step S300 is a key step in the application of the solar term recognition algorithm to estimate the solar term type for a given second text sample. In this step, the solar term recognition algorithm that has been trained and optimized before is used to analyze the solar term description text in the second text sample and predict its corresponding solar term type.
[0091] Specifically, after receiving the second text sample, the sample is first passed into the solar term recognition algorithm. Inside the algorithm, the model will perform a series of processing on the input text, including word embedding, feature extraction, and classification. Word embedding converts each word in the text into a vector of fixed length to capture the semantic relationship between words. Feature extraction extracts useful information for solar term type prediction from these word vectors. Finally, the classifier classifies the text according to the extracted features and predicts the solar term type to which it belongs. After the estimation is completed, the algorithm will output a first estimation result. This result includes the algorithm's support coefficients for the solar term description text in the second text sample corresponding to each preset solar term type. These support coefficients can be understood as the model's possibility or confidence that the text belongs to a certain solar term type. They are usually given in the form of probability or confidence scores, and the higher the value, the more confident the model is that the text belongs to the corresponding solar term type.
[0092] For example, suppose there is a second text sample that contains a solar term description text such as "During the Cold Dew season, wild geese come as guests." After the computer device passes this sample into the solar term recognition algorithm, the algorithm may output a first estimated result, which includes a support coefficient for the text corresponding to the solar term type "Cold Dew", such as 0.95. This value means that the model is 95% sure that the text describes the solar term "Cold Dew". At the same time, the estimated result will also include support coefficients for other solar term types corresponding to the text, but their values are usually much lower than 0.95 because the model believes that these solar term types do not match the description of the text.
[0093] As an implementation mode, the solar term recognition algorithm includes a first implicit algorithm component and a second implicit algorithm component. Step S300, the second text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the second text sample is estimated according to the solar term recognition algorithm to obtain a first estimation result, including:
[0094] Step S310: the second text sample is passed to the first implicit algorithm component, and knowledge representation is extracted from the second text sample according to the first implicit algorithm component to obtain a second knowledge representation.
[0095] Step S310 involves extracting knowledge representation of the second text sample. In this step, the second text sample is passed into the first implicit algorithm component, which is responsible for extracting meaningful information from the text, namely, knowledge representation. Specifically, when the second text sample is passed into the first implicit algorithm component, the component will use preset rules, algorithms or models to conduct an in-depth analysis of the text. This analysis process may include multiple levels such as lexical analysis, syntactic analysis, and semantic understanding, aiming to extract information from the text that can represent its meaning and characteristics. This information is integrated into a structured form, called the second knowledge representation.
[0096] The second knowledge representation can be a vector, a set of features, or any other data structure that can represent textual knowledge. It captures the key information in the text, making subsequent processing and analysis more efficient and accurate. To illustrate this step more specifically, assume that the first implicit algorithm component uses a deep learning model such as a convolutional neural network (CNN) or a long short-term memory network (LSTM). These models are able to extract high-level feature representations from text that capture the semantic and contextual information of the text. Through training and optimization, these models are able to learn an effective mapping from raw text to knowledge representation.
[0097] Step S310 uses the first implicit algorithm component to perform an in-depth analysis on the second text sample and extract meaningful knowledge representation from it. This knowledge representation will provide an important basis for subsequent processing and prediction.
[0098] Step S320: The second knowledge representation is passed into the second implicit algorithm component, and the second implicit algorithm component performs an inner product operation on the second knowledge representation according to the classification representative eccentricity factor to obtain a knowledge vector Vector4; wherein the classification representative eccentricity factor includes multiple classification representative eccentricity vectors, each of the classification representative eccentricity vectors is mapped one-to-one to one of the preset solar term types, and the number of elements of the knowledge vector Vector4 is the same as the number of the preset solar term types.
[0099] Step S320 involves further processing the second knowledge representation extracted in the previous step to obtain key information for solar term type estimation. In this step, the second knowledge representation is passed to the second implicit algorithm component, and an inner product operation is performed on it using the classification representative eccentricity factor, and finally a knowledge vector Vector4 is generated.
[0100] The second implicit algorithm component can be part of a deep neural network, for example, it can be a fully connected network component. Responsible for processing and analyzing the input knowledge representation. This component has mastered the ability to extract features related to the solar term type from the knowledge representation through training and learning. The inner product operation is a commonly used operation in mathematics and machine learning, which measures the similarity or correlation between two vectors. In S320, the inner product operation is used to combine the second knowledge representation with the classification representative eccentricity factor to generate new information. The classification representative eccentricity factor is a key concept, which includes multiple classification representative eccentricity vectors. These vectors correspond to the preset solar term types one by one, and each vector represents the characteristics or attributes of the corresponding solar term type. Through the inner product operation with these vectors, the second knowledge representation is converted into a more specific and direct form, namely the knowledge vector Vector4. Each element of the knowledge vector Vector4 corresponds to a preset solar term type, and its value represents the degree of association between the second text sample and the solar term type. In other words, this vector contains the algorithm's preliminary judgment that the text sample belongs to each solar term type.
[0101] For example, assume that there are four preset solar terms: Spring Equinox, Summer Solstice, Autumnal Equinox, Winter Solstice, and the second knowledge representation is a four-dimensional vector. In step S320, the computer device performs an inner product operation on the four-dimensional vector and the four classification representative eccentric vectors to obtain a new four-dimensional vector, namely, the knowledge vector Vector4. Each element of this vector represents the similarity or correlation score between the text sample and the corresponding solar term type, and the subsequent steps will make a final estimate of the solar term type based on this score.
[0102] Step S330: Perform normalization operation on the knowledge vector Vector4 according to the normalization algorithm to obtain the knowledge vector Vector5, and use the knowledge vector Vector5 as the first estimation result. The vector unit in the knowledge vector Vector5 represents the first support coefficient estimated by the solar term recognition algorithm that the detection item sample corresponds to the corresponding preset solar term type.
[0103] Step S330 is a key step in the derivative scheme of the solar term identification algorithm to further process the knowledge vector Vector4 generated in the previous step. In this step, the knowledge vector Vector4 is normalized using a normalization algorithm to obtain a more standardized and easy-to-interpret result.
[0104] Normalization algorithm is a commonly used data processing technique, which can be used to adjust the scale of a vector so that each element of the vector can be compared within the same numerical range. In this scenario, the purpose of the normalization operation is to enable each element in the knowledge vector Vector4 to reflect the relative relationship between the text sample and the different solar terms, rather than the absolute numerical size. Specifically, the normalization operation may include steps such as scaling, normalization, or standardization, which convert the elements in the knowledge vector Vector4 into a specific numerical range, such as between 0 and 1. Through such a conversion, the dimension or scale differences that may exist in the original data can be eliminated, so that different elements can be directly compared.
[0105] After completing the normalization operation, the computer device will generate a new vector, namely the knowledge vector Vector5. This vector, as the first estimated result, contains the judgment of the solar term recognition algorithm on the relationship between the text sample and each preset solar term type. In particular, each vector unit in the knowledge vector Vector5 represents a preset solar term type, and its value represents the support coefficient of the algorithm's estimated text sample corresponding to the solar term type. For example, if the preset solar term types are the spring equinox, summer solstice, autumnal equinox, and winter solstice, then the knowledge vector Vector5 will be a four-dimensional vector. Assuming that the normalization operation converts the original knowledge vector Vector4 into a new vector such as [0.8, 0.1, 0.5, 0.6], then the four elements of this new vector represent the degree of association between the four solar terms of the spring equinox, summer solstice, autumnal equinox, and winter solstice and the text sample. The subsequent steps can make the final judgment and selection of the solar term type based on these support coefficients.
[0106] Step S400: Obtain an optimized second optimization cost value through the first support coefficient and a preset type support coefficient threshold.
[0107] The purpose of step S400 is to further screen out the most likely solar term type based on the algorithm's estimated result of the relationship between the text sample and each preset solar term type, thereby improving the accuracy of solar term recognition.
[0108] In step S400, first obtain the knowledge vector Vector5 generated in the previous step, which contains the algorithm's first support coefficients for the text sample corresponding to each preset solar term type. These support coefficients reflect the algorithm's judgment on the relationship between the text sample and each solar term type. The higher the value, the more confident the algorithm is that the text sample belongs to the corresponding solar term type. Then, use a preset type support coefficient threshold to screen these first support coefficients. This threshold is a preset numerical standard used to determine whether a support coefficient is high enough to determine whether the text sample belongs to the corresponding solar term type. Only when a support coefficient is higher than or equal to this threshold, the computer device will consider that the text sample has a higher degree of association with the corresponding solar term type. After screening out the support coefficients higher than the threshold, an optimized second optimization cost value is calculated based on these screened support coefficients. This cost value is a comprehensive evaluation of the relationship between the text sample and each possible solar term type, which can be used to represent the degree of match between the text sample and the most likely solar term type.
[0109] For example, if the preset type support coefficient threshold is 0.6, and the elements in the knowledge vector Vector5 are [0.8, 0.1, 0.5, 0.7], then the computer device will filter out the support coefficients greater than or equal to 0.6, that is, [0.8, 0.7]. Then, the second optimization cost value is calculated based on the two filtered support coefficients, such as taking their average or maximum value as the cost value. This cost value will be used as the basis for subsequent steps to determine the solar term type of the text sample.
[0110] As an implementation manner, step S400, obtaining the optimized second optimization cost value, may specifically include:
[0111] Step S410: Determine a third commonality measurement result between the second knowledge representation and each of the classification representative eccentricity vectors.
[0112] Step S420: Determine the critical commonality measurement result through the type support coefficient threshold.
[0113] Step S430: Determine the maximum difference between the third commonality measurement result and the critical commonality measurement result to obtain a difference value D-value3.
[0114] Step S440: Obtain an optimized second optimization cost value through the difference D-value3; wherein the difference D-value3 and the second optimization cost value are positively correlated.
[0115] In step S410, the third commonality measurement result between the second knowledge representation and each classification representative eccentric vector is determined. The second knowledge representation here is the representation form of the processed text sample mentioned above, and the classification representative eccentric vector is a feature vector associated with each preset solar term type. The commonality measurement can be understood as an indicator that measures the similarity or correlation between two vectors, such as cosine similarity or inner product. The computer device calculates the commonality measurement between the second knowledge representation and each classification representative eccentric vector to obtain a set of commonality measurement results.
[0116] Step S420, using a preset type support coefficient threshold to determine the critical commonality measurement result. This threshold is a preset value used to filter out items with higher commonality measurement results, that is, items with a strong correlation between the text sample and a certain solar term type. Only commonality measurement results that are higher than or equal to this threshold will be considered valid and constitute critical commonality measurement results.
[0117] In step S430, the difference between the maximum third commonality measurement result and the critical commonality measurement result is determined, which is recorded as the difference D-value3. This difference reflects the gap between the most matching solar term type and the relatively matching type screened by the threshold, thereby providing additional information on the degree of match between the text sample and the most likely solar term type. The larger the difference, the more significant the difference between the most matching solar term type and the relatively matching type.
[0118] Finally, in step S440, the difference D-value3 is used to obtain the optimized second optimization cost value. Since the difference D-value3 is positively correlated with the second optimization cost value, that is, the larger the difference, the larger the second optimization cost value should be. This positive correlation can be achieved by various monotonically increasing functions, such as linear functions, exponential functions, etc. The specific calculation formula may vary depending on the algorithm design, but the general form can be expressed as:
[0119] The second optimized cost value L2=f(D-value3), where f() is a monotonically increasing function.
[0120] For example, if a linear function is used, the second optimization cost can be simply calculated as:
[0121] The second optimal cost value L2 = a × D-value3 + b
[0122] Where a and b are constants, and (a>0) to ensure positive correlation.
[0123] As another implementation, step S400, obtaining an optimized second optimization cost value by using the first support coefficient and a preset type support coefficient threshold, includes:
[0124] Step S400a: Obtain the difference between the first support coefficient corresponding to each of the preset solar term types and the support coefficient threshold of this type, and obtain the difference value D-value2 corresponding to each of the preset solar term types.
[0125] Step S400b: When the difference D-value2 is greater than zero, compare the sizes of the difference D-value2 and determine the second optimization cost value by the largest difference D-value2; or when the difference D-value2 is not greater than 0, determine that the value of the second optimization cost value is equal to 0.
[0126] In step S400a, first obtain the first support coefficient corresponding to each preset solar term type, and calculate the difference between these support coefficients and the preset type support coefficient threshold, and obtain the difference D-value2 corresponding to each preset solar term type. This difference reflects the distance between the first support coefficient of each solar term type and the threshold, so that the degree of association between the text sample and each solar term type can be measured. If a certain difference D-value2 is large, it means that the first support coefficient of the corresponding solar term type is much higher than the threshold, that is, the correlation between the text sample and the solar term type is high. Step S400b, determine the second optimization cost value according to the situation of the difference D-value2. If there is a difference D-value2 greater than zero, the computer device will compare the sizes of all the difference D-value2, and select the largest difference D-value2 to determine the second optimization cost value. This is because the largest difference D-value2 represents the strongest association between the text sample and a solar term type. Specifically, the second optimization cost value can be the maximum difference D-value2 itself, or a value calculated by a certain function based on the maximum difference D-value2, which depends on the specific design of the algorithm. Another case is that if all the difference values D-value2 are not greater than 0, this means that the first support coefficients of all solar term types are lower than or equal to the threshold, that is, the correlation between the text sample and any solar term type is not enough to exceed the preset minimum standard. In this case, the computer device will determine that the value of the second optimization cost value is 0, indicating that there is not enough information to determine the solar term type corresponding to the text sample. Through the refinement of steps S400a and S400b, the degree of correlation between the text sample and each solar term type can be more accurately evaluated, and an optimized second optimization cost value can be obtained for subsequent solar term type judgment. This processing method improves the accuracy and reliability of solar term recognition.
[0127] Step S500: modifying the algorithm parameters of the solar term recognition algorithm by using the first optimization cost value and the second optimization cost value to obtain an optimized solar term recognition algorithm.
[0128] In step S500, first obtain the first optimization cost value and the second optimization cost value calculated in the previous step. These two values respectively reflect the degree of matching between the text sample and the preset solar term type at different levels, and provide an important basis for the correction of the algorithm parameters. Next, according to these optimization cost values, the parameters in the solar term recognition algorithm are reviewed and adjusted one by one. These parameters may include but are not limited to: the method of text feature extraction, the threshold setting of the classifier, the weight coefficient used in the algorithm, etc. The specific method of correcting the parameters depends on the design and implementation of the algorithm, and may involve complex mathematical operations and logical judgments.
[0129] For example, if the first optimization cost value indicates that the text sample is highly matched with the semantic features of a certain solar term type, but the second optimization cost value is lower, it means that there is a deficiency in the type support coefficient. At this time, the weight coefficient related to the solar term type in the algorithm can be adjusted to improve its recognition rate in the next iteration. Conversely, if the second optimization cost value is high and the first optimization cost value is low, the text feature extraction method can be re-examined to try to extract more representative features to improve the accuracy of semantic matching.
[0130] Through such a series of parameter correction processes based on the optimization cost value, the solar term recognition algorithm can gradually improve and optimize itself, and improve the recognition accuracy and stability of various text samples. The final optimized solar term recognition algorithm will be able to better adapt to different text input scenarios and needs.
[0131] As an implementation mode, step S500, using the first optimization cost value and the second optimization cost value, corrects the algorithm parameters of the solar term recognition algorithm to obtain an optimized solar term recognition algorithm, including:
[0132] Step S510: Determine a first number of the first text samples and a second number of the second text samples in the training sample set.
[0133] Step S520: determining a first eccentricity factor corresponding to the first optimization cost value through the first quantity, and determining a second eccentricity factor corresponding to the second optimization cost value through the second quantity.
[0134] Step S530: Integrate the first optimization cost value and the second optimization cost value by using the first eccentricity factor and the second eccentricity factor to obtain an integrated optimization cost value.
[0135] Step S540: modifying the algorithm parameters of the solar term recognition algorithm through the integrated optimization cost value to obtain an optimized solar term recognition algorithm.
[0136] In step S510, first determine the first number of first text samples and the second number of second text samples in the training sample set. The first text sample and the second text sample here may refer to the text data of different types or different processing methods mentioned above. The determination of the number is to take into account the possible impact of sample imbalance when calculating the optimization cost value later. Next, in step S520, according to the first number and the second number, the corresponding first eccentricity factor and the second eccentricity factor are determined for the first optimization cost value and the second optimization cost value respectively. The eccentricity factor plays the role of weight here, and they are used to adjust the importance of the optimization cost value in the calculation. If the number of a certain type of text samples is small, then its eccentricity factor may be set higher to increase the weight of such samples in the calculation, so as to avoid the model from being overly biased towards the sample type with a large number. In step S530, the first optimization cost value and the second optimization cost value are integrated using the first eccentricity factor and the second eccentricity factor. The integration method is usually achieved by weighted summation, that is, each optimization cost value is multiplied by its corresponding eccentricity factor and then added to obtain the integrated optimization cost value. This integrated optimization cost value comprehensively considers the impact of different text sample numbers and different types of optimization cost values on the algorithm parameter correction. Finally, in step S540, the algorithm parameters of the solar term recognition algorithm are corrected according to the integrated optimization cost value. The correction method may include adjusting the threshold of the classifier, updating the weight coefficient, optimizing the feature extraction method, etc. These corrections are intended to enable the solar term recognition algorithm to more accurately identify different types of text samples and improve the overall performance of the algorithm.
[0137] Through S510 to S540, the solar term recognition algorithm can better adapt to text input in different scenarios and improve the accuracy and stability of recognition. At the same time, by introducing the eccentricity factor for weighted summation, the algorithm's adaptability to different sample distributions is also increased, making it more robust in practical applications.
[0138] Based on the above steps S100 to S500, the training process of the solar term recognition algorithm is completed. The following is the algorithm application stage, which includes the following steps:
[0139] Step S600: Acquire target user interaction text including solar term description text.
[0140] As an implementation manner, step S600, obtaining a target user interaction text including a solar term description text, specifically includes:
[0141] Step S610: Acquire original user interaction text.
[0142] Step S620: Perform solar term description text detection on the original user interaction text to obtain a text window containing the solar term description text.
[0143] Step S630: select the original user interaction text through the text window to obtain the target user interaction text.
[0144] In step S610, the original user interaction text is obtained. These original texts are unprocessed text data input by the user into the computer device, and may contain various information, such as articles, paragraphs, sentences, etc. In this step, these original texts are received and stored to prepare for subsequent processing and analysis.
[0145] Next, in step S620, the original user interaction text is detected for solar term descriptions. The purpose of this step is to identify whether the text contains solar term descriptions and to determine the locations of these descriptions in the text. To achieve this goal, the computer device may use various text processing technologies and machine learning algorithms, such as named entity recognition (NER) or keyword matching in natural language processing (NLP). Through these technologies, the computer device can scan the original text, identify descriptions related to solar terms, and record the starting and ending locations of these descriptions in the text, thereby forming a text window.
[0146] For example, if the original user interaction text is an article about solar terms, which contains a description such as "During the spring equinox, the earth warms up and all things revive", then the solar term description text detection step can identify this description and determine its specific position in the article. Finally, in step S630, the computer device uses the text window obtained in the previous step to frame the original user interaction text. The frame selection process is to extract the part of the text containing the solar term description from the original text according to the starting and ending positions recorded in the text window. In this way, the computer device obtains a target user interaction text that accurately contains the solar term description. In summary, through the step-by-step text acquisition, detection and frame selection process, it is ensured that the target user interaction text finally obtained accurately contains the solar term description. This method improves the accuracy and relevance of text data and provides a reliable analysis basis for the subsequent solar term recognition algorithm.
[0147] As an implementation mode, the solar term description text detection is performed on the original user interaction text to obtain a text window containing the solar term description text; the original user interaction text is framed through the text window to obtain the target user interaction text, which may specifically include:
[0148] Step S6a: Perform solar term description text detection on each section of the original user interaction text to obtain an initial text window corresponding to each section of the original user interaction text.
[0149] Step S6b: classify the obtained original user interaction text into a text sequence.
[0150] Step S6c: obtaining the number of text paragraphs in the current text sequence, and when the number of text paragraphs is not less than a preset number of paragraphs, extracting M original user interaction texts from the text sequence based on a preset paragraph interval to obtain an interaction text set.
[0151] Step S6d: taking the initial text window corresponding to the original user interaction text centered in the current text sequence as the target text window, and selecting each of the original user interaction texts in the interactive text set through the target text window to obtain the target user interaction text.
[0152] In step S6a to step S6d, the original user interaction text is processed through a series of detailed steps to obtain the target user interaction text containing the solar term description.
[0153] In step S6a, firstly, each paragraph of the original user interaction text is subjected to a solar term description text detection. The purpose of this step is to identify which paragraphs in the text contain descriptions related to the solar terms. The solar term description text detection can be implemented by a variety of methods, such as using keyword matching, syntactic analysis or machine learning models (such as support vector machines, naive Bayes classifiers or deep learning models) in natural language processing (NLP) technology to identify specific words and phrases related to the solar terms. For each paragraph of text in which the solar term description is detected, the computer device will record the corresponding starting and ending positions to form an initial text window.
[0154] In step S6b, all the original user interaction texts obtained are classified into a text sequence in order. This is done to facilitate processing and comparison of texts of different paragraphs in subsequent steps.
[0155] Step S6c, obtain the number of text paragraphs in the current text sequence, and determine whether this number is not less than a preset number of paragraphs. This preset number of paragraphs is set according to actual needs and is used to control the complexity and accuracy of subsequent processing. If the number of text paragraphs is not less than the preset number of paragraphs, the computer device will extract M original user interaction texts from the text sequence based on the preset paragraph interval to form an interactive text set. The "paragraph interval" here can be different strategies such as several consecutive paragraphs, taking a paragraph every other paragraph, etc., depending on the text structure and information density that you want to capture.
[0156] Step S6d, taking the initial text window corresponding to the original user interaction text centered in the current text sequence as the target text window. This "centered" text is usually considered to be the paragraph most likely to contain important solar term descriptions. Then, the computer device will use this target text window to frame each original user interaction text in the interactive text set. The frame selection process is to extract the corresponding text fragments in the interactive text set based on the starting and ending positions of the target text window. In this way, the computer device obtains one or more target user interaction texts containing solar term descriptions.
[0157] For example, if the user inputs a long article containing multiple paragraphs related to the solar terms, the computer device first identifies these paragraphs (step S6a), and then arranges them in order (step S6b). Next, the computer will decide which paragraphs to extract for further processing based on the total number of paragraphs in the article and the preset number of paragraphs (step S6c). Finally, the computer will select a centered paragraph containing a description of the solar terms as a reference, and use the text window of this paragraph to select other related paragraphs to obtain the final target user interaction text (step S6d). This process ensures that the final extracted text not only contains the description of the solar terms, but also has a certain degree of representativeness and accuracy.
[0158] Step S700: The target user interaction text is passed into the optimized solar term recognition algorithm, and the solar term type corresponding to the solar term description text in the target user interaction text is estimated according to the solar term recognition algorithm to obtain a third estimation result. The third estimation result includes the third support coefficient estimated by the solar term recognition algorithm for the solar term description text to execute each of the preset solar term types.
[0159] The solar term recognition algorithm is the algorithm used in the above training to identify solar term descriptions in text. During the training process, it will learn a large number of text samples containing solar term descriptions and extract the key features required to identify solar terms based on these samples. Once the training is completed, the algorithm can automatically determine whether the input text contains solar term descriptions and estimate the specific solar term type.
[0160] When the computer device passes the target user interaction text to the solar term recognition algorithm, the algorithm will conduct an in-depth analysis of the text. It will scan every word, every phrase, and even every sentence in the text to find clues related to the solar term. These clues can be specific vocabulary, phrase structure, grammatical features, etc. The algorithm will compare these clues with the solar term features it learned during the training process to determine whether the text contains a solar term description and estimate the specific solar term type.
[0161] This estimation process will give a probabilistic result, namely the third estimation result. This result includes the third support coefficient of the algorithm's estimated text execution of each preset solar term type. These support coefficients represent the algorithm's judgment on the possibility of the text describing each solar term type. For example, if the text describes "Spring Equinox", then the support coefficient for "Spring Equinox" given by the algorithm will be higher than the support coefficients for other solar term types. In this way, step S700 can not only tell the computer device whether the text contains a solar term description, but also give the specific solar term type and the corresponding possibility. This provides important information support for subsequent solar term identification and application.
[0162] Step S800: Determine the target solar term type corresponding to the solar term description text through the third estimation result.
[0163] As an implementation manner, step S800, determining the target solar term type corresponding to the solar term description text through the third estimation result, may specifically include:
[0164] Step S810: Compare the third support coefficient corresponding to each preset solar term type with the preset type support coefficient threshold.
[0165] Step S820: When a third support coefficient greater than the support coefficient threshold of this type is included, the target solar term type is determined by comparing the sizes of each third support coefficient and using the preset solar term type corresponding to the largest third support coefficient.
[0166] Step S830: When the third support coefficient is not greater than the support coefficient threshold of the type, the target solar term type is determined to be a pending solar term type.
[0167] In the process of the computer device performing solar term identification, step S800 is a decision step, which determines the specific solar term type corresponding to the solar term description text based on the third estimated result obtained in the previous step. The purpose of this step is to select a solar term type that best matches the text description from multiple possible solar term types, or mark it as a pending solar term type if there is not enough confidence. The specific implementation of step S800 can be implemented by following the steps S810 to S830:
[0168] In step S810, the third support coefficient corresponding to each preset solar term type is compared with a preset type support coefficient threshold. This threshold is set in advance and is used to determine whether the third support coefficient is high enough to ensure that the text describes the corresponding solar term type. For example, if the third support coefficient of a solar term type is much higher than the threshold, then the computer device can be more confident that the text describes this solar term type. Next, in step S820, if there is a third support coefficient greater than the type support coefficient threshold, the sizes of these third support coefficients that are higher than the threshold are further compared. The preset solar term type corresponding to the largest third support coefficient is selected as the target solar term type. This is because the largest third support coefficient represents the highest confidence of the algorithm for the solar term type, so it is most reasonable to select it as the target solar term type.
[0169] For example, if the text describes "Summer Solstice, the sun is scorching", and the third support coefficient for "Summer Solstice" given by the algorithm is much higher than other solar term types, and also higher than the preset type support coefficient threshold, then the computer device will determine that "Summer Solstice" is the target solar term type. Finally, in step S830, if all the third support coefficients are not greater than the type support coefficient threshold, this means that the algorithm does not have enough confidence in any of the solar term types described in the text. In this case, the computer device will determine that the target solar term type is a pending solar term type. This processing method avoids making wrong judgments without sufficient evidence. In general, step S800 and its derivative steps determine the target solar term type or mark it as a pending solar term type by comparing and analyzing the support coefficients in the third estimated results, providing accurate and reliable information for subsequent solar term-related applications.
[0170] Step S900: According to the solar term type, the material corresponding to the solar term type is retrieved from the preset meteorological knowledge base, and the material is displayed. The chromatogram of the material is a solar term chromatogram that conforms to the solar term type.
[0171] Step S900 is an output and display step. In this step, the computer device retrieves the corresponding materials from the preset meteorological knowledge base according to the target solar term type determined in the previous step, and displays these materials in the solar term color spectrum that conforms to the solar term type.
[0172] First, the preset meteorological knowledge base is a database that integrates rich meteorological information and solar term related materials. This database can contain various forms of materials, such as images, videos, audio, text, etc., which are associated with different solar term types. For example, for the solar term type "Spring Equinox", the knowledge base may contain pictures depicting spring scenes, text or audio introducing Spring Equinox customs, etc.
[0173] After the computer device determines the target solar term type, it searches and retrieves the material corresponding to the solar term type from the meteorological knowledge base. This process is achieved by matching the identifier of the solar term type to ensure that the retrieved material completely corresponds to the target solar term type.
[0174] Next, the computer device displays the retrieved material. During the display process, the computer device adjusts the color of the material according to the solar term color spectrum to which the solar term type belongs. The solar term color spectrum is a set of predefined color schemes, and each solar term type has its corresponding color. For example, "Spring Equinox" may correspond to the green series, "Autumnal Equinox" may correspond to the yellow series, and so on. By applying the color spectrum that matches the solar term type, the computer device can enhance the display effect and enable users to more intuitively feel the atmosphere and characteristics of different solar terms.
[0175] For example, if the target solar term type is "Winter Solstice", the computer device will retrieve materials related to the Winter Solstice from the meteorological knowledge base, such as a picture depicting a snow scene. Then, the computer device will use the blue color spectrum that matches the Winter Solstice solar term type to adjust the color of the picture to make it more consistent with the cold atmosphere of the Winter Solstice. In the end, the user will see a snow scene picture with blue as the main color, so as to feel the characteristics of the Winter Solstice solar term more deeply. By retrieving materials corresponding to the solar term type from the meteorological knowledge base and displaying them in a way that conforms to the solar term color spectrum, the final output and visualization effect of solar term recognition is achieved. This display method not only improves the user experience, but also helps users to understand and feel the traditional Chinese solar term culture more deeply.
[0176] The determination of the color spectrum can be carried out in the following manner. First, four reference colors are set according to the four seasons. For example, the reference color for spring is mulberry green, the reference color for summer is lotus red, the reference color for autumn is tung yellow, and the reference color for winter is sky blue. Then, the color spectrum corresponding to the 24 solar terms is quantitatively developed based on the four seasons' reference colors and climate astronomical data. Specifically, the changes in the concentration of the solar term color spectrum can be set based on the temperature change amplitude of the six solar terms in each season. The temperature distribution of different solar terms and the rhythm of the climate transition can be reflected through the changes in the color spectrum, so as to realize the localization and uniqueness of the solar term color spectrum. In one example, the daily temperature data of the meteorological observation station is used to calculate the historical cycle, such as the cumulative daily average temperature sequence of the past 30 years of the climate period. Based on the astronomical period accurate to the day of the solar term as shown in the following table, the 30-year cumulative solar term period average temperature of the station is calculated.
[0177] Then, the color transparency C of the reference color corresponding to a certain solar term.
[0178] C = 1-|(average temperature of the base solar term-average temperature of the solar term) / temperature variation of the season|
[0179] Among them, in the case of an overall upward trend in temperature or a season with a temperature peak, the reference solar term is the solar term with the highest temperature during the solar term period, such as spring and summer; in the case of an overall downward trend in temperature or a season with a temperature trough, the reference solar term is the solar term with the lowest average temperature during the solar term period, such as autumn and winter. The temperature variation range in this season is the temperature difference between the reference solar term in this season and the last solar term in the previous season.
[0180] In the order of spring, summer, autumn, and winter, the four solar terms based on the Beginning of Spring, Summer, Autumn, and Winter are as follows:
[0181] Spring (Beginning of Spring, Rain Water, Awakening of Insects, Spring Equinox, Pure Brightness, Grain Rain);
[0182] Summer (Beginning of Summer, Lesser Fullness of Grain, Grain in Ear, Summer Solstice, Minor Heat, Major Heat);
[0183] Autumn (Beginning of Autumn, End of Heat, White Dew, Autumn Equinox, Cold Dew, Frost's Descent);
[0184] Winter (Beginning of Winter, Minor Snow, Major Snow, Winter Solstice, Minor Cold, Major Cold).
[0185] Four seasons: Spring (Spr.), Summer (Sum.), Autumn (Fal.), Winter (Win.). A certain solar term in the four seasons is SprN, SumN, FalN, WinN (N = 1, 2, 3, 4, 5, 6 solar terms). The average temperature of a certain solar term in the four seasons is SprNt, SumNt, FalNt, WinNt. The maximum average temperature of the solar terms in the four seasons is Sprtmax, Sumtmax, Faltmax, Wintmax. The minimum average temperature of the solar terms in the four seasons is Sprtmin, Sumtmin, Faltmin, Wintmin. Taking the national weighted average temperature as an example, the chromatographic quantization calculation formula for the solar terms in the four seasons is:
[0186] Color transparency of spring solar terms:
[0187] Transparency of the Nth solar term = 1 - |(Sprtmax - SprNt) / (Sprtmax - Win6t)|
[0188] Color transparency of summer solar terms:
[0189] Transparency of the Nth solar term = 1 - |(Sumtmax - SumNt) / (Sumtmax - Spr6t)|
[0190] Color transparency of autumn solar terms:
[0191] Transparency of the Nth solar term = 1 - |(Faltmin - FalNt) / (Faltmin - Sum6t)|
[0192] Color transparency of winter solar terms:
[0193] The transparency of the Nth solar term = 1 - |(Wintmin - WinNt) / (Wintmin - Fal6t)|
[0194] In other embodiments, the solar term chromatogram can be developed quantitatively based on the astronomical data of solar terms. Specifically, the chromatogram transparency of the Ith solar term among the twenty-four solar terms is
[0195] where LAT i is the average latitude of the Ith solar term period (i = 1, 2... 24), LAT max is the maximum value of the average latitudes of the twenty-four solar term periods, and LAT min is the minimum value of the average latitudes of the twenty-four solar term periods.
[0196] It can also be calculated based on dividing each season into a system according to the Beginning of Spring, Summer, Autumn, and Winter:
[0197] The transparent color of the Ith solar term in spring and summer
[0198] The transparent color of the Ith solar term in autumn and winter
[0199] where LAT i is the average latitude of the Ith solar term period in a certain season (i = 1, 2, 3, 4, 5, 6), LAT max is the maximum value of the average latitudes of the 6 solar term periods in this season, LAT min is the minimum value of the average latitudes of the 6 solar term periods in this season, and LAT 6(i-1) is the average latitude value of the 6th solar term in the previous season.
[0200] Using the date, the latitude LAT of the direct solar point on the nth day is deduced by segmenting according to the Spring Equinox, Summer Solstice, Autumn Equinox, and Winter Solstice n The calculation formula is as follows:
[0201] From the Spring Equinox (March 21st, the number sequence n is recorded as 0) to the Autumn Equinox (September 23rd, the number sequence n is recorded as 186), the sun moves φ longitudes in n days.
[0202]
[0203] LAT n = arcsin[sin23°26′21″ * sinφ]
[0204] From the Autumn Equinox (September 23rd, the number sequence n is recorded as 186) to the Winter Solstice (December 22nd, the number sequence n is recorded as 276), the sun moves φ longitudes in n days.
[0205]
[0206] LAT n =-arsin[sin23°26′21″*sinφ]
[0207] From the winter solstice (December 22, day number sequence n is 276) to the vernal equinox of the following year (March 22, day number sequence n is 365), the sun moves through φ longitude in n days.
[0208]
[0209] LAT n =-arsin[sin23°26′21″*sinφ]
[0210] That is
[0211] Through the above chromatographic determination scheme, combined with cultural, phenological, climatic and astronomical factors, a chromatographic system that can reflect the characteristics and rhythm of the 24 solar terms is created. It has both local characteristics (because specific climate data is taken into account) and universality (because astronomical data is taken into account).
[0212] It should be noted that, in the embodiment of the present application, if the above-mentioned chromatogram visualization interaction method based on solar term climate feature matching is implemented in the form of a software function module, and when it is sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0213] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0214] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.
[0215] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0216] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.
[0217] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.
[0218] Figure 2 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the hardware entity of the computer device 1000 includes: a processor 1001 and a memory 1002, wherein the memory 1002 stores a computer program that can be run on the processor 1001, and the processor 1001 implements the steps in the method of any of the above embodiments when executing the program.
[0219] The memory 1002 stores computer programs that can be run on the processor. The memory 1002 is configured to store instructions and applications executable by the processor 1001. It can also cache data to be processed or processed by the processor 1001 and various modules in the computer device 1000 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0220] When the processor 1001 executes the program, the steps of any of the above-mentioned color spectrum visualization interaction methods based on solar term climate feature matching are implemented. The processor 1001 generally controls the overall operation of the computer device 1000.
[0221] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the chromatographic visualization interaction method based on solar term climate feature matching as in any of the above embodiments.
[0222] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For the technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding. The above processor can be at least one of a target application integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD), a programmable logic device (Programmable Logic Device, PLD), a field programmable gate array (Field Programmable Gate Array, FPGA), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, and a microprocessor. It can be understood that the electronic device that realizes the above processor function can also be other, and the embodiments of the present application are not specifically limited.
[0223] The above-mentioned computer storage medium / 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 flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0224] It should be understood that the "one embodiment" or "one embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in one embodiment" appearing in various places throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence number of the embodiment of the present application is only for description and does not represent the advantages and disadvantages of the embodiment. It should be noted that, in this article, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0225] In the several embodiments provided in the present application, it should be understood that the disclosed devices 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.
[0226] 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; 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 present embodiment.
[0227] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate 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.
[0228] 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), magnetic disks or optical disks, etc., various media that can store program codes.
[0229] Alternatively, if the above-mentioned integrated unit of the present application 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 present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of 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 application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0230] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A chromatogram visualization interactive method based on solar term climate feature matching, characterized in that: The method comprises: Acquire a training sample set; the training sample set includes multiple groups of first text samples and multiple groups of second text samples, wherein each group of the first text samples includes a solar term description text sample corresponding to a user interaction text of a preset solar term type, and each group of the second text samples includes the solar term description text sample corresponding to the remaining user interaction text other than the preset solar term type; The first text sample is passed into the solar term recognition algorithm for iterative optimization to obtain an optimized first optimization cost; wherein the solar term recognition algorithm is a text recognition model; The second text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the second text sample is estimated according to the solar term recognition algorithm to obtain a first estimation result; the first estimation result includes a first support coefficient corresponding to each of the preset solar term types of the estimated detection item sample by the solar term recognition algorithm; Obtaining an optimized second optimization cost value through the first support coefficient and a preset type support coefficient threshold; Modifying the algorithm parameters of the solar term recognition algorithm by using the first optimization cost value and the second optimization cost value to obtain an optimized solar term recognition algorithm; Get the target user interaction text containing the solar term description text; The target user interaction text is passed into the optimized solar term recognition algorithm, and the solar term type corresponding to the solar term description text in the target user interaction text is estimated according to the solar term recognition algorithm to obtain a third estimation result; The third estimation result includes the third support coefficient of the solar term description text for executing each of the preset solar term types estimated by the solar term identification algorithm; Determining the target solar term type corresponding to the solar term description text through the third estimation result; According to the solar term type, in a preset meteorological knowledge base, materials corresponding to the solar term type are retrieved and displayed, and the chromatogram of the material is a solar term chromatogram that conforms to the solar term type.
2. The chromatogram visualization interactive method based on solar term climate feature matching according to claim 1 is characterized in that: The training sample set also includes a sample tag corresponding to the first text sample, and the sample tag is used to indicate the true type of the solar term type corresponding to the solar term description text sample in the first text sample; The step of transferring the first text sample into the solar term recognition algorithm for iterative optimization to obtain an optimized first optimization cost value includes: The first text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the first text sample is estimated according to the solar term recognition algorithm to obtain a second estimation result; the second estimation result includes the second support coefficient of the detection item sample estimated by the solar term recognition algorithm to correspond to each of the preset solar term types; An optimized first optimization cost value is obtained through the sample label and the second estimation result.
3. The chromatogram visualization interactive method based on solar term climate feature matching according to claim 2 is characterized in that: The solar term recognition algorithm includes a first implicit algorithm component and a second implicit algorithm component; the first text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the first text sample is estimated according to the solar term recognition algorithm to obtain a second estimation result, including: The first text sample is passed into the first implicit algorithm component, and knowledge representation is extracted from the first text sample according to the first implicit algorithm component to obtain a first knowledge representation; The first knowledge representation is passed into the second implicit algorithm component, and the second implicit algorithm component performs an inner product operation on the first knowledge representation according to the classification representative eccentricity factor to obtain a knowledge vector Vector1, wherein the classification representative eccentricity factor includes a plurality of classification representative eccentricity vectors, each of the classification representative eccentricity vectors is mapped one-to-one with one of the preset solar term types, and the number of elements of the knowledge vector Vector1 is the same as the number of the preset solar term types; The knowledge vector Vector1 is normalized according to a normalization algorithm to obtain a knowledge vector Vector2, and the knowledge vector Vector2 is used as a second estimation result. The vector unit in the knowledge vector Vector2 represents the second support coefficient estimated by the solar term recognition algorithm that the detection item sample corresponds to the corresponding preset solar term type.
4. The chromatogram visualization interactive method based on solar term climate feature matching according to claim 3 is characterized in that: The step of obtaining an optimized first optimization cost value by using the sample label and the second estimation result includes: Determine a corresponding first eccentricity adjustment vector from the classification representative eccentricity vectors according to the true type of the solar term type in the sample mark, and use the classification representative eccentricity vectors other than the first eccentricity adjustment vector in the classification representative eccentricity vectors as second eccentricity adjustment vectors; Obtaining a first commonality measurement result between the first knowledge representation and the first eccentricity adjustment vector, and obtaining a second commonality measurement result between the first knowledge representation and each of the second eccentricity adjustment vectors; Obtaining a difference between the first commonality measurement result and a preset critical commonality measurement result to obtain a difference value D-value1; Obtain an optimized first optimization cost value through the difference D-value1 and each of the second commonality measurement results; wherein the difference D-value1 is negatively correlated with the first optimization cost value, and the second commonality measurement result is positively correlated with the first optimization cost value; The normalization operation is performed on the knowledge vector Vector1 according to the normalization algorithm to obtain the knowledge vector Vector2, including: obtaining predetermined scaling parameters; Adjusting the knowledge vector Vector1 according to the ratio adjustment parameter to obtain the knowledge vector Vector3; The knowledge vector Vector3 is normalized according to a normalization algorithm to obtain a knowledge vector Vector2.
5. The chromatogram visualization interaction method based on solar term climate feature matching according to claim 1 is characterized in that: The solar term recognition algorithm includes a first implicit algorithm component and a second implicit algorithm component; the second text sample is passed into the solar term recognition algorithm, and the solar term type corresponding to the solar term description text sample in the second text sample is estimated according to the solar term recognition algorithm to obtain a first estimation result, including: The second text sample is passed into the first implicit algorithm component, and knowledge representation is extracted from the second text sample according to the first implicit algorithm component to obtain a second knowledge representation; The second knowledge representation is passed into the second implicit algorithm component, and the second implicit algorithm component performs an inner product operation on the second knowledge representation according to the classification representative eccentricity factor to obtain a knowledge vector Vector4; wherein the classification representative eccentricity factor includes a plurality of classification representative eccentricity vectors, each of the classification representative eccentricity vectors is mapped one-to-one with one of the preset solar term types, and the number of elements of the knowledge vector Vector4 is the same as the number of the preset solar term types; The knowledge vector Vector4 is normalized according to a normalization algorithm to obtain a knowledge vector Vector5, and the knowledge vector Vector5 is used as a first estimation result. The vector unit in the knowledge vector Vector5 represents the first support coefficient estimated by the solar term recognition algorithm that the detection item sample corresponds to the corresponding preset solar term type.
6. The color spectrum visualization interactive method based on solar term climate feature matching according to claim 5 is characterized in that: The step of obtaining the optimized second optimized cost value comprises: Determining a third commonality measure result between the second knowledge representation and each of the classification representative eccentricity vectors; Determining a critical commonality measurement result by using the type support coefficient threshold; Determine the maximum difference between the third commonality measurement result and the critical commonality measurement result to obtain a difference value D-value3; An optimized second optimization cost value is obtained through the difference D-value3; wherein the difference D-value3 and the second optimization cost value are positively correlated.
7. The color spectrum visualization interactive method based on solar term climate feature matching according to claim 1 is characterized in that: The step of obtaining an optimized second optimization cost value by using the first support coefficient and a preset type support coefficient threshold comprises: Obtain the difference between the first support coefficient corresponding to each of the preset solar term types and the type support coefficient threshold, and obtain the difference value D-value2 corresponding to each of the preset solar term types; When the difference D-value2 is greater than zero, comparing the sizes of the difference D-value2, the second optimization cost value is determined by the largest difference D-value2; or when none of the difference D-value2 is greater than 0, the value of the second optimization cost value is determined to be 0; The method of modifying the algorithm parameters of the solar term recognition algorithm by using the first optimization cost value and the second optimization cost value to obtain an optimized solar term recognition algorithm includes: Determining a first number of the first text samples and a second number of the second text samples in the training sample set; Determine a first eccentricity factor corresponding to the first optimized cost value by using the first quantity, and determine a second eccentricity factor corresponding to the second optimized cost value by using the second quantity; Integrating the first optimization cost value and the second optimization cost value by using the first eccentricity factor and the second eccentricity factor to obtain an integrated optimization cost value; By means of the integrated optimization cost value, the algorithm parameters of the solar term recognition algorithm are corrected to obtain an optimized solar term recognition algorithm.
8. The color spectrum visualization interactive method based on solar term climate feature matching according to claim 1 is characterized in that: The step of obtaining the target user interaction text including the solar term description text includes: Get the original user interaction text; Performing solar term description text detection on the original user interaction text to obtain a text window containing the solar term description text; The original user interaction text is framed and selected through the text window to obtain the target user interaction text.
9. The color spectrum visualization interactive method based on solar term climate feature matching according to claim 8 is characterized in that: The step of performing solar term description text detection on the original user interaction text to obtain a text window containing the solar term description text; and selecting the original user interaction text through the text window to obtain the target user interaction text includes: Performing solar term description text detection on each section of the original user interaction text to obtain an initial text window corresponding to each section of the original user interaction text; Classifying the obtained original user interaction text into a text sequence; Obtaining the number of text paragraphs in the current text sequence, and when the number of text paragraphs is not less than a preset number of paragraphs, extracting M original user interaction texts from the text sequence based on a preset paragraph interval to obtain an interaction text set; The initial text window corresponding to the original user interaction text centered in the current text sequence is used as the target text window, and each of the original user interaction texts in the interactive text set is framed and selected through the target text window to obtain the target user interaction text.
10. The color spectrum visualization interactive method based on solar term climate feature matching according to claim 1 is characterized in that: Determining the target solar term type corresponding to the solar term description text according to the third estimation result includes: Comparing the third support coefficient corresponding to each of the preset solar term types with the preset type support coefficient threshold; When a third support coefficient greater than the type support coefficient threshold is included, comparing the sizes of the third support coefficients, the target solar term type is determined by the preset solar term type corresponding to the largest third support coefficient; When the third support coefficients are not greater than the type support coefficient threshold, the target solar term type is determined to be a pending solar term type.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps in the method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Knowledge extraction method and device, electronic equipment and storage medium
CN111639498A
Industrial knowledge graph construction method, computer equipment and storage medium
CN117851605A