Enterprise policy recommendation method and device, equipment and medium
By vectorizing users' corporate labels and using large language models to generate corporate policy recommendation information, the problems of traditional recommendation methods being poor in recommendations and homogeneous recommendations for new users are solved, and personalized and diversified corporate policy recommendations are achieved.
Patent Information
- Application Number
- CN202510457743.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-05-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional recommendation methods are difficult to provide accurate recommendations when facing new users, and are prone to homogeneous recommendations, which cannot meet users' needs for fresh content.
By obtaining the user's to be queried data, setting the enterprise label, vectorizing and inputting a large language model to generate enterprise policy recommendation information, and using the preset vector database to determine the relevant vector to improve the diversity and novelty of recommendations.
It realizes personalized corporate policy recommendations for new users, avoids the singleness of recommended content, improves the diversity and novelty of recommendation results, and meets users' needs for personalized and innovative content.
Smart Images

Figure CN120012941A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and medium for recommending enterprise policies. Background Art
[0002] With the rapid development of deep learning technology, recommendation systems have been widely used in many fields. Traditional recommendation methods mainly rely on user historical behavior data for recommendation, such as collaborative filtering, content-based recommendation, etc. These methods analyze the relationship between users and items to infer the content that users may be interested in.
[0003] However, traditional recommendation methods face multiple problems. First, for new users or new items, recommendation systems have difficulty providing accurate recommendations due to a lack of sufficient historical data. Second, traditional recommendation methods tend to lead to homogeneous recommendations, that is, the system tends to recommend content similar to the user's existing interests, lacking diversity and novelty, and thus failing to meet the user's demand for fresh content. Summary of the invention
[0004] The main purpose of this application is to provide an enterprise policy recommendation method, device, equipment and medium, aiming to solve the technical problem that traditional recommendation methods are difficult to provide accurate recommendations for new users.
[0005] To achieve the above-mentioned purpose, the present application provides a method for recommending enterprise policies, including: obtaining the user's data to be queried and setting at least one enterprise tag based on the data to be queried; vectorizing the enterprise tag to obtain an enterprise tag vector, and determining a related vector of the enterprise tag vector based on a preset vector database; inputting the enterprise tag vector and the related vector of the enterprise tag vector into a large language model to obtain a generated sentence; and obtaining the user's enterprise policy recommendation information based on the generated sentence.
[0006] Optionally, the process of constructing the preset vector database includes: acquiring an enterprise policy data set and an enterprise information data set; performing data cleaning on the enterprise policy data set and the enterprise information data set; and constructing a vector database based on the enterprise policy data set and the enterprise information data set.
[0007] Optionally, determining the related vector of the enterprise label vector based on a preset vector database includes: respectively calculating the degree of similarity between each vector in the preset vector database and the enterprise label vector; and determining the related vector of the enterprise label vector from the preset vector database based on the degree of similarity.
[0008] Optionally, the step of inputting the enterprise label vector and the related vector of the enterprise label vector into a large language model to obtain a generated sentence includes: inputting the enterprise label vector and the related vector of the enterprise label vector into a large language model to generate a first temporary sentence; if a low probability token appears in the first temporary sentence, stopping the generation of the first temporary sentence and re-searching the low probability token and generating a first new temporary sentence, until the first new temporary sentence does not contain the low probability token, and using the first new temporary sentence that does not contain the low probability token as the first generated sentence; if the low probability token does not appear in the first temporary sentence, using the first temporary sentence that does not contain the low probability token as the first generated sentence; determining relevant documents of the first generated sentence from the preset vector database based on the first generated sentence; generating a second temporary sentence based on the first generated sentence, the enterprise label vector and the related documents of the first generated sentence and using a large language model; obtaining a second generated sentence based on the second temporary sentence; and repeating the generation process of the second generated sentence until a preset stop condition is reached.
[0009] Optionally, obtaining the second generated sentence based on the second temporary sentence includes: judging the second temporary sentence; if a low probability token appears in the second temporary sentence, stopping the generation of the second temporary sentence and re-searching the low probability token and generating a second new temporary sentence, until the second new temporary sentence does not contain the low probability token, and using the second new temporary sentence that does not contain the low probability token as the second generated sentence; if the low probability token does not appear in the second temporary sentence, using the second temporary sentence that does not contain the low probability token as the second generated sentence.
[0010] Optionally, the re-retrieval of the low-probability token and generation of a first new temporary sentence includes: obtaining a target text corresponding to the low-probability token based on the low-probability token; determining a target vector of the low-probability token from the preset vector database based on the target text; generating a first new temporary sentence based on the target vector and the enterprise label vector; the re-retrieval of the low-probability token and generation of a second new temporary sentence includes: obtaining a target text corresponding to the low-probability token based on the low-probability token; determining a target vector of the low-probability token from the preset vector database based on the target text; generating a second new temporary sentence based on the target vector, the enterprise label vector and the first generated sentence.
[0011] Optionally, after obtaining the enterprise policy recommendation information of the user based on the generated sentence, the method further includes: obtaining feedback information of the user based on the enterprise policy recommendation information; and updating the preset vector database based on the feedback information.
[0012] In addition, to achieve the above-mentioned purpose, the present application also provides a corporate policy recommendation device, including: a query input module, used to obtain the user's data to be queried and set at least one corporate label based on the data to be queried; a vectorization module, used to vectorize the corporate label to obtain a corporate label vector, and determine the relevant vector of the corporate label vector based on a preset vector database; a temporary sentence generation module, used to input the corporate label vector and the relevant vector of the corporate label vector into a large language model to obtain a generated sentence; and a corporate policy recommendation module, used to obtain the user's corporate policy recommendation information based on the generated sentence.
[0013] The present application also provides an enterprise policy recommendation device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned enterprise policy recommendation method.
[0014] The present application also provides a computer-readable storage medium, comprising: a computer program stored therein, wherein when the computer program is executed by a processor, the above-mentioned enterprise policy recommendation method is implemented.
[0015] The enterprise policy recommendation method, device, equipment and medium proposed in this application, by setting at least one enterprise label based on the user's query data, and vectorizing the enterprise label to obtain an enterprise label vector. Then, the relevant vector of the enterprise label vector is determined based on the preset vector database, and the enterprise label and its relevant vector are input into the large language model to generate at least one sentence in sequence. Finally, enterprise policy recommendation information is provided to the user based on the generated sentences. This application effectively solves the problems of poor recommendation effect and homogeneous recommendation of traditional recommendation systems when facing new users, and realizes personalized enterprise policy recommendations. In addition, this application can avoid the singleness of recommended content, improve the diversity and novelty of recommendation results, and better meet users' needs for personalized and innovative content. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of a method for recommending enterprise policies according to an implementation of the present application; Figure 2 A structural block diagram of an enterprise policy recommendation device according to an implementation mode of the present application; Figure 3It is a schematic diagram of the structure of an enterprise policy recommendation device according to an implementation mode of the present application.
[0017] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0018] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0019] When using traditional large language models for enterprise policy recommendations, for new users, large language models lack sufficient historical data and are therefore unable to provide accurate recommendation results. In addition, traditional recommendation methods tend to lead to homogeneous recommendations, that is, the model tends to recommend content similar to the user's existing interests, lacking diversity and novelty, and failing to meet the user's demand for fresh content.
[0020] In order to solve the above problems, this application provides an enterprise policy recommendation method, and the application scheme is introduced in detail below.
[0021] Figure 1 is a flow chart of an enterprise policy recommendation method according to an embodiment of the present application. The enterprise policy recommendation method can be executed by a policy recommendation device. The policy recommendation device can be, for example, an enterprise policy recommendation device. Figure 1 , the enterprise policy recommendation method may include the following steps: S1, obtaining the user's data to be queried and setting at least one enterprise tag based on the data to be queried; S2, vectorizing the enterprise label to obtain an enterprise label vector, and determining a related vector of the enterprise label vector based on a preset vector database.
[0022] The enterprise tag refers to the enterprise type to which the enterprise policy that the user wishes to be recommended belongs, for example, the enterprise tag may be a high-tech enterprise. The preset vector database is composed of enterprise policy data crawled from the Internet.
[0023] It is understandable that, in this embodiment, before inputting the user's query data into the large language model, it is necessary to first construct a preset vector database.
[0024] In one embodiment, the process of constructing the preset vector database may include: S21, obtaining an enterprise policy dataset and an enterprise information dataset; S22, performing data cleaning on the enterprise policy data set and the enterprise information data set; S23. Construct a vector database based on the enterprise policy dataset and the enterprise information dataset.
[0025] In the specific implementation process, crawler technology is first used to obtain enterprise policy data sets and enterprise information data sets from the Internet. It should be noted that the enterprise policy data set may include data sets crawled from relevant websites, which contain the full text of the policy, title, and objects corresponding to the policy, including enterprises, institutions, and social groups; the enterprise information data set may include enterprise data sets obtained from enterprise query websites. Enterprise data sets may include enterprise names, enterprise types such as technology-based SMEs and national high-tech enterprises, social credit codes, and enterprise labels, among which enterprise labels may include national standard industry labels, such as software and information technology services.
[0026] Furthermore, the enterprise policy dataset and the enterprise information dataset are cleaned, wherein the data cleaning step may include: filling missing values in the enterprise policy dataset and the enterprise information dataset, removing repeated paragraphs and numbers in the document, standardizing the date format in the document, removing punctuation marks and stop words from the text data, and performing stem extraction; for image data, OCR technology is used to extract text information in the image.
[0027] Furthermore, the enterprise policy dataset and the enterprise information dataset are segmented by using a segmentation technique. For example, the enterprise policy dataset and the enterprise information dataset can be segmented based on line breaks and periods to obtain several sentences. The segmented sentences are vectorized through an embedding model to obtain the representation of each sentence, i.e., a sentence vector, and then an index is created for the generated sentence vector. Then, metadata including the policy document title, the URL of the national enterprise policy, the release time, and the original content are associated with the corresponding sentence vector, and the sentence vector, the corresponding index, and the metadata are stored together in the Milvus vector database for subsequent retrieval and analysis.
[0028] Thus, a preset vector database is constructed, and the preset vector database can be used to perform subsequent processing on the user's to-be-queried data.
[0029] In the specific implementation process, the user's data to be queried is first obtained, and at least one enterprise tag is set based on the user's data to be queried. For example, if the user wants to obtain national enterprise policy recommendation information for high-tech enterprises, the enterprise tag can be set to high-tech enterprises.
[0030] Furthermore, the enterprise label is vectorized to obtain an enterprise label vector.
[0031] In one embodiment, in step S2, determining the related vector of the enterprise tag vector based on a preset vector database may include: S23, respectively calculating the similarity between each vector in the preset vector database and the enterprise label vector; S24: Determine a related vector of the enterprise tag vector from the preset vector database based on the similarity.
[0032] The similarity degree indicates the similarity between each vector in the preset vector database and the enterprise label vector. Based on the similarity degree, several vectors that are most similar to the enterprise label vector can be obtained from the preset vector database.
[0033] In the specific implementation process, the cosine similarity calculation method can be used to calculate the similarity between each vector in the preset vector database and the enterprise label vector. It should be noted that this embodiment uses cosine similarity as an example for illustration. In other embodiments, other similarity measurement methods can also be used. This embodiment does not specifically limit the similarity measurement method.
[0034] Furthermore, based on the order of similarity from high to low, K vectors with the highest similarity to the enterprise label vector are obtained from the preset vector database in sequence as the related vectors of the enterprise label vector, where K is a preset threshold and K is a positive integer greater than or equal to 2. It can be understood that since the vectors in the preset vector database are associated with metadata, metadata corresponding to the related vectors, i.e., policy titles, policy contents, URLs of national enterprise policies, etc., can be obtained based on the related vectors.
[0035] S3, inputting the enterprise label vector and the related vector of the enterprise label vector into a large language model to obtain a generated sentence; S4, obtaining enterprise policy recommendation information of the user based on the generated sentence.
[0036] It should be noted that this embodiment first uses a large language model to actively retrieve policy documents related to enterprise tags, namely, relevant vectors of enterprise tag vectors, and then generates a summary of national enterprise policy summaries, namely, enterprise policy recommendation information, based on the policy documents related to enterprise tags by the large language model.
[0037] It can be understood that the retrieval process is carried out simultaneously with the generation process, that is, the model first determines the relevant vector of the enterprise label vector from the preset vector database (obtaining preliminary retrieval information), and then inputs the enterprise label vector and the relevant vector of the enterprise label vector into the large language model to obtain the first generated sentence. If the first generated sentence fails to fully present the enterprise policy recommendation information, a secondary retrieval is performed to retrieve relevant documents related to the first generated sentence from the preset vector database, and then the obtained relevant documents, enterprise label vector and the first generated sentence are input into the large language model to obtain the second generated sentence, and so on, until the complete enterprise policy recommendation information is obtained.
[0038] Specifically, this embodiment uses the enterprise label vector as the initial input of the large language model ,use As a query formulation function, Search Based on initial input and The output of the model for the search ,Right now It is understandable that in the initial generation of the model, , the model did not generate data before, that is, no generated sentence appeared at this time, that is, ,at this time .
[0039] Furthermore, using a large language model to continuously generate content to obtain generated sentences, the formula can be used Represents the generation process of a large language model, where Indicates Generate sentences, represents a large language model, It means that before getting the tth generated sentence, the relevant documents retrieved from the preset vector database are Search The obtained related documents for the generated sentences, Represents the initial query data, i.e. the initial input of the model. Indicates The output of the model during the first retrieval is It is understandable that, before each content generation, this embodiment discards the relevant documents retrieved in the previous step and only uses the relevant documents retrieved in the current step as input conditions to avoid exceeding the input length limit of the large language model.
[0040] It should be further explained that, when the large language model generates a sentence, it will generate the next word according to the probability value of each token, where a low-probability token represents a word or grammar that is unlikely to appear, and a high-probability token represents a more common or reasonable word. In order to improve the accuracy of the generated sentence, before obtaining the generated sentence, this embodiment first generates a temporary sentence, and the temporary sentence contains multiple tokens with different probabilities. If the large language model generates a low-probability token in the temporary sentence, the generation process will be stopped, and the candidate words of the low-probability token will be retrieved again, and the generation iteration will be re-performed until a high-probability token that meets the requirements is generated, ensuring that the final generated sentence is more accurate and reasonable, that is, the final generated sentence does not contain a low-probability token.
[0041] In a specific implementation process, the enterprise label vector and the related vector of the enterprise label vector are firstly input into the large language model to generate a first temporary sentence.
[0042] If a low-probability token appears in the first temporary sentence, stop generating the first temporary sentence and re-search the low-probability token and generate a first new temporary sentence, until the first new temporary sentence does not contain the low-probability token, and use the first new temporary sentence that does not contain the low-probability token as the first generated sentence; If the first temporary sentence does not contain a low-probability token, the first temporary sentence without the low-probability token is directly used as the first generated sentence.
[0043] The step of re-searching the low-probability token and generating the first new temporary sentence may include: S31, obtaining a target text corresponding to the low probability token based on the low probability token; S32, determining a target vector of the low-probability token from a preset vector database based on the target text; S33: Generate a first new temporary sentence based on the target vector and the enterprise label vector.
[0044] In the specific implementation process, a question whose answer is a low-probability token can be designed, and the question can be input into chatGPT. The obtained document is used as the target text corresponding to the low-probability token, and the target text is segmented and vectorized.
[0045] Furthermore, according to the step of obtaining the relevant vector of the enterprise tag vector from the preset vector database, the relevant vector of the target text is obtained from the preset vector database as the target vector of the low probability token.
[0046] Furthermore, a first new temporary sentence is generated by utilizing a large language model based on the enterprise tag vector and the target vector of the low-probability token.
[0047] Thus, the first generated sentence is determined based on the first provisional sentence, and the second generated sentence can be determined using the first generated sentence.
[0048] In a specific implementation process, the relevant documents of the first generated sentence are determined from the preset vector database. It should be noted that multiple vectors can be selected as the relevant documents of the first generated sentence based on the order of similarity from large to small between the vector corresponding to the first generated sentence and the vectors in the preset vector database.
[0049] Furthermore, a second temporary sentence is generated by using a large language model, the first generated sentence, the enterprise label vector and the relevant documents of the first generated sentence, and the second temporary sentence is judged. If a low-probability token appears in the second temporary sentence, the generation of the second temporary sentence is stopped, and the low-probability token is re-searched and a second new temporary sentence is generated, until the second new temporary sentence does not contain the low-probability token, and the second new temporary sentence that does not contain the low-probability token is used as the second generated sentence; if the second temporary sentence does not contain the low-probability token, the second temporary sentence that does not contain the low-probability token is used as the second generated sentence; the generation process of the second generated sentence is repeatedly executed using the large language model to obtain multiple generated sentences until a preset stop condition is reached, and the preset stop condition may be that the next search is reached or the search ends, and complete enterprise policy recommendation information is obtained.
[0050] The step of re-searching the low-probability token and generating a second new temporary sentence may include: S34, obtaining a target text corresponding to the low probability token based on the low probability token; S35, determining a target vector of the low-probability token from a preset vector database based on the target text; S36: Generate a second new temporary sentence based on the target vector, the enterprise label vector and the first generated sentence.
[0051] It can be understood that when generating the second new temporary sentence, the input of the large language model is increased by the first generated sentence relative to the generation of the first new temporary sentence; when generating the third new temporary sentence, the input of the large language model is increased by the second generated sentence relative to the generation of the first new temporary sentence.
[0052] Specifically, in this embodiment, the following formula (1) can be used to represent the process of obtaining a generated sentence based on a temporary sentence: (1) in, Indicates The generated sentence is The sentences generated in the next step are represents the generated sentence output by the model, Indicates steps, represents the initial input of the model, Indicates generated sentences, D represents the preset vector database, Indicates Searches, Indicates that after getting Before generating a sentence, the first vector is retrieved from the preset vector database. The relevant documents of the generated sentence are Search Obtained relevant documents, Indicates a temporary sentence, Indicates a new temporary sentence. If The probability of any token in is lower than the threshold , all sentences trigger retrieval, a threshold of 0 means that retrieval is never triggered, and a threshold of 1 means that every sentence triggers retrieval.
[0053] It should be noted that in formula (1) of this embodiment, the new temporary sentence Low probability tokens are not included.
[0054] Furthermore, this example can also use the following formula (2) to represent the process of determining whether the temporary sentence contains a low-probability token, and if the temporary sentence contains a low-probability token, re-searching the low-probability token: (2) in, Indicates a temporary sentence, Indicates for The result of the low-probability token generation problem is the target text corresponding to the low-probability token. Indicates Search; if The probability that there is no token in is lower than the threshold , then no question generation is performed for the tokens in the temporary sentence.
[0055] It should be noted that this embodiment integrates the target text corresponding to the low-probability token, that is, the result of the low-probability token generation problem, into a ranking list to assist in subsequent sentence generation. based on The purpose of formulation is to guide the large language model to retrieve low-probability tokens, thereby improving the accuracy of subsequent sentence generation.
[0056] It should be further explained that since users' interests change dynamically, traditional recommendation methods often cannot capture these changes in time and find it difficult to keep up with the evolution of users' interests.
[0057] Based on this, after recommending enterprise policy recommendation information to users, this embodiment can also use user feedback to update the preset vector database, thereby achieving continuous optimization of user personalized recommendations and ensuring that the recommendation results can better reflect the user's latest interests and needs.
[0058] In one embodiment, after step S4, the embodiment further includes: S41, obtaining feedback information from the user based on the enterprise policy recommendation information; S42: Update the preset vector database based on the feedback information.
[0059] In the specific implementation process, this embodiment first obtains user feedback information based on the enterprise policy recommendation information recommended to the user, and then updates the preset vector database based on the user's feedback information, thereby improving the accuracy and relevance of user personalized recommendations and enhancing user experience.
[0060] The enterprise policy recommendation method, device, equipment and medium proposed in the embodiments of the present application set at least one enterprise label based on the user's query data, and vectorize the enterprise label to obtain an enterprise label vector. Next, the relevant vector of the enterprise label vector is determined based on the preset vector database, and the enterprise label vector and its relevant vector are input into the large language model to generate at least one sentence in sequence. Finally, enterprise policy recommendation information is provided to the user based on the generated sentences. The present application effectively solves the problems of poor recommendation effect and homogeneous recommendation of traditional recommendation systems when facing new users, and realizes personalized enterprise policy recommendations. In addition, the embodiments of the present application can avoid the singleness of recommended content, improve the diversity and novelty of recommendation results, and better meet the user's demand for personalized and innovative content.
[0061] The present embodiment is described in detail below using a specific example: First, the query content with enterprise tags, i.e. the user's query data, is input into the large language model: "Please list three national enterprise policies on high-tech enterprises, sort them by time and attach the relevant policy links", where the enterprise tag is high-tech enterprises; Secondly, the large language model searches based on the input and generates the first temporary sentence: "Tax incentives for high-tech enterprises: high-tech enterprises can enjoy a preferential income tax rate of 30%". Among them, "30% preferential income tax rate" is a low-probability token considered by the large language model. When the low-probability token is retrieved, the generation of the first temporary sentence is stopped and a new token "15% preferential income tax rate" is regenerated. The complete sentence is: "Tax incentives for high-tech enterprises: high-tech enterprises can enjoy a preferential income tax rate of 15%". At this time, the large language model cannot retrieve the low-probability token, and then uses this sentence as the first generated sentence. The large language model continues to generate enterprise policy recommendation information for users.
[0062] Finally, the large language model outputs three pieces of recommended corporate policy information related to high-tech enterprises and attaches the URL address corresponding to the recommended corporate policy information, so that users can query the specific official website to ensure the accuracy of the information.
[0063] Based on the above embodiments, Figure 2 is a structural block diagram of an enterprise policy recommendation device according to an implementation mode of the present application, such as Figure 2 As shown, the enterprise policy recommendation device 200 may include: a query input module 210, a vectorization module 220, a temporary sentence generation module 230 and an enterprise policy recommendation module 240, wherein: The query input module 210 is used to obtain the user's to-be-queried data and set at least one enterprise tag based on the to-be-queried data; The vectorization module 220 is used to vectorize the enterprise label to obtain an enterprise label vector, and determine a related vector of the enterprise label vector based on a preset vector database; The temporary sentence generation module 230 is used to input the enterprise label vector and the related vector of the enterprise label vector into a large language model to obtain a generated sentence; The enterprise policy recommendation module 240 is used to obtain the enterprise policy recommendation information of the user based on the generated sentence.
[0064] In an exemplary embodiment, the vectorization module 220 may also be used to obtain an enterprise policy dataset and an enterprise information dataset; perform data cleaning on the enterprise policy dataset and the enterprise information dataset; and construct a vector database based on the enterprise policy dataset and the enterprise information dataset.
[0065] In an exemplary embodiment, the vectorization module 220 may also be used to respectively calculate the similarity between each vector in the preset vector database and the enterprise label vector; and determine a related vector of the enterprise label vector from the preset vector database based on the similarity.
[0066] In an exemplary embodiment, the temporary sentence generation module 230 can also be used to input the enterprise label vector and the related vector of the enterprise label vector into the large language model to generate a first temporary sentence; if a low probability token appears in the first temporary sentence, stop generating the first temporary sentence and re-retrieve the low probability token and generate a first new temporary sentence, until the first new temporary sentence does not contain the low probability token, and use the first new temporary sentence that does not contain the low probability token as the first generated sentence; if the low probability token does not appear in the first temporary sentence, use the first temporary sentence that does not contain the low probability token as the first generated sentence; determine the relevant documents of the first generated sentence from the preset vector database based on the first generated sentence; generate a second temporary sentence based on the first generated sentence, the enterprise label vector and the related documents of the first generated sentence and using the large language model; obtain a second generated sentence based on the second temporary sentence; and repeat the generation process of the second generated sentence until a preset stop condition is reached.
[0067] In an exemplary embodiment, the temporary sentence generation module 230 can also be used to judge the second temporary sentence; if a low probability token appears in the second temporary sentence, the generation of the second temporary sentence is stopped and the low probability token is re-retrieved and a second new temporary sentence is generated until the second new temporary sentence does not contain the low probability token, and the second new temporary sentence that does not contain the low probability token is used as the second generated sentence; if the second temporary sentence does not contain the low probability token, the second temporary sentence that does not contain the low probability token is used as the second generated sentence.
[0068] In an exemplary embodiment, the temporary sentence generation module 230 may also be used to obtain a target text corresponding to the low probability token based on the low probability token; determine a target vector of the low probability token from the preset vector database based on the target text; generate a first new temporary sentence based on the target vector and the enterprise tag vector; In an exemplary embodiment, the temporary sentence generation module 230 can also be used to obtain a target text corresponding to the low probability token based on the low probability token; determine a target vector of the low probability token from the preset vector database based on the target text; and generate a second new temporary sentence based on the target vector, the enterprise tag and the first generated sentence.
[0069] In an exemplary embodiment, the enterprise policy recommendation module 240 may also be used to obtain feedback information from the user based on the enterprise policy recommendation information; and update the preset vector database based on the feedback information.
[0070] Those skilled in the art should understand that the division of the various modules in the embodiment is merely a division of logical functions, and in actual application, all or part of them can be integrated into one or more actual carriers, and these modules can be implemented entirely in the form of software called through a processing unit, or entirely in the form of hardware, or in the form of a combination of software and hardware. It should be noted that each module in an enterprise policy recommendation device in this embodiment corresponds one-to-one to each step in an enterprise policy recommendation method in the aforementioned embodiment. Therefore, the specific implementation method of this embodiment can refer to the implementation method of the aforementioned enterprise policy recommendation method, which will not be repeated here.
[0071] Based on the above embodiments, Figure 3 FIG. 1 is a schematic diagram of a structure of an enterprise policy recommendation device according to an implementation mode of the present application, such as Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute a method for recommending enterprise policies, the method comprising: obtaining the user's to-be-queried data and setting at least one enterprise tag based on the to-be-queried data; vectorizing the enterprise tag to obtain an enterprise tag vector, and determining a related vector of the enterprise tag vector based on a preset vector database; inputting the enterprise tag vector and the related vector of the enterprise tag vector into a large language model to obtain a generated sentence; and obtaining the enterprise policy recommendation information of the user based on the generated sentence.
[0072] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0073] On the basis of the above embodiments, on the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the enterprise policy recommendation method provided by the above methods, which includes: obtaining the user's data to be queried and setting at least one enterprise label based on the data to be queried; vectorizing the enterprise label to obtain an enterprise label vector, and determining a related vector of the enterprise label vector based on a preset vector database; inputting the enterprise label vector and the related vector of the enterprise label vector into a large language model to obtain a generated sentence; and obtaining the user's enterprise policy recommendation information based on the generated sentence.
[0074] On the basis of the above embodiments, on another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the enterprise policy recommendation method provided by the above methods, the method comprising: obtaining the user's data to be queried and setting at least one enterprise label based on the data to be queried; vectorizing the enterprise label to obtain an enterprise label vector, and determining a related vector of the enterprise label vector based on a preset vector database; inputting the enterprise label vector and the related vector of the enterprise label vector into a large language model to obtain a generated sentence; and obtaining the user's enterprise policy recommendation information based on the generated sentence.
[0075] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for recommending enterprise policies, characterized in that: The method comprises: Acquire the user's data to be queried and set at least one enterprise tag based on the data to be queried; Vectorizing the enterprise label to obtain an enterprise label vector, and determining a related vector of the enterprise label vector based on a preset vector database; Inputting the enterprise label vector and the related vector of the enterprise label vector into a large language model to obtain a generated sentence; The enterprise policy recommendation information of the user is obtained based on the generated sentence.
2. The enterprise policy recommendation method according to claim 1, characterized in that: The process of constructing the preset vector database includes: Obtain enterprise policy datasets and enterprise information datasets; Performing data cleaning on the enterprise policy data set and the enterprise information data set; A vector database is constructed based on the enterprise policy dataset and the enterprise information dataset.
3. The enterprise policy recommendation method according to claim 1, characterized in that: The determining the related vector of the enterprise label vector based on a preset vector database includes: Calculating the similarity between each vector in the preset vector database and the enterprise label vector respectively; A related vector of the enterprise tag vector is determined from the preset vector database based on the similarity.
4. The enterprise policy recommendation method according to claim 1, characterized in that: The step of inputting the enterprise tag vector and the related vector of the enterprise tag vector into a large language model to obtain a generated sentence includes: Inputting the enterprise tag vector and the related vector of the enterprise tag vector into a large language model to generate a first temporary sentence; If the first temporary sentence contains a low-probability token, stop generating the first temporary sentence, re-search the low-probability token, and generate a first new temporary sentence, until the first new temporary sentence does not contain the low-probability token, and use the first new temporary sentence that does not contain the low-probability token as the first generated sentence; If the first temporary sentence does not contain a low-probability token, taking the first temporary sentence without the low-probability token as the first generated sentence; Determining, based on the first generated sentence, from the preset vector database, relevant documents of the first generated sentence; Generate a second temporary sentence based on the first generated sentence, the enterprise tag vector, and the related documents of the first generated sentence and using a large language model; Obtaining a second generated sentence based on the second temporary sentence; The generation process of the second generated sentence is repeated until a preset stop condition is reached.
5. The enterprise policy recommendation method according to claim 4, characterized in that: The obtaining a second generated sentence based on the second temporary sentence includes: Making a judgment on the second temporary sentence; If the second temporary sentence contains a low-probability token, stop generating the second temporary sentence, re-search the low-probability token, and generate a second new temporary sentence, until the second new temporary sentence does not contain the low-probability token, and use the second new temporary sentence that does not contain the low-probability token as the second generated sentence; If the second temporary sentence does not contain the low-probability token, the second temporary sentence in which the low-probability token does not appear is used as the second generated sentence.
6. The enterprise policy recommendation method according to claim 5, characterized in that: The re-searching the low-probability token and generating a first new temporary sentence includes: Obtaining a target text corresponding to the low probability token based on the low probability token; Determine a target vector of the low-probability token from the preset vector database based on the target text; Generate a first new temporary sentence based on the target vector and the enterprise label vector; The re-searching the low-probability token and generating a second new temporary sentence includes: Obtaining a target text corresponding to the low probability token based on the low probability token; Determine a target vector of the low-probability token from the preset vector database based on the target text; A second new temporary sentence is generated based on the target vector, the enterprise label vector, and the first generated sentence.
7. The enterprise policy recommendation method according to claim 1, characterized in that: After obtaining the enterprise policy recommendation information of the user based on the generated sentence, the method further includes: Obtaining feedback information from the user based on the enterprise policy recommendation information; The preset vector database is updated based on the feedback information.
8. An enterprise policy recommendation device, characterized in that: include: A query input module, used to obtain the user's to-be-queried data and set at least one enterprise tag based on the to-be-queried data; A vectorization module, used for vectorizing the enterprise label to obtain an enterprise label vector, and determining a related vector of the enterprise label vector based on a preset vector database; A temporary sentence generation module, used for inputting the enterprise label vector and the related vector of the enterprise label vector into a large language model to obtain a generated sentence; The enterprise policy recommendation module is used to obtain the enterprise policy recommendation information of the user based on the generated sentence.
9. An enterprise policy recommendation device, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the enterprise policy recommendation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the enterprise policy recommendation method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Incremental learning-based comment generation method, system and equipment and storage medium
CN114386386A
Textile manufacturing industry policy matching method and system
CN118152512A
Text generation method and device, electronic equipment and storage medium
CN118734800A
Road topology detection method, and related apparatus
WO2025020985A1