Large language model dialogue method and device based on knowledge base
By obtaining and analyzing the individual characteristics and environmental information of the person to communicate, combined with the large language model, the establishment of a personalized dialogue method, solving the lack of personalized questions in the existing technologies, and realizing a more personalized and practical dialogue. Effect.
Patent Information
- Application Number
- CN202411405488.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing large language models lack personalization in answering questions and cannot consider individual differences and environmental factors of each individual.
By obtaining the face image information, problem sentences and environmental information of the person to be communicated, combined with the identity preference database and communication relationship database, build a target knowledge base, and use the training large language model to enter problem sentences, target knowledge data, to communicate with communication, to communicate with People and preferences interactive information and external factors affect information to obtain more personalized answers.
Realize more suitable personalized answers based on individual characteristics and environmental factors, and improves the pertinence and practicality of dialogue.
Smart Images

Figure CN119377362A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent dialogue technology, and in particular to a large language model dialogue method based on a knowledge base and a large language model dialogue device based on a knowledge base. Background Art
[0002] When using big models, the existing technology usually only considers universal answers. For example, if you ask the big model how to make fish-flavored shredded pork, the response you get is a universal method of making fish-flavored shredded pork. Or, if you ask the big model to give a Chinese food menu for a party in the evening, the Chinese food menu given by the big model is also universal, without considering the individual differences of each individual.
[0003] Therefore, it is desired to have a technical solution to overcome or at least alleviate at least one of the above-mentioned defects of the prior art.
[0004] Application Contents
[0005] The purpose of the present application is to provide a large language model dialogue method based on a knowledge base to overcome or at least alleviate at least one of the above-mentioned defects of the prior art.
[0006] To achieve the above-mentioned purpose, the present application provides a large language model dialogue method based on a knowledge base, and the knowledge base communication method based on a large language model includes:
[0007] Obtaining facial image information, question statements and environmental information of the person to be communicated;
[0008] Acquiring information about the person to be communicated and the interaction preference based on the facial image information of the person to be communicated;
[0009] Obtain information about the impact of external factors based on environmental information;
[0010] Acquire the target knowledge base;
[0011] Acquire target knowledge data from the target knowledge base according to the question statement of the person to be communicated;
[0012] Get a large trained language model;
[0013] The question statement, target knowledge data, information on the interaction between the person to be communicated and the preferences, and information on the influence of external factors are input into a trained large language model to obtain the answer content.
[0014] Optionally, the acquiring the information about the person to be communicated and the interaction preference according to the facial image information of the person to be communicated includes:
[0015] Recognize the facial image information to obtain the identity information of the person to be communicated;
[0016] Acquire an identity preference database, wherein the identity preference database includes at least one preset identity and a person to be communicated with and preference interaction information corresponding to each preset identity;
[0017] The person to be communicated and the preference interaction information corresponding to the preset identity which is the same as the identity information of the person to be communicated are obtained.
[0018] Optionally, obtaining the external factor influence information according to the environmental information includes:
[0019] Extracting keyword information from the environmental information, wherein the keyword information includes person-directed information and environmental-directed information;
[0020] The character preference interaction information is acquired according to the character pointing information; wherein the character preference interaction information and the environment pointing information constitute the external factor influence information.
[0021] Optionally, acquiring character preference interaction information according to the character pointing information includes:
[0022] Acquire a communication relationship database, wherein the communication relationship database includes a plurality of communication relationship sub-databases, each communication relationship sub-database corresponds to the identity information of a preset person to be communicated with, and each communication relationship sub-database includes basic information of a preset person to be communicated with and other persons who have intersections with the preset person to be communicated with;
[0023] Acquire a communication relationship sub-library corresponding to the identity information of a preset person to be communicated that is the same as the identity information of the person to be communicated;
[0024] According to the character-directed information, basic information of other persons in the communication relationship sub-library that match the character-directed information is obtained;
[0025] The character preference interaction information is obtained according to the basic information of the other person.
[0026] Optionally, the acquiring character preference interaction information according to the basic information of the other person includes:
[0027] Obtaining the preset identity in the identity preference database corresponding to the basic information of each other person;
[0028] According to the preset identity, the person to be communicated and the preference interaction information of each other person are obtained from the identity preference database as the person preference interaction information of the person.
[0029] Optionally, before acquiring the target knowledge base, the knowledge base communication method based on the large language model further includes:
[0030] Constructing the target knowledge base.
[0031] Optionally, the constructing the target knowledge base includes:
[0032] Obtain the geographical node information and permitted behavior information of the nursing home;
[0033] Perform artificial sentence expansion on the geographical node information of nursing homes to form a geographical node knowledge base;
[0034] The nursing home's permitted behavior information is artificially expanded to form a behavior knowledge base; wherein the geographic node knowledge base and the behavior knowledge base constitute the purpose knowledge base.
[0035] Optionally, the acquiring target knowledge data from the target knowledge base according to the question statement of the person to be communicated includes:
[0036] Extracting keywords from the question statement;
[0037] The information matching each keyword is searched in the geographic node knowledge base and the behavior knowledge base, so as to obtain target knowledge data.
[0038] The present application also provides a large language model dialogue device based on a knowledge base, and the large language model dialogue device based on a knowledge base includes:
[0039] A module for acquiring information about a person to be communicated with, the module for acquiring information about a person to be communicated with is used to acquire facial image information, question statements and environmental information of the person to be communicated with;
[0040] A module for acquiring information about the person to be communicated and the preferences of the person to be communicated, the module for acquiring information about the person to be communicated and the preferences of the person to be communicated is used to acquire information about the person to be communicated and the preferences of the person to be communicated according to the facial image information of the person to be communicated;
[0041] An external factor impact information acquisition module, the external factor impact information acquisition module is used to acquire external factor impact information based on environmental information;
[0042] A target knowledge base acquisition module, wherein the target knowledge base acquisition module is used to acquire a target knowledge base;
[0043] A target knowledge data acquisition module, the target knowledge data acquisition module is used to acquire target knowledge data from the target knowledge base according to the question statement of the person to be communicated;
[0044] A large language model acquisition module, wherein the large language model acquisition module is used to acquire a trained large language model;
[0045] The answer content acquisition module is used to input the question sentence, target knowledge data, information on the interaction between the person to be communicated and the preference, and information on the influence of external factors into a trained large language model, so as to obtain the answer content.
[0046] The knowledge base-based large language model dialogue method of the present application not only considers the interlocutor's question statements during the dialogue with the person to be communicated through the large model, but also assists in analyzing the information affecting external factors and the interaction information between the person to be communicated and the preferences, so as to give a personalized answer that is more suitable for the questioner. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a flowchart of a large language model dialogue method based on a knowledge base according to an embodiment of the present application.
[0048] Figure 2 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.
[0049] Figure 3 This is a schematic diagram showing an example of conducting a conversation using the large model of this application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical scheme and advantages of the implementation of this application clearer, the technical scheme in the embodiment of this application will be described in more detail below in conjunction with the drawings in the embodiment of this application. In the drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of this application, not all of them. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain this application, and should not be construed as limitations on this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. The embodiments of this application are described in detail below in conjunction with the drawings.
[0051] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the scope of protection of the present application.
[0052] Figure 1 It is a flowchart of a large language model dialogue method based on a knowledge base according to an embodiment of the present application.
[0053] like Figure 1 The knowledge base-based large language model dialogue method shown is used to build nursing home party activities.
[0054] In this embodiment, the question and answer direction of the large language model of the present application is mainly nursing home gatherings. It can be understood that gatherings include gatherings of small groups (for example, 2 or 3 people), and may also include gatherings of more people. The content of the party may include food and other content at the party, and may also include game content suitable for the elderly to play at the party (for example, card games, mahjong games, reasoning games, etc.).
[0055] In this embodiment, the knowledge base communication method based on the large language model includes:
[0056] Step 1: Obtain the facial image information, question statement and environmental information of the person to be communicated;
[0057] Step 2: Obtaining the interaction information between the person to be communicated and the preference according to the facial image information of the person to be communicated;
[0058] Step 3: Obtain information on the impact of external factors based on environmental information;
[0059] Step 4: Obtain the target knowledge base;
[0060] Step 5: Acquire target knowledge data from the target knowledge base according to the question statement of the person to be communicated;
[0061] Step 6: Get the trained large language model;
[0062] Step 7: Input the question statement, target knowledge data, information on the interaction between the person to be communicated and the preferences, and information on the influence of external factors into a trained large language model to obtain the answer content.
[0063] The knowledge base-based large language model dialogue method of the present application not only considers the interlocutor's question statements during the dialogue with the person to be communicated through the large model, but also assists in analyzing the information affecting external factors and the interaction information between the person to be communicated and the preferences, so as to give a personalized answer that is more suitable for the questioner.
[0064] In this embodiment, the step of obtaining the interaction information between the person to be communicated and the preference according to the facial image information of the person to be communicated includes:
[0065] Recognize the facial image information, thereby obtaining the identity information of the person to be communicated;
[0066] Acquire an identity preference database, wherein the identity preference database includes at least one preset identity and a person to be communicated with and preference interaction information corresponding to each preset identity;
[0067] The person to be communicated and the preference interaction information corresponding to the preset identity which is the same as the identity information of the person to be communicated are obtained.
[0068] In this embodiment, the application is mainly aimed at the communication method provided by a relatively stable environment (such as a nursing home). Therefore, the elderly in the nursing home are relatively stable, and there will be no problem of being in a nursing home today and going to another nursing home tomorrow. Therefore, some basic information about each elderly person, such as physical condition, preference, and communication situation, can be obtained through historical records. These data can be obtained through the oral description of the elderly, or through regular surveillance videos or physical examination reports, and can be entered manually.
[0069] In this embodiment, the identity preference database stores the person to be communicated and the preference interaction information mainly including the basic information of the person to be communicated. For example, if the person to be communicated has diabetes, he cannot eat too sweet food, so the underlying disease information of the person to be communicated belongs to the basic information of the person to be communicated. In addition, the preference information of the person to be communicated also belongs to the basic information of the person to be communicated, for example, the person to be communicated likes sour food, etc.
[0070] In this embodiment, obtaining the external factor influence information according to the environmental information includes:
[0071] Extracting keyword information from the environmental information, wherein the keyword information includes person-directed information and environmental-directed information;
[0072] The character preference interaction information is acquired according to the character pointing information; wherein the character preference interaction information and the environment pointing information constitute the external factor influence information.
[0073] In this embodiment, the environmental information is the information related to the environment input by the person to be communicated during the communication. The information related to the environment here can be the party scene or the information about the people participating in the party.
[0074] In this embodiment, it can be understood that the above-mentioned question sentences and environmental information can be obtained by semantically recognizing the voice information provided by the person to be communicated.
[0075] In this embodiment, the keyword information includes person-directed information and environment-directed information. For example, if the environment information contains a description of Zhang San, then Zhang San belongs to the person-directed information. If the environment-directed information contains descriptions such as a basketball court, a cafeteria, and a room number, then it is considered to be an environment-directed description. In addition, the environment-directed information can also be specific environment information, such as descriptions of environments such as humidity, waterfalls, and rain.
[0076] In this embodiment, acquiring character preference interaction information according to the character pointing information includes:
[0077] Acquire a communication relationship database, wherein the communication relationship database includes a plurality of communication relationship sub-databases, each communication relationship sub-database corresponds to the identity information of a preset person to be communicated with, and each communication relationship sub-database includes basic information of a preset person to be communicated with and other persons who have intersections with the preset person to be communicated with;
[0078] Acquire a communication relationship sub-library corresponding to the identity information of a preset person to be communicated that is the same as the identity information of the person to be communicated;
[0079] According to the character-directed information, basic information of other persons in the communication relationship sub-library that match the character-directed information is obtained;
[0080] The character preference interaction information is obtained according to the basic information of the other person.
[0081] For example, assuming that the person to be communicated is Zhang San, the character-directed information obtained from his descriptive voice includes: Li Si, Zhao Liu.
[0082] The corresponding social relationship sub-database in the social relationship database is obtained, that is, Zhang San's social relationship sub-database.
[0083] In this embodiment, each communication relationship sub-library includes a preset person to be communicated and basic information of other people who have intersections with the preset person to be communicated, which can be regarded as a knowledge graph, in which the central node is Zhang San, and other nodes connected with Zhang San, for example, include Li Si and Wang Wu. Each node will store the basic information of the person corresponding to the node, as well as the basic information of Li Si and Wang Wu. These basic information are similar to the person to be communicated and the preference interaction information, and can record preference information, basic disease information, etc.
[0084] After obtaining the basic information of other people in the communication relationship sub-library that matches the character-directed information, the character preference interaction information can be obtained based on the basic information.
[0085] For example, in the above embodiment, the character orientation information of Zhang San includes: Li Si, Zhao Liu, among which Li Si is located in the communication relationship sub-library, therefore, the character preference interaction information of Li Si can be obtained.
[0086] It is understandable that, since interpersonal communication is dynamic, for example, Zhao Liu may be a new friend of Zhang San. At this time, Zhao Liu's information is not in the social relationship sub-library and can be ignored.
[0087] In this embodiment, the acquiring of character preference interaction information according to the basic information of other persons includes:
[0088] Obtaining the preset identity in the identity preference database corresponding to the basic information of each other person;
[0089] According to the preset identity, the person to be communicated and the preference interaction information of each other person are obtained from the identity preference database as the person preference interaction information of the person.
[0090] In this embodiment, the basic information of other persons includes the above-mentioned preference information and name, and also includes a preset identity, which is manually set and can be set by the owner of the social relationship sub-library or by other persons.
[0091] In real life, especially when the elderly are communicating, they seldom call each other by their names directly. For example, Li Si is the person's real name, but because the elderly have a good relationship with Li Si, they may call the other person Lao Litou or Li Erge. This description is a preset identity.
[0092] Since the elderly usually use colloquial expressions when communicating, they will also use nicknames or habitual descriptions when expressing themselves. In particular, the elderly sometimes have memory loss and may not be able to quickly remember more complex names. Therefore, this method can better help them find the person they want to point to.
[0093] The reason why this application sets up a social relationship sub-library for each elderly person is that everyone calls others differently. In addition, assuming that there are 100 elderly people in a nursing home, the probability of having the same name is also very high. However, it is unlikely that the people close to each other will use the same nickname to call each other. For example, even if Zhang San has two friends with the surname Wang, Zhang San will not call both of them Lao Wang. Generally speaking, they may be distinguished by age, such as one is Brother Wang and the other is Brother So-and-so. Therefore, by setting up a social relationship sub-library for the elderly and setting a preset identity, on the one hand, it solves the problem of the elderly being unable to recognize when they habitually call each other, and on the other hand, it reduces the problem of interference between people with the same name or relatively similar names.
[0094] In this embodiment, before acquiring the target knowledge base, the knowledge base communication method based on the large language model further includes:
[0095] Build a target knowledge base.
[0096] In this embodiment, constructing the target knowledge base includes:
[0097] Obtain the geographical node information and permitted behavior information of the nursing home;
[0098] Perform artificial sentence expansion on the geographical node information of nursing homes to form a geographical node knowledge base;
[0099] The nursing home's permitted behavior information is artificially expanded to form a behavior knowledge base; wherein the geographic node knowledge base and the behavior knowledge base constitute the purpose knowledge base.
[0100] As described above, the elderly's colloquial descriptions are often quite different from the actual names. For example, the name of the nursing home's canteen is Chunfeng Pavilion, but the elderly may directly call it the canteen. Or, if there are multiple canteens in a nursing home, the elderly may say simple descriptive language such as the North Canteen and the South Canteen instead of saying the specific names of the canteens. Therefore, in this case, it is necessary to manually expand the sentences of the nursing home's geographic node information. For example, the noun Chunfeng Pavilion alone can be expressed in multiple descriptive meanings, such as canteen or other descriptions, based on the colloquial expressions often used by the elderly.
[0101] The same applies to the behavioral information allowed in nursing homes. For example, playing cards may be directly replaced by a certain type of cards in spoken language, such as Landlord, Golden Flower, etc., so it also needs to be expanded.
[0102] In addition, the reason why the nursing home sets up the permitted behavior information is to not allow certain illegal behaviors to occur, such as gambling or other behaviors that affect the physical and mental health of the elderly.
[0103] In this embodiment, obtaining target knowledge data from the target knowledge base according to the question statement of the person to be communicated includes:
[0104] Extracting keywords from the question statement;
[0105] The information matching each keyword is searched in the geographic node knowledge base and the behavior knowledge base, so as to obtain target knowledge data.
[0106] In this embodiment, the question statement is a colloquial expression, which can be used as a feature of the large model. However, in order to prevent the large model from being unable to recognize the colloquial expression, the description can be further expanded through the purpose knowledge base. For example, assuming that the person to be communicated describes going to the West Side Restaurant to play Landlord, this sentence can be converted into a feature input into the large model. However, the text can also be converted into target knowledge data through the purpose knowledge base to form a more standardized description text, for example: go to Chunfeng Pavilion to play poker.
[0107] In this embodiment, multimodal features (question statements, target knowledge data, information about the interaction between the person to be communicated and preferences, and information about the influence of external factors) are used as input into a large language model, so that the information fed back by the model can be more accurate and more suitable for the questioner.
[0108] For example, the person to be communicated is Zhang San, who inputs the following content by voice:
[0109] I am planning to have a gathering with my eldest brother and second sister in my room on Friday. Can you recommend some delicious Sichuan dishes?
[0110] At this time, the question statement is: I plan to have a party with my eldest brother and second sister in my room on Friday. Can you recommend some delicious Sichuan dishes?
[0111] The target knowledge data is: recommend Sichuan cuisine.
[0112] The information about the person to be communicated and the interaction between preferences can be obtained through the above method. For example, if the person to be communicated has diabetes, the information about the person to be communicated and the interaction between preferences that can be obtained is diabetes.
[0113] In the external factors influencing information, assuming that there is another person in the social relationship sub-database whose pre-qualified identity is the second sister, then his character preference interaction information is obtained. For example, his character preference interaction information is that he likes spicy food, then the external factors influencing information may include liking spicy food.
[0114] See also Figure 3 After all the above information is obtained, it is input into the corresponding large model (it can be understood that the above information is automatically obtained through the method of the present application. In fact, the text information or voice information provided by the person to be communicated is only one sentence, that is, I plan to have a party with my eldest brother and second sister in my room on Friday. Can you recommend some delicious Sichuan dishes? The rest, whether it is diabetes or liking spicy food, are additional content obtained through the method of the present application and will not be reflected in the conversation), so as to obtain the final conversation result.
[0115] It is understandable that if we use the existing large model, it is impossible to obtain Figure 3 The content of the information described in.
[0116] It is understandable that the large model of the present application can carry out multiple rounds of dialogue, and the above example only takes one round of dialogue as an example.
[0117] The present application also provides a large language model dialogue device based on a knowledge base, the large language model dialogue device based on a knowledge base includes a module for acquiring information about a person to be communicated, a module for acquiring information about interaction between a person to be communicated and a preference, a module for acquiring information about external factors, a module for acquiring a target knowledge base, a module for acquiring target knowledge data, a large language model acquisition module, and a module for acquiring answer content, wherein:
[0118] The information acquisition module for the person to be communicated is used to obtain the facial image information, question sentence and environmental information of the person to be communicated;
[0119] The module for acquiring information about the interaction between the person to be communicated and the preference is used to acquire information about the interaction between the person to be communicated and the preference according to the facial image information of the person to be communicated;
[0120] The external factor impact information acquisition module is used to acquire the external factor impact information according to the environmental information;
[0121] The target knowledge base acquisition module is used to acquire the target knowledge base;
[0122] The target knowledge data acquisition module is used to acquire the target knowledge data from the target knowledge base according to the question statement of the person to be communicated;
[0123] The large language model acquisition module is used to obtain a trained large language model;
[0124] The answer content acquisition module is used to input the question statement, target knowledge data, information on the interaction between the person to be communicated and the preference, and information on the influence of external factors into a trained large language model, so as to obtain the answer content.
[0125] It should be noted that the above explanations of the method embodiment are also applicable to the device of this embodiment and will not be repeated here.
[0126] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, the above-mentioned knowledge base-based large language model dialogue method is implemented.
[0127] The present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the above-mentioned knowledge base-based large language model dialogue method.
[0128] Figure 2 It is an exemplary structural diagram of an electronic device that can implement the knowledge base-based large language model dialogue method provided according to an embodiment of the present application.
[0129] Figure 2 The electronic device shown can also be implemented as comprising: a memory storing computer executable instructions; and one or more processors, which can implement the combination when executing the computer executable instructions. Figure 1 Described knowledge base based large language model dialogue method.
[0130] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0131] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0132] Computer readable media include permanent and non-permanent, removable and non-removable, and the media can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), data versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0133] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0134] In addition, it is obvious that the word "comprising" does not exclude other units or steps. Multiple units, modules or devices stated in the device claim can also be implemented by one unit or the overall device through software or hardware.
[0135] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code includes one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes identified in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or the total flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] Although the present application is disclosed as above in terms of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0137] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A large language model dialogue method based on a knowledge base, used for building a gathering activity in a nursing home, characterized in that: The knowledge base communication method based on the large language model includes: Obtaining facial image information, question statements and environmental information of the person to be communicated; Acquiring information about the person to be communicated and the interaction preference based on the facial image information of the person to be communicated; Obtain information about the impact of external factors based on environmental information; Acquire the target knowledge base; Acquire target knowledge data from the target knowledge base according to the question statement of the person to be communicated; Get a large trained language model; The question statement, target knowledge data, information on the interaction between the person to be communicated and the preferences, and information on the influence of external factors are input into a trained large language model to obtain the answer content.
2. The large language model dialogue method based on the knowledge base as claimed in claim 1, characterized in that: The step of obtaining the information about the person to be communicated and the interaction preference according to the facial image information of the person to be communicated comprises: Recognize the facial image information to obtain the identity information of the person to be communicated; Acquire an identity preference database, wherein the identity preference database includes at least one preset identity and a person to be communicated with and preference interaction information corresponding to each preset identity; Obtain the person to be communicated and the preference interaction information corresponding to the preset identity which is the same as the identity information of the person to be communicated.
3. The large language model dialogue method based on the knowledge base as claimed in claim 2, characterized in that: The obtaining of external factor influence information according to environmental information includes: Extracting keyword information from the environmental information, wherein the keyword information includes person-directed information and environmental-directed information; The character preference interaction information is acquired according to the character pointing information; wherein the character preference interaction information and the environment pointing information constitute the external factor influence information.
4. The large language model dialogue method based on the knowledge base as claimed in claim 3, characterized in that: The acquiring of character preference interaction information according to the character pointing information comprises: Acquire a communication relationship database, wherein the communication relationship database includes a plurality of communication relationship sub-databases, each communication relationship sub-database corresponds to the identity information of a preset person to be communicated with, and each communication relationship sub-database includes basic information of a preset person to be communicated with and other persons who have intersections with the preset person to be communicated with; Acquire a communication relationship sub-library corresponding to the identity information of a preset person to be communicated that is the same as the identity information of the person to be communicated; According to the character-directed information, basic information of other persons in the communication relationship sub-library that match the character-directed information is obtained; The character preference interaction information is obtained according to the basic information of the other person.
5. The large language model dialogue method based on the knowledge base as claimed in claim 4, characterized in that: The acquiring of character preference interaction information according to the basic information of other persons comprises: Obtaining the preset identity in the identity preference database corresponding to the basic information of each other person; According to the preset identity, the person to be communicated and the preference interaction information of each other person are obtained from the identity preference database as the person preference interaction information of the person.
6. The large language model dialogue method based on the knowledge base as claimed in claim 5, characterized in that: Before acquiring the target knowledge base, the knowledge base communication method based on the large language model further includes: Constructing the target knowledge base.
7. The large language model dialogue method based on a knowledge base as claimed in claim 6, characterized in that: The constructing of the target knowledge base comprises: Obtain the geographical node information and permitted behavior information of the nursing home; Perform artificial sentence expansion on the geographical node information of nursing homes to form a geographical node knowledge base; The nursing home's permitted behavior information is artificially expanded to form a behavior knowledge base; wherein the geographic node knowledge base and the behavior knowledge base constitute the purpose knowledge base.
8. The large language model dialogue method based on the knowledge base as claimed in claim 7, characterized in that: The step of acquiring target knowledge data from the target knowledge base according to the question statement of the person to be communicated includes: Extracting keywords from the question statement; The information matching each keyword is searched in the geographic node knowledge base and the behavior knowledge base, so as to obtain target knowledge data.
9. A large language model dialogue device based on a knowledge base, characterized in that: The large language model dialogue device based on the knowledge base includes: A module for acquiring information about a person to be communicated with, the module for acquiring information about a person to be communicated with is used to acquire facial image information, question statements and environmental information of the person to be communicated with; A module for acquiring information about the person to be communicated and the preferences of the person to be communicated, the module for acquiring information about the person to be communicated and the preferences of the person to be communicated is used to acquire information about the person to be communicated and the preferences of the person to be communicated according to the facial image information of the person to be communicated; An external factor impact information acquisition module, the external factor impact information acquisition module is used to acquire external factor impact information based on environmental information; A target knowledge base acquisition module, wherein the target knowledge base acquisition module is used to acquire a target knowledge base; A target knowledge data acquisition module, the target knowledge data acquisition module is used to acquire target knowledge data from the target knowledge base according to the question statement of the person to be communicated; A large language model acquisition module, wherein the large language model acquisition module is used to acquire a trained large language model; The answer content acquisition module is used to input the question sentence, target knowledge data, information on the interaction between the person to be communicated and the preference, and information on the influence of external factors into a trained large language model, so as to obtain the answer content.
Citation Information
Patent Citations
Artificial intelligence elderly care robot capable of controlling multi-brand smart home equipment through voice
CN111865733A
Interactive knowledge interaction system based on knowledge base and large language model
CN118013001A
Bank scenarized data visualization large screen generation method and system based on large model
CN118426899A
Intelligent interactive question-answering system in field of multi-channel safety emergency knowledge
CN118503373A
Nursing home accompanying service method and device based on robot assistant and storage medium
CN118673061A