CN-121980036-A - Method, device, equipment and medium for recommending demand text
Abstract
The application discloses a method, a device, equipment and a medium for recommending a demand text, wherein the method comprises the steps of obtaining an input text of a target user and determining a plurality of demand keywords based on the input text, determining an environment sample of the input text from a demand database based on the plurality of demand keywords, wherein the environment sample is used for representing a scene where the input text is located, determining a generated sentence based on the environment sample and the plurality of demand keywords by utilizing a large language model, and obtaining demand recommendation information corresponding to the input text based on at least one generated sentence. The method solves the problem that the recommendation result deviates from the true intention of the user due to the fact that the ambiguous scenes of the keywords cannot be distinguished in the existing demand text recommendation method.
Inventors
- YANG CHUNMING
- JIA SHANSHAN
- XIAO DECHENG
- WANG YILIN
- ZHANG HUI
- CHEN YANHAN
Assignees
- 西南科技大学
Dates
- Publication Date
- 20260505
- Application Date
- 20251010
- Priority Date
- 20250414
Claims (10)
- 1. A demand text recommendation method, applied to a demand text recommendation system, the system storing a demand database, the method comprising: acquiring an input text of a target user and determining a plurality of requirement keywords based on the input text; Determining an environment sample of the input text from the requirement database based on a plurality of requirement keywords, wherein the environment sample is used for representing a scene where the input text is located; generating sentences based on the environment sample, the plurality of requirement keywords and determined by using a large language model; and obtaining the requirement recommendation information corresponding to the input text based on at least one generated sentence.
- 2. The method of claim 1, wherein the determining an environmental sample of the input text from the demand database based on a plurality of demand keywords comprises: determining a plurality of similar samples from the demand database aiming at any demand keyword, and clustering the similar samples by using a clustering algorithm to obtain a single environmental sample of the demand keyword, wherein the similar samples are sentence fragments comprising the demand keyword; An environmental sample of the input text is determined based on a plurality of single environmental samples.
- 3. The method of claim 2, wherein clustering the plurality of similar samples using a clustering algorithm to obtain the single environmental sample for the demand keyword comprises: clustering a plurality of similar samples by using a clustering algorithm to obtain at least one cluster; Determining scene contribution degree of each cluster, taking the cluster with the largest scene contribution degree as a single environment sample of the requirement keywords, and representing importance degree of scenes corresponding to each cluster in a requirement database for describing the requirement keywords.
- 4. The method of claim 3, wherein the determining the scene contribution of each cluster class comprises: Determining a first contribution degree based on the occurrence frequency of the requirement keywords in any cluster class; Determining a second contribution rate based on the similarity of each sentence fragment in the cluster and the requirement keyword; A scene contribution rate of the cluster class is determined based on the first contribution rate and the second contribution rate.
- 5. The method of claim 2, wherein determining to generate a sentence based on the environmental sample, the plurality of demand keywords, and using a large language model comprises: generating a first temporary sentence based on the environmental sample, the plurality of demand keywords and using a large language model; Stopping generating the first temporary sentence and retrieving the low-probability token again and generating a first new temporary sentence if the low-probability token appears in the first temporary sentence, until the first new temporary sentence does not contain the low-probability token, and taking the first new temporary sentence which does not contain the low-probability token as a first generated sentence; If the first temporary sentence does not have the low probability token, taking the first temporary sentence without the low probability token as a first generated sentence; generating a second temporary generated sentence based on the first generated sentence and the single environmental sample of each requirement keyword, and obtaining the second generated sentence based on the second temporary sentence; and repeatedly executing the generation process of the second generated sentence until a preset stopping condition is reached.
- 6. The method of claim 5, wherein generating a second temporary generated sentence based on the first generated sentence and a single environmental sample of each demand keyword comprises: Determining a scene vector of the first generated sentence, wherein the scene vector can represent a scene where the first generated sentence is located; calculating the similarity degree between the scene vector and the single environment sample of each requirement keyword; based on the similarity and the first generated sentence, a second temporarily generated sentence is continuously generated using a large language model.
- 7. The method of claim 6, wherein prior to said generating a second temporarily generated sentence using a large language model based on said degree of similarity and said first generated sentence, said method further comprises: determining scene probability of each single-environment sample based on scene contribution degree of each single-environment sample of each requirement keyword and the similarity degree; The generating a second temporary generated sentence using a large language model based on the similarity and the first generated sentence includes: Based on the scene probability and the first generated sentence, a second temporarily generated sentence is continuously generated using a large language model.
- 8. A demand text recommending apparatus, characterized by comprising: The user input module is used for acquiring input text of a target user and determining a plurality of requirement keywords based on the input text; the scene determining module is used for determining an environment sample of the input text from the requirement database based on a plurality of requirement keywords, wherein the environment sample is used for representing a scene where the input text is located; a sentence generation module for generating sentences based on the environmental sample, the plurality of demand keywords and using a large language model; and the demand recommendation module is used for obtaining the demand recommendation information corresponding to the input text based on the generated sentences.
- 9. A demand text recommendation device, characterized by comprising: and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of any of claims 1-7.
- 10. A computer readable storage medium, characterized in that a computer program is stored, which, when being executed by a processor, implements the method according to any of claims 1 to 7.
Description
Method, device, equipment and medium for recommending demand text Method, device, equipment and medium for recommending demand text Cross reference The present disclosure claims priority to chinese patent application number 202510457743X entitled "an enterprise policy recommendation method, apparatus, device, and medium," filed on 14, 04, 2025, the entire contents of which are incorporated herein by reference. Technical Field The present application relates to the field of text recommendation technologies, and in particular, to a method, an apparatus, a device, and a medium for recommending a required text. Background In the enterprise policy matching and demand analysis scenario, compared with the traditional method which only relies on keyword literal matching, the semantic association between the user demand and the policy document can be effectively captured by the context-based semantic analysis technology. According to the method, the core keywords in the requirement sentences are analyzed, the context paragraphs containing the same keywords are positioned in the documents, so that the semantic similarity is calculated, and the accuracy and the practicability of information retrieval can be improved. However, the existing demand text recommendation method cannot identify and distinguish different business scenes involved in the document by the same keyword (for example, "equipment" may correspond to multiple types of scenes such as purchase, operation and maintenance, discard, etc., i.e. the several scenes all contain the keyword "equipment"). The sentence fragments retrieved by the system are mixed in a plurality of different scenes, and the recommendation result generated by the sentence fragments is often deviated from the actual intention of the user, so that the reference value is low. Disclosure of Invention The application mainly aims to provide a method, a device, equipment and a medium for recommending a required text, and aims to solve the technical problem that the recommendation result deviates from the true intention of a user due to the fact that the existing method for recommending the required text cannot distinguish ambiguous scenes of keywords. In order to achieve the above purpose, the application provides a demand text recommending method, which is applied to a demand text recommending system, wherein the system stores a demand database, and the method comprises the steps of acquiring input text of a target user and determining a plurality of demand keywords based on the input text; the method comprises the steps of determining an environment sample of an input text from a demand database based on a plurality of demand keywords, wherein the environment sample is used for representing a scene where the input text is located, determining a generated sentence based on the environment sample and the plurality of demand keywords by using a large language model, and obtaining demand recommendation information corresponding to the input text based on at least one generated sentence. The method comprises the steps of determining a plurality of similar samples from a demand database according to any demand keyword, clustering the similar samples by using a clustering algorithm to obtain single-environment samples of the demand keyword, wherein the similar samples are sentence fragments comprising the demand keyword, and determining the environment samples of the input text according to the single-environment samples. The clustering method comprises the steps of clustering the similar samples to obtain at least one cluster, determining scene contribution degree of each cluster, taking the cluster with the largest scene contribution degree as the single-environment sample of the requirement keyword, wherein the scene contribution degree represents importance degree of scenes corresponding to each cluster for describing each requirement keyword in a requirement database. Optionally, determining the scene contribution degree of each cluster comprises determining a first contribution degree based on the occurrence frequency of the requirement keywords in any cluster, determining a second contribution rate based on the similarity of each sentence fragment in the cluster and the requirement keywords, and determining the scene contribution rate of the cluster based on the first contribution rate and the second contribution rate. The method comprises the steps of determining a generated sentence based on the environment sample, the plurality of requirement keywords and a large language model, generating a first temporary sentence based on the environment sample, the plurality of requirement keywords and the large language model, stopping generating the first temporary sentence and retrieving the low-probability token again and generating a first new temporary sentence if the first temporary sentence has the low-probability token until the first new temporary sentence does not contain the low-probabi