Text vocabulary recommendation method, system and equipment and medium
By building the user's vocabulary semantic map and pre-trained language model, the personalization and accuracy problems of vocabulary learning in the existing technology are solved, and more efficient personalized text vocabulary generation is achieved, which improves the user's learning effect.
Patent Information
- Application Number
- CN202510555427.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-19
AI Technical Summary
The prior art is difficult to achieve personalization and low accuracy in vocabulary learning scenarios, resulting in poor user learning efficiency and experience.
By constructing a user's vocabulary semantic map, based on the user's historical input content and personalized feature information, co-occurrence matrix and vocabulary vector analysis are performed, context expansion information is generated, and personalized text vocabulary is generated in combination with the pre-trained language model.
It improves the personalization and accuracy of text vocabulary generation, and improves users' learning efficiency and learning experience.
Smart Images

Figure CN120508633A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a method, system, device and medium for recommending text vocabulary. Background Art
[0002] In the educational scenario of vocabulary learning, with the widespread application of large language models, using large language models to generate learning vocabulary required by users has become one of the key focuses of education practitioners.
[0003] At present, related technologies usually directly connect large language models with knowledge bases, and after users put forward learning needs, the large language model calls the knowledge base to generate vocabulary for users to memorize and learn. However, due to individual differences in vocabulary mastery levels among different users, this method is often difficult to apply to detailed vocabulary learning scenarios. The text vocabulary generated by it cannot well meet the user's vocabulary learning needs, the degree of personalization and accuracy are low, and the user's learning efficiency and learning experience are poor.
[0004] Therefore, the problems existing in related technologies still need to be solved and optimized urgently. Summary of the Invention
[0005] The purpose of the present invention is to solve one of the technical problems existing in the related art to at least a certain extent.
[0006] To this end, an object of an embodiment of the present invention is to provide a method, system, device and medium for recommending text vocabulary, wherein the method can effectively improve the personalization and accuracy of text vocabulary generation, which is conducive to improving the user's learning efficiency and learning experience.
[0007] In order to achieve the above technical objectives, the technical solutions adopted in the embodiments of the present application include:
[0008] In a first aspect, an embodiment of the present application provides a method for recommending text vocabulary, comprising:
[0009] Obtaining a first text input content of a user and a lexical semantic map of the user;
[0010] Performing text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information;
[0011] Performing context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph to obtain context expansion information corresponding to the first text input content;
[0012] Inputting the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text, obtain target vocabulary, and provide the target vocabulary to the user;
[0013] The lexical semantic graph is a knowledge graph constructed based on a plurality of second text input contents, and the second text input contents are the first text input contents previously provided by the user.
[0014] In addition, the method according to the above embodiment of the present application may also have the following additional technical features:
[0015] Furthermore, in one embodiment of the present application, obtaining the user's lexical semantic graph includes:
[0016] Acquire a text dataset and a plurality of second text input contents of the user, wherein the text dataset records a plurality of vocabulary texts;
[0017] Performing personality characteristic analysis on all second text input contents to obtain personality characteristic information;
[0018] Based on the personality feature information, a co-occurrence frequency analysis is performed on the text data set to obtain a text vocabulary co-occurrence matrix, a vocabulary vector set, and a vocabulary semantic space model, wherein the vocabulary vector set records a plurality of word vectors, each of which is used to indicate a semantic similarity relationship between two corresponding vocabulary texts;
[0019] The lexical semantic graph is constructed based on the text word co-occurrence matrix, the word vector set and the lexical semantic space model.
[0020] Furthermore, in one embodiment of the present application, the text dataset is subjected to co-occurrence frequency analysis based on the personality feature information to obtain a text vocabulary co-occurrence matrix, a vocabulary vector set and a vocabulary semantic space model, including
[0021] performing a co-occurrence analysis on the text dataset based on the personality characteristic information to obtain a co-occurrence matrix, wherein the co-occurrence matrix includes a plurality of matrix elements, each matrix element being used to indicate a frequency of co-occurrence of a plurality of corresponding text words in the text dataset;
[0022] Performing vector analysis on the text dataset according to the co-occurrence matrix to obtain the vocabulary vector set;
[0023] According to the vocabulary vector set, a spatial dimension reduction construction process is performed to obtain the vocabulary semantic space model.
[0024] Furthermore, in one embodiment of the present application, performing co-occurrence analysis on the text dataset based on the personality feature information to obtain a co-occurrence matrix includes:
[0025] Get the preset sliding window;
[0026] Dynamically adjusting the size of the sliding window according to the personality characteristic information to obtain an updated sliding window;
[0027] According to the updated sliding window, word co-occurrence sliding statistics are performed on the text data set to obtain the co-occurrence matrix.
[0028] Furthermore, in one embodiment of the present application, the performing of text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information includes:
[0029] Performing text division on the first text input content to obtain a plurality of third text input contents;
[0030] Inputting all the third text input contents into the emotion recognition model for emotion recognition, and obtaining text emotion information output by the emotion recognition model;
[0031] Semantic understanding and keyword extraction are performed on all the third text input contents to obtain the text context information and the target keywords.
[0032] Furthermore, in one embodiment of the present application, performing context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph to obtain context extension information corresponding to the first text input content includes:
[0033] Performing text vectorization on the target keyword and the text context information to obtain a text query vector;
[0034] Performing a vector query on the lexical semantic graph according to the text query vector to obtain a graph key-value vector corresponding to the text query vector;
[0035] Attention knowledge extraction is performed on the lexical semantic graph according to the text query vector and the graph key-value vector to obtain the context extension information.
[0036] Furthermore, in one embodiment of the present application, the step of inputting the text emotion information, the context expansion information, and the first text input content into a pre-trained language model for text generation to obtain a target vocabulary includes:
[0037] Get the preset prompt template;
[0038] According to the prompt template, the text emotion information, the context extension information and the first text input content are processed to construct a prompt to obtain a target prompt;
[0039] The target prompt is input into the pre-trained language model to obtain the target vocabulary output by the pre-trained language model.
[0040] In a second aspect, an embodiment of the present application provides a text vocabulary recommendation system, comprising:
[0041] A first processing unit is configured to obtain a first text input content of a user and a lexical semantic map of the user;
[0042] A second processing unit is configured to perform text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information;
[0043] a third processing unit, configured to perform context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph, to obtain context extension information corresponding to the first text input content;
[0044] a fourth processing unit, configured to input the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text, obtain target vocabulary, and provide the target vocabulary to the user;
[0045] The lexical semantic graph is a knowledge graph constructed based on a plurality of second text input contents, and the second text input contents are the first text input contents previously provided by the user.
[0046] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0047] at least one processor;
[0048] at least one memory for storing at least one program;
[0049] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0050] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a program executable by a processor, and the program executable by the processor is used to implement the above method when executed by the processor.
[0051] The advantages and benefits of this application will be partially given in the following description, and partially become apparent from the following description, or learned through practice of this application:
[0052] The present application discloses a method, system, device, and medium for recommending text vocabulary, wherein the recommendation method obtains a user's first text input content and the user's lexical semantic graph; performs text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information; performs context matching and knowledge query processing on the target keywords and the text context information based on the lexical semantic graph to obtain context extension information corresponding to the first text input content; inputs the text sentiment information, the context extension information, and the first text input content into a pre-trained language model for text generation to obtain a target vocabulary, and provides the target vocabulary to the user; wherein the lexical semantic graph is a knowledge graph constructed based on several second text input contents, and the second text input content is the first text input content previously provided by the user. The method obtains context extension information through the lexical semantic graph constructed from the first text input content previously provided by the user, and generates text vocabulary based on the context extension information and the user's current first text input content, which can effectively improve the personalization and accuracy of text vocabulary generation, and is conducive to improving the user's learning efficiency and learning experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly expressing some embodiments of the technical solutions of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative work.
[0054] Figure 1 A flowchart of a method for recommending text vocabulary provided in an embodiment of the present application;
[0055] Figure 2 A schematic diagram of the structural framework of a text vocabulary recommendation system provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present application. For the step numbers in the following embodiments, they are provided only for the convenience of explanation and are not intended to limit the order of the steps. The order of execution of the steps in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0059] Currently, related technologies usually directly connect large language models with knowledge bases. After users raise learning needs, the large language model calls on the knowledge base to generate vocabulary for users to memorize and learn. This method is often difficult to apply to detailed vocabulary learning scenarios. Specifically, since this method usually uses a large language model to generate vocabulary through a pre-set fixed process, it often lacks deep integration of contextual information and has low accuracy. In addition, due to individual differences in vocabulary mastery levels among different users, this method is prone to situations where the generated words are inconsistent with the user's vocabulary mastery level, which cannot effectively meet the vocabulary learning needs of each user. In terms of personalization, the user's learning efficiency and learning experience are poor.
[0060] It should be noted that the above-mentioned related technologies are only used to assist in understanding the technical solutions of this application and do not mean that they belong to the disclosed prior art.
[0061] In view of this, an embodiment of the present invention provides a method, system, device and medium for recommending text vocabulary, wherein the recommendation method first constructs a vocabulary semantic map based on the first text input content previously provided by the user, and specifically constructs a vocabulary semantic map through a co-occurrence matrix, a vocabulary vector set and the user's personality feature information. The vocabulary semantic map is a personalized knowledge map corresponding to the vocabulary mastery level of the corresponding user. The context expansion information determined based on the vocabulary semantic map can more fully consider the context information, so that the large language model can more accurately meet the user's vocabulary learning needs. The subsequently generated text vocabulary is more personalized and accurate, which is conducive to improving the user's learning efficiency and learning experience.
[0062] Reference Figure 1 In an embodiment of the present application, a method for recommending text vocabulary includes:
[0063] Step 110: Obtain the user's first text input content and the user's lexical semantic map;
[0064] In an embodiment of the present application, the user's first text input content can be the user's current natural language input, and the natural language input can be any one of a question raised by the user, a request to query a certain text vocabulary, or feedback on learning content. In an embodiment of the present application, the user's first text input content is taken as an example as a request for the user to query a certain text vocabulary.
[0065] It can be understood that the user's lexical semantic graph can be a personalized knowledge graph corresponding to the user. In the first embodiment, it can be constructed based on several first text input contents provided by the user's history; or, in the second embodiment, it can be constructed based on several first text input contents provided by the user's history, and the user's historical learning data. The historical learning data can specifically be the data when the user learns historical target vocabulary, such as the average vocabulary learning speed when the user learns historical target vocabulary, the average vocabulary accuracy when the user learns historical target vocabulary, the user's forgetting rate of learned historical target vocabulary, etc. The examples in this application are for illustration only and do not limit this application.
[0066] In some embodiments, obtaining the user's lexical semantic graph includes:
[0067] Acquire a text dataset and a plurality of second text input contents of the user, wherein the text dataset records a plurality of vocabulary texts;
[0068] Performing personality characteristic analysis on all second text input contents to obtain personality characteristic information;
[0069] In an embodiment of the present application, a text dataset may be a collection of text vocabularies in a specific field. The text dataset may be publicly available text vocabulary data on the internet, obtained after data cleaning and preprocessing. Specifically, the preprocessing may include text format normalization, irrelevant content removal, word segmentation and magnetic annotation, stop word filtering, and other operations. The user's second text input content may be all the first text input content previously provided by the user, or all the first text input content provided by the user in the most recent period, and this application does not impose any restrictions on this.
[0070] It is understandable that in the first embodiment, the personality feature analysis process can first measure at least one of the lexical density, syntactic complexity and lexical diversity of each second text input content through natural language processing (NLP) technology, and then calculate the contextual complexity of each second text input content based on the lexical density, syntactic complexity and lexical diversity of each second text input content. The specific calculation method of the contextual complexity can be weighted average or weighted summation, etc., and the examples in this application are only for illustration. Then, based on the contextual complexity of each second text input content, the personality feature information is determined. There are many ways to determine the specific personality feature information. For example, the mathematical method can be to calculate the contextual complexity of all second text input contents through weighted average or weighted summation, and determine the calculation result as the personality feature information; or the rule-based method can be to pre-set a rule table and, based on the mapping relationship, determine the personality feature rule corresponding to the most contextual complexity as the personality feature information.
[0071] In the second embodiment, after obtaining the contextual complexity of each second text input content respectively, the personality characteristic analysis processing can also obtain the historical learning data of the corresponding user, and determine the personality characteristic information by integrating the contextual complexity and historical learning data of all second text input contents. The specific method of determining the personality characteristic information is similar to that of the aforementioned first embodiment, and can be simply deduced by analogy, so this application will not go into details here.
[0072] Based on the personality feature information, a co-occurrence frequency analysis is performed on the text data set to obtain a text vocabulary co-occurrence matrix, a vocabulary vector set, and a vocabulary semantic space model, wherein the vocabulary vector set records a plurality of word vectors, each of which is used to indicate a semantic similarity relationship between two corresponding vocabulary texts;
[0073] Furthermore, the text dataset is subjected to co-occurrence frequency analysis based on the personality feature information to obtain a text vocabulary co-occurrence matrix, a vocabulary vector set and a vocabulary semantic space model, including
[0074] performing a co-occurrence analysis on the text dataset based on the personality characteristic information to obtain a co-occurrence matrix, wherein the co-occurrence matrix includes a plurality of matrix elements, each matrix element being used to indicate a frequency of co-occurrence of a plurality of corresponding text words in the text dataset;
[0075] Furthermore, the co-occurrence analysis is performed on the text dataset based on the personality feature information to obtain a co-occurrence matrix, including:
[0076] Get the preset sliding window;
[0077] Dynamically adjusting the size of the sliding window according to the personality characteristic information to obtain an updated sliding window;
[0078] According to the updated sliding window, word co-occurrence sliding statistics are performed on the text data set to obtain the co-occurrence matrix.
[0079] In an embodiment of the present application, all text words in a text data set can be statistically analyzed using personality feature information to extract the co-occurrence relationships between the individual text words, and then a co-occurrence matrix is constructed based on the co-occurrence relationships between all text words, which includes several matrix elements.
[0080] It is understood that co-occurrence analysis can be performed by obtaining a pre-set sliding window and then adjusting the size of the sliding window based on the individual characteristic information to obtain an updated sliding window. Specifically, if the individual characteristic information is determined solely by context complexity, and if the individual characteristic information is determined mathematically, the larger the value of the individual characteristic information, the larger the size of the updated sliding window; conversely, the smaller the value of the individual characteristic information, the smaller the size of the updated sliding window. Alternatively, if the individual characteristic information is determined based on a rule, the sliding window can be adjusted based on the corresponding individual characteristic rule.
[0081] It should be noted that after obtaining the updated sliding window, the updated sliding window can be used to count the frequencies of co-occurrence of each word in the text dataset, thereby obtaining a co-occurrence matrix. Specifically, for a certain matrix element in the co-occurrence matrix, if the text vocabulary corresponding to the matrix element is the first text vocabulary and the second text vocabulary, the sliding window can be used to slide in the array or matrix corresponding to the text dataset based on the sliding step size, and the frequencies of the first text vocabulary and the second text vocabulary co-appearing in the updated sliding window can be counted to obtain the matrix elements corresponding to the first text vocabulary and the second text vocabulary. The same applies to the remaining matrix elements, which can be simply deduced by analogy.
[0082] Performing vector analysis on the text dataset according to the co-occurrence matrix to obtain the vocabulary vector set;
[0083] According to the vocabulary vector set, a spatial dimension reduction construction process is performed to obtain the vocabulary semantic space model.
[0084] In an embodiment of the present application, based on the co-occurrence matrix, the vector representation of each text word in the text dataset in a high-dimensional space can be learned through a word vector model (such as a Word2Vec model or a Glove model) to obtain a vector representation of each word, which is recorded as a word vector; then, a word vector set is obtained based on all the obtained word vectors.
[0085] It is understood that after obtaining the vocabulary vector set, a vocabulary semantic space model can be constructed based on the high-dimensional vocabulary vector set. Specifically, the high-dimensional word vectors in the vocabulary vector set can be mapped to a low-dimensional semantic space (such as a two-dimensional semantic space or a three-dimensional semantic space) by using principal component analysis (PCA) or t-SNE dimensionality reduction algorithm to obtain a vocabulary semantic space model.
[0086] The lexical semantic graph is constructed based on the text word co-occurrence matrix, the word vector set and the lexical semantic space model.
[0087] In an embodiment of the present application, a user-adaptive lexical semantic graph can be generated based on a lexical semantic space model. Specifically, each low-dimensional word vector and the corresponding text word in the low-dimensional semantic space of the lexical semantic space model can be extracted as a graph node in the knowledge graph; and based on all matrix elements in the co-occurrence matrix and the semantic similarity calculated based on the lexical vector set, graph edges are established between related graph nodes, and each graph edge is assigned a certain weight or strength value. The weight or strength value is used to indicate that two text words have a closer semantic association or a more frequent co-occurrence number in the text dataset, thereby obtaining a lexical semantic graph.
[0088] Step 120: performing text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information;
[0089] In an embodiment of the present application, text parsing can be based on natural language processing (NLP) technology to extract target keywords, text context information and text sentiment information from the first text input content provided by the user, wherein the text context information is multi-dimensional background information used to assist semantic inference, and the multi-dimensional background information may include context information, domain scenarios, etc. of the current first text input content; and the text sentiment information is used to characterize the user's current emotional state when the user proposes the first text input content.
[0090] In some embodiments, performing text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information includes:
[0091] Performing text division on the first text input content to obtain a plurality of third text input contents;
[0092] Inputting all the third text input contents into the emotion recognition model for emotion recognition, and obtaining text emotion information output by the emotion recognition model;
[0093] Semantic understanding and keyword extraction are performed on all the third text input contents to obtain the text context information and the target keywords.
[0094] In an embodiment of the present application, since the first text input content provided by the user may be of a long length, text segmentation can be to perform syntactic analysis on the first text input content to obtain several short sentences, each short sentence being recorded as a third text input content; then all the third text input contents are input into the emotion recognition model, which can specifically be at least one of the VADER emotion analyzer, HanLP emotion analyzer, etc., to obtain text emotion information; and, through NLP technology, keyword extraction and semantic understanding are performed on all the third text input contents to obtain text context information and target keywords.
[0095] Step 130: performing context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph to obtain context expansion information corresponding to the first text input content;
[0096] In an embodiment of the present application, based on target keywords and text context information, context extension information corresponding to the first text input content can be obtained by matching queries from the lexical semantic graph.
[0097] In some embodiments, performing context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph to obtain context extension information corresponding to the first text input content includes:
[0098] Performing text vectorization on the target keyword and the text context information to obtain a text query vector;
[0099] Performing a vector query on the lexical semantic graph according to the text query vector to obtain a graph key-value vector corresponding to the text query vector;
[0100] Attention knowledge extraction is performed on the lexical semantic graph according to the text query vector and the graph key-value vector to obtain the context extension information.
[0101] In an embodiment of the present application, the target keywords and text context information can first be converted into vector form to obtain a text query vector; then, based on the text query vector, the vectors of several graph nodes with a high degree of relevance are retrieved from the lexical semantic graph, and the vector of each graph node is recorded as a graph key-value vector, which can specifically include a key vector and a value vector; then, through the attention mechanism, the attention weight between the text query vector and the graph key-value vector is calculated, and the calculated attention weight is applied to the value vector in the graph key-value vector to generate a context-enhanced information representation, which is recorded as context extension information.
[0102] Step 140: Input the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text, obtain target vocabulary, and provide the target vocabulary to the user;
[0103] In an embodiment of the present application, after obtaining text sentiment information, context expansion information and the first text input content, a target vocabulary can be generated through a pre-trained language model. The pre-trained language model can specifically be a large language model (LLM), and after obtaining the target vocabulary, the target vocabulary can be recommended to the user.
[0104] In some embodiments, inputting the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text to obtain a target vocabulary includes:
[0105] Get the preset prompt template;
[0106] According to the prompt template, the text emotion information, the context extension information and the first text input content are processed to construct a prompt to obtain a target prompt;
[0107] The target prompt is input into the pre-trained language model to obtain the target vocabulary output by the pre-trained language model.
[0108] In an embodiment of the present application, text emotion information, context extension information and the first text input content can be added to a pre-built prompt template. There are many specific implementation methods of the prompt template, which will not be repeated in this application, so as to obtain a target prompt; then, the target prompt is input into the pre-trained language model, and the target prompt instructs the pre-trained language model to generate a target vocabulary adapted to the user's first text input content based on the text emotion information and context extension information.
[0109] A text vocabulary recommendation system proposed according to an embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0110] Reference Figure 2 , a text vocabulary recommendation system proposed in an embodiment of the present application includes:
[0111] The first processing unit 101 is configured to obtain a first text input content of a user and a lexical semantic graph of the user;
[0112] The second processing unit 102 is configured to perform text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information;
[0113] The third processing unit 103 is configured to perform context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph to obtain context expansion information corresponding to the first text input content;
[0114] a fourth processing unit 104, configured to input the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text, obtain target vocabulary, and provide the target vocabulary to the user;
[0115] The lexical semantic graph is a knowledge graph constructed based on a plurality of second text input contents, and the second text input contents are the first text input contents previously provided by the user.
[0116] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0117] Reference Figure 3 , an embodiment of the present application further provides an electronic device, including:
[0118] at least one processor 201;
[0119] At least one memory 202, configured to store at least one program;
[0120] When the at least one program is executed by the at least one processor 201 , the at least one processor 201 implements the above method embodiment.
[0121] Similarly, it can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0122] An embodiment of the present application further provides a computer-readable storage medium, in which a program executable by the processor 201 is stored. The program executable by the processor 201 is used to implement the above-mentioned method embodiment when executed by the processor 201.
[0123] Similarly, the contents of the above method embodiments are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0124] In some optional embodiments, the functions / operations mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, the two boxes shown in succession may actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiments presented and described in the flow chart of the present application are provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logic flows presented herein. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.
[0125] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present application. More specifically, given the properties, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the module will be understood within the routine skills of an engineer. Therefore, a person skilled in the art can implement the present application as set forth in the claims using ordinary techniques without undue experimentation. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the appended claims and their equivalents.
[0126] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0127] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0128] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0129] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0130] In the above description of this specification, reference to the terms "one embodiment / example," "another embodiment / example," or "certain embodiments / examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples.
[0131] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and intent of the present application, and that the scope of the present application is defined by the claims and their equivalents.
[0132] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present application, and these equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A method for recommending text vocabulary, characterized in that: include: Obtaining a first text input content of a user and a lexical semantic map of the user; Performing text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information; Performing context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph to obtain context expansion information corresponding to the first text input content; Inputting the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text, obtain target vocabulary, and provide the target vocabulary to the user; The lexical semantic graph is a knowledge graph constructed based on a plurality of second text input contents, and the second text input contents are the first text input contents previously provided by the user.
2. The method according to claim 1, characterized in that The obtaining of the user's lexical semantic graph includes: Acquire a text dataset and a plurality of second text input contents of the user, wherein the text dataset records a plurality of vocabulary texts; Performing personality characteristic analysis on all second text input contents to obtain personality characteristic information; Based on the personality feature information, a co-occurrence frequency analysis is performed on the text data set to obtain a text vocabulary co-occurrence matrix, a vocabulary vector set, and a vocabulary semantic space model, wherein the vocabulary vector set records a plurality of word vectors, each of which is used to indicate a semantic similarity relationship between two corresponding vocabulary texts; The lexical semantic graph is constructed based on the text word co-occurrence matrix, the word vector set and the lexical semantic space model.
3. The method according to claim 2, characterized in that The text data set is subjected to co-occurrence frequency analysis based on the personality feature information to obtain a text word co-occurrence matrix, a word vector set and a word semantic space model, including performing a co-occurrence analysis on the text dataset based on the personality characteristic information to obtain a co-occurrence matrix, wherein the co-occurrence matrix includes a plurality of matrix elements, each matrix element being used to indicate a frequency of co-occurrence of a plurality of corresponding text words in the text dataset; Performing vector analysis on the text dataset according to the co-occurrence matrix to obtain the vocabulary vector set; According to the vocabulary vector set, a spatial dimension reduction construction process is performed to obtain the vocabulary semantic space model.
4. The method according to claim 3, characterized in that The co-occurrence analysis of the text dataset is performed based on the personality characteristic information to obtain a co-occurrence matrix, including: Get the preset sliding window; Dynamically adjusting the size of the sliding window according to the personality characteristic information to obtain an updated sliding window; According to the updated sliding window, word co-occurrence sliding statistics are performed on the text data set to obtain the co-occurrence matrix.
5. The method according to claim 1, wherein The performing of text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information includes: Performing text division on the first text input content to obtain a plurality of third text input contents; Inputting all the third text input contents into the emotion recognition model for emotion recognition, and obtaining text emotion information output by the emotion recognition model; Semantic understanding and keyword extraction are performed on all the third text input contents to obtain the text context information and the target keywords.
6. The method according to claim 1, characterized in that The step of performing context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph to obtain context extension information corresponding to the first text input content includes: Performing text vectorization on the target keyword and the text context information to obtain a text query vector; Performing a vector query on the lexical semantic graph according to the text query vector to obtain a graph key-value vector corresponding to the text query vector; Attention knowledge extraction is performed on the lexical semantic graph according to the text query vector and the graph key-value vector to obtain the context extension information.
7. The method according to claim 1, characterized in that The step of inputting the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text and obtain a target vocabulary includes: Get the preset prompt template; According to the prompt template, the text emotion information, the context extension information and the first text input content are processed to construct a prompt to obtain a target prompt; The target prompt is input into the pre-trained language model to obtain the target vocabulary output by the pre-trained language model.
8. A text vocabulary recommendation system, characterized in that: include: A first processing unit is configured to obtain a first text input content of a user and a lexical semantic map of the user; A second processing unit is configured to perform text parsing on the first text input content to obtain target keywords, text context information, and text sentiment information; a third processing unit, configured to perform context matching and knowledge query processing on the target keyword and the text context information according to the lexical semantic graph, to obtain context extension information corresponding to the first text input content; a fourth processing unit, configured to input the text emotion information, the context expansion information, and the first text input content into a pre-trained language model to generate text, obtain target vocabulary, and provide the target vocabulary to the user; The lexical semantic graph is a knowledge graph constructed based on a plurality of second text input contents, and the second text input contents are the first text input contents previously provided by the user.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.