Portable intelligent sound equipment and question and answer communication method for old breast cancer patients

Through the combination of portable intelligent audio combined with large language models and a hybrid knowledge base, it solves the problem that elderly breast cancer patients find it difficult to accurately express their needs when using hospital smart tools, and achieves accurate answers to user questions and convenient access to information.

CN119829698APending Publication Date: 2025-04-15TIANJIN TUMOR HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411431402.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-09-26
Filing Date
2024-10-14
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

When elderly patients with breast cancer use hospital smart tools, it is difficult for them to accurately express their needs due to poor vision, hearing and memory, and existing tools are difficult to accurately obtain useful information.

Method used

The portable intelligent audio combines a large language model and a mixed knowledge base. Through the mixed knowledge base of vector database and graph database, users can standardize the background information search and enhance the question, and achieve accurate answers to users' questions.

Benefits of technology

It effectively solves the problems of weak voice expression and limited language ability in elderly patients, supports multiple rounds of dialogue, helps patients answer questions and obtain information, and improves the accuracy and convenience of information acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829698A_ABST
    Figure CN119829698A_ABST
Patent Text Reader

Abstract

The invention provides a portable intelligent sound equipment question and answer communication method for an elderly breast cancer patient, and the method can solve the technical problems that the voice expression capability of a target user is weak and the language capability is limited, supports the multi-round dialogue of a patient nursing scene, and better helps the patient to solve problems and obtain information. The invention further provides sound equipment adopting the method, and the sound equipment is portable computing equipment based on audio recording, audio recognition, voice broadcasting and network interaction, and is particularly suitable for old people to use during hospitalization and home rehabilitation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of large language model technology, image knowledge graph technology and related technologies, and in particular to a method for elderly breast cancer patients to communicate using a portable intelligent speaker and question-and-answer communication. Background Art

[0002] With the advancement of science and technology, medical equipment has gradually been combined with artificial intelligence technology, especially in public places such as hospitals. A large number of smart tools have been introduced. However, for some people, especially the elderly over 60 years old, who have poor vision, hearing and memory, and poor ability to use smartphones and similar products, when they use smart tools in hospitals, they often don’t know what to ask, how to ask, and how to judge whether to continue communicating after getting an answer. The reason for this is mainly due to the limited expression ability of this group of people. Most of the existing communication and question-and-answer tools cannot accurately obtain useful information from the limited expression language. Summary of the invention

[0003] Technical solution: In order to solve the above technical problems, the present invention provides a method for elderly breast cancer patients to communicate with each other using a portable intelligent speaker. The specific steps of the method are as follows:

[0004] S1 defines the knowledge base and the parameters and logical relationships in the knowledge base, and builds a hybrid knowledge base of vector database and graph database;

[0005] S2 defines the model and its parameters and logical relationships, and uses the large language model to standardize user questions, search for background information, and enhance questions;

[0006] S3 answers user questions through vector search and graph search modes in the hybrid knowledge base.

[0007] As an improvement, in S1, the storage method of the hybrid knowledge base is to store entity names and entity relationship names in the vector database, and store the relationship between entities in the graph database; when building the hybrid knowledge base, the following definitions are included:

[0008] (1) Collection of entity names The set of all actual relationship names

[0009] (2) The set of all directed relationship edges

[0010] (3) A partial function represents the relationship between all the links ρ:

[0011] (4) A total function brt encodes any name into an n-dimensional vector V, that is, brt:N∪R→V. Then a knowledge base kg is a four-tuple kg=(n,e,ρ,brt),

[0012] As an improvement, in S2, the specific steps of question standardization are:

[0013] (1) Establishing a large language model

[0014] Define the large language model as llm, the user question as q, the input prompt word of the large language model as p, and the answer of the large language model as r, that is, The large language model is defined as the answer to any question: llm:S→S;

[0015] (2) Separate entities and relationships

[0016] Use the large language model LLM to decompose the entities and relations of user questions, and use a prompt word template pattern dt After embedding the user's question, the large language model is called, where the pattern dt :S→S, this process is That is, the large language model llm is required to return two sets The set of question entities and the set of question relations;

[0017] (3) Standardize entities and relationships

[0018] It includes two parts: encoding and query. The encoding is to use the full function brt to encode each element in the entity set and the relationship set. The specific formula of the encoding is:

[0019] V nq ={brt(n)|n∈N q},V rq ={brt(r)|r∈R q}

[0020] Among them, V nq To encode the disassembled entity set, N q is the entity set after disassembly, R q is the relation set after disassembly, V rq To encode the disassembled relation set;

[0021] The query is coded in the elderly breast cancer patient care knowledge base pkg N kg 、E kg In the query, similar entities and relationships are queried. For each element, the three results with the lowest difference are queried. The difference is calculated using the Euclidean distance, where E kgis the set of all directed edges in the nursing knowledge base for elderly breast cancer patients, N kg A collection of entity names in the knowledge base for nursing care of elderly breast cancer patients;

[0022] (4) Intent Recognition

[0023] Use the large language model LLM to identify the user's question intent and use a prompt word template pattern ir Embed user questions, entities and relations after entity standardization, and call the large language model to complete the questions. This process is recorded as llm (pattern ir (N′ kg ,R′ kg ,q)), where pattern ir :N×R×S→S.

[0024] As an improvement, the query steps in step (3) of S2 are:

[0025] (1) Let V nkg = *brt(n)|n∈N kg ,,u∈V nkg ,u=<u1,u2,…u n >,v∈V nq ,v=<v1,v2,…v n >, where V nkg is the entity set encoded in the knowledge base kg, and u is V nkg A subset of u1,u2,…u n is the node in u, V nq To encode the entity set after disassembly, v is V nq A subset of v1, v2, … v n is a node in v;

[0026] (2) Using the difference function d, the input is two vectors of equal length and the output is their real distance, that is:

[0027]

[0028] (3) All N q Perform the following operations on all elements in to obtain a distance set Dt, namely

[0029] Dt n ={((u,v),d(u,v))|(u,v)∈V nq ×V nkg}

[0030] Screen three N for each v kg The elements with the lowest difference in the set are After encoding, the encoded subset Dt′ is obtained r ;

[0031] (4) According to Dt′ n , Dt′ r To N kg , R kg Screening is performed to form two screened subsets N′ kg , R′ kg , there exists n∈N′ kg So that brt(n)∈{t(1)(2)|t∈Dt′ n}.

[0032] As an improvement, in step (2) of S2, the prompt word template pattern dt ,include:

[0033] (1) Scenario: Answering questions before, after, and during the recovery period for elderly breast cancer patients

[0034] (2) Task: Perform entity recognition and relationship recognition in the knowledge graph scenario for the user’s question, and return two sets, one is the entity set and the other is the relationship set.

[0035] (3) User questions: Ask specific questions;

[0036] The prompt word template pattern of step (4) of S2 ir ,include:

[0037] (1) Scenario: Answering questions before and after surgery for elderly breast cancer patients; Reference terms and relations: {rehabilitation exercises, time nodes, breast cancer surgery, time relations}

[0038] (2) Task: Identify the user's question intention, complete the incomplete verbs and nouns in the user's question, and give the completed question;

[0039] (3) User questions: Ask specific questions.

[0040] As an improvement, the background information search adopts a breadth-first algorithm, including searching the elderly breast cancer patient care knowledge base pkg to form a subgraph pkg′=(N sub ,E sub ,ρ,brt), for each node n∈N′ kg Search its descendants within 3 degrees, filtering with entities only.

[0041] As an improvement, the steps of searching for its descendants within 3 degrees and filtering only entities include:

[0042] (1) Initialization, Processing, where Defined as the initial set of entity names in the elderly breast cancer patient care knowledge base in a subgraph, N′ kg It is defined as a set of entity names in the knowledge base of nursing care for elderly breast cancer patients in the subgraph;

[0043] (2) Define i∈(1,2,3), according to the formula To filter, where i is a parameter, is the set of entity names in the i-th generation elderly breast cancer patient care knowledge base, is the set of entity names in the i-1 generation elderly breast cancer patient care knowledge base;

[0044] (3) The entities and edges between subgraphs are defined as follows:

[0045]

[0046] Where N sub The set of entity names in the nursing knowledge base for elderly breast cancer patients after calculation for the 3-degree descendant, E sub The set of edges of all directed relationships in the elderly breast cancer patient care knowledge base after calculation for the 3-degree descendants.

[0047] As an improvement, the question enhancement is to use the large language model to answer the background information knowledge base pkg′ of the elderly breast cancer patients' questions and integrate it into two information points as the background information for the large language model to answer the user's questions; specifically including:

[0048] (1) Knowledge tuple T, each element is concatenated with commas into a string [knowledge tuple], and then inserted into the "reference information" section of the prompt template; define T = {(n1,ρ(n1,n2),n2)|(n1,n2)∈E sub}, where (n1, n2) is a combination of two ordered positions, ρ is a partial function of the relationship of all connections, E sub is the set of all directed relationship edges in the nursing knowledge base for elderly breast cancer patients after calculation for the children within 3 degrees;

[0049] (2) The relation set R′ kg Each element is concatenated with commas into a string [relationship set] and inserted into the 'Focus points' section of the prompt word.

[0050] As an improvement, the structure of the prompt word template for question enhancement includes:

[0051] Scenario: Answering questions before and after surgery for elderly breast cancer patients

[0052] Reference information: [Knowledge tuple]

[0053] Focus: [Relationship Set]

[0054] Original question: q

[0055] Question after interpreting the original question: llm(pattern ir (N′ kg ,R′ kg ,q))

[0056] Please answer.

[0057] At the same time, the present invention also provides a portable smart speaker for elderly breast cancer patients, including a storage medium and a computer program. The computer program stored in the storage medium can be executed by one or more processors and can be used to implement any of the above-mentioned methods for question-and-answer communication for elderly breast cancer patients using a portable smart speaker.

[0058] Beneficial effects: The portable smart speaker for elderly breast cancer patients proposed by the present invention is a portable computing device that can perform audio recording, audio recognition, voice broadcasting, and network interaction. It is particularly suitable for use by elderly people during hospitalization and home rehabilitation. It can solve technical problems caused by the target users' weak voice expression ability and limited language ability. At the same time, it supports multiple rounds of dialogue in patient care scenarios, and better helps patients answer questions and obtain information.

[0059] In addition, the portable intelligent audio system and communication method proposed by the present invention have the following technical advantages compared with conventional ones:

[0060] (1) The present invention constructs a hybrid knowledge base of a vector database and a graph database, and jointly enhances search to enhance relevance to user intent, thereby overcoming the existing technical problems of using only a vector database, which may cause non-keywords in user questions such as "conduct", "of", and "what" to interfere with the matching of knowledge fragments; and using only graph data search, which may cause the vocabulary of the user's question to exceed the knowledge graph entity alignment range and fail to search for related subgraphs.

[0061] (2) The present invention constructs a large language model and conducts a search enhancement process, such as question standardization -> background information search -> question enhancement, to carry out multi-layer information processing, thereby being able to supplement incomplete content, identify user intent, etc., and thereby achieve a better answer to user intent in the later stage.

[0062] (3) The present invention uses a vector database in question standardization and a knowledge graph technology in background information search, innovatively combining the advantages of both. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 This is the system architecture diagram and workflow of the present invention.

[0064] Figure 2 It is a schematic diagram of the structure of the device of the present invention. DETAILED DESCRIPTION

[0065] The technical solutions in the embodiments of the present invention will be described clearly and completely below so that those skilled in the art can better understand the advantages and features of the present invention, thereby making a clearer definition of the protection scope of the present invention. The embodiments described in the present invention are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.

[0066] See Figure 1 As shown, it is a structural diagram of the portable intelligent audio system of the present invention, a portable intelligent audio system, specifically including a question-answer communication module, an information push module, an emergency call module, a system component module, and a server;

[0067] The question-and-answer communication module is used for users to ask questions about disease knowledge, consult medication information, communicate comfort and query hospital information;

[0068] The information push module is used for users to receive punch-in reminders and hospital health consultation broadcast information;

[0069] The emergency call module is used to send, receive and process emergency call signals;

[0070] The system component module is used for the adaptation, connection and assembly between hardware components, models and system communication units;

[0071] The server is used for information exchange between each of the above modules and between two modules.

[0072] Preferably, the emergency call module in the present invention can adopt the interaction mode of voice interaction and key interaction.

[0073] In the present invention, the system component module includes hardware components, a model preferably an ASR speech recognition model, and a network communication component, wherein the hardware components include a microphone, an audio component, buttons, and a network connection module, etc.

[0074] As a specific embodiment of the present invention, the server can include model components, databases, and network service program components, wherein the model components include but are not limited to large language models, ASR speech recognition models, and TTS speech synthesis models; the data include but are not limited to vector databases, graph databases, and relational databases; the network service program components include but are not limited to load equalizers, back-end applications, and the like.

[0075] See Figure 2 As shown, it is a schematic diagram of the specific steps of the method for elderly breast cancer patients to communicate with portable intelligent speakers using question-and-answer communication. The specific steps of the method are as follows: first, after the microphone receives the sound, the wake-up word is monitored by the ASR model, the user's voice is recorded, and the recording is sent to the server, which is recognized as text by the ASR voice. Then, through the large language model, the incomplete content is supplemented, the user's intention is recognized, and the noun and verb are extracted. Then, through the vector database and vector distance calculation, the corresponding knowledge base of the matching entity and relationship belongs to the graph database, the entity search of the noun, and the relationship search of the verb are formed to form a knowledge corpus. The server organizes the knowledge base corpus and the user's intention to form a prompt word, and the large language model answers the prompt word to form an answer. Finally, the text of the answer is converted into speech through TTS, and the server transmits the voice information to the terminal through the network, and broadcasts the voice message transmitted by the server.

[0076] In the present invention, a method for elderly breast cancer patients to communicate with each other using a portable intelligent speaker is also provided. The method is applied to the above-mentioned portable intelligent speaker system to provide user question-answering communication, wherein the specific steps are:

[0077] S1 defines the knowledge base and the parameters and logical relationships in the knowledge base, and builds a hybrid knowledge base of vector database and graph database;

[0078] S2 defines the model and its parameters and logical relationships, and uses the large language model to standardize user questions, search for background information, and enhance questions;

[0079] S3 answers user questions through vector search and graph search modes in the hybrid knowledge base.

[0080] As an improvement, in S1, the storage method of the hybrid knowledge base is to store entity names and entity relationship names in the vector database, and store the relationships between entities in the graph database.

[0081] The present invention is based on the following set rules when constructing models and knowledge bases:

[0082] (1) Let A be any set, Then represents the power set of X, that is, the set of all subsets of X;

[0083] (2) Let B be a set, then A×B is the Cartesian product of A and B, that is, all possible ordered combinations of (a, b), where a∈N, b∈B;

[0084] (3) Positional expression of ordered combinations, let t = (a, b), then t(1) = a, t(2) = b;

[0085] (4) Let x∈R be x is an arbitrary real number, and y∈N be y is an arbitrary natural number;

[0086] (5) Let v=<v1,v2,…,v n >v i {i|i≤n∧i∈N}∈R is a vector with n elements and all elements are real numbers, and there exists V such that v∈V is the set of all vectors;

[0087] (6) Let S be a set of arbitrary strings, and Any name, statement, number, or symbol is an element of S.

[0088] As the technical content of the present invention, when constructing a hybrid knowledge base, the following definitions are included:

[0089] (1) Collection of entity names The set of all actual relationship names

[0090] (2) The set of all directed relationship edges

[0091] (3) A partial function represents the relationship between all the links ρ:

[0092] (4) A total function brt encodes any name into an n-dimensional vector V, that is, brt:N∪R→V. Then a knowledge base kg is a four-tuple kg=(n,e,ρ,brt),

[0093] As a specific implementation of the present invention, in S2, the specific steps of question standardization are:

[0094] (1) Establishing a large language model

[0095] Define the large language model as llm, the user question as q, the input prompt word of the large language model as p, and the answer of the large language model as r, that is, The large language model is defined to answer any question as: llm:S→S.

[0096] (2) Separate entities and relationships

[0097] Use the large language model LLM to decompose the entities and relations of user questions, and use a prompt word template pattern dt After embedding the user's question, the large language model is called, where the pattern dt :S→S, this process is llm(pattern dt (q)): That is, the large language model llm is required to return two sets The set of question entities and the set of question relations;

[0098] In this step, a usable pattern dt As follows, [When do you do exercises] is the original question of the user:

[0099] Scenario: Answering questions before, after and during the recovery period for elderly breast cancer patients

[0100] Task: Perform entity recognition in the knowledge graph scenario for the user's question, identify the relationship between entities, and return two sets, one is the entity set and the other is the relationship set

[0101] The user's question is as follows:

[0102]

When to do exercises

[0103] The prompt returns an example as follows:

[0104] Entity collection: Elderly breast cancer patients, rehabilitation exercises, preoperative stage, postoperative stage, rehabilitation period

[0105] Relationship set: the time relationship between elderly breast cancer patients and rehabilitation exercises in the preoperative stage, the time relationship between elderly breast cancer patients and rehabilitation exercises in the postoperative stage, and the time relationship between elderly breast cancer patients and rehabilitation exercises during the rehabilitation period.

[0106] (3) Standardize entities and relationships

[0107] It includes two parts: encoding and query. The encoding is to use the full function brt to encode each element in the entity set and the relationship set. The specific formula of the encoding is:

[0108] V nq ={brt(n)|n∈N q},V rq ={brt(r)|r∈R q}

[0109] Among them, V nq To encode the disassembled entity set, N q is the entity set after disassembly, R q is the relation set after disassembly, V rq To encode the disassembled relation set;

[0110] The query is coded in the elderly breast cancer patient care knowledge base pkg N kg 、E kgIn the query, similar entities and relationships are queried. For each element, the three results with the lowest difference are queried. The difference is calculated using the Euclidean distance, where E kg is the set of all directed edges in the nursing knowledge base for elderly breast cancer patients, N kg A collection of entity names in the knowledge base for nursing care of elderly breast cancer patients.

[0111] In the present invention, the query steps are:

[0112] (3.1) Let V nkg ={brt(n)|n∈N kg},u∈V nkg ,u=<u1,u2,…u n >,v∈V nq ,v=<v1,v2,…v n >, where V nkg is the entity set encoded in the knowledge base kg, and u is V nkg A subset of u1,u1,…u n is the node in u, V nq To encode the entity set after disassembly, v is V nq A subset of v1, v2, … v n is a node in v;

[0113] (3.2) Using the difference function d, the input is two vectors of equal length and the output is their real distance, that is:

[0114]

[0115] (3.3) All N q Perform the following operations on all elements in to obtain a distance set Dt, namely

[0116] Dt n ={((u,v),d(u,v))|(u,v)∈V nq ×V nkg}

[0117] Screen three N for each v kg The elements with the lowest difference in the set are After encoding, the encoded subset Dt′ is obtained r ;

[0118] (3.4) According to Dt′ n , Dt′ r To N kg , R kg Screening is performed to form two screened subsets N′ kg , R′ kg , there exists n∈N′kg So that brt(n)∈{t(1)(2)|t∈Dt′ n}.

[0119] (4) Intent Recognition

[0120] Use the large language model LLM to identify the user's question intent and use a prompt word template pattern ir Embed user questions, entities and relations after entity standardization, and call the large language model to complete the questions. This process is recorded as llm (pattern ir (N′ kg ,R′ kg ,q)), where pattern ir :N×R×S→S.

[0121] In this step, a pattern is available ir As follows, [When to do exercise after surgery] is the user's original question, {rehabilitation exercise, time node, breast cancer patient surgery, time relationship} is N′ kg ,R′ kg The concatenated string.

[0122] Scenario: Answering questions before and after surgery for elderly breast cancer patients

[0123] Reference nouns and relations: {rehabilitation exercises, time nodes, breast cancer surgery, time relations}

[0124] Task: Identify the user's question intention, complete the incomplete verbs and nouns in the user's question, and give your completed question

[0125] The user's question is as follows:

[0126]

When to do exercises

[0127] The prompt returns the result

[0128] When should elderly breast cancer patients do rehabilitation exercises before and after surgery?

[0129] In the present invention, preferably, the background information search adopts a breadth-first algorithm, including searching the elderly breast cancer patient care knowledge base pkg to form a subgraph pkg′=(N sub ,E sub ,ρ,brt), for each node n∈N′ kg Search its descendants within 3 degrees, filtering with entities only.

[0130] Furthermore, the step of searching for its descendants within 3 degrees and filtering only entities includes:

[0131] (1) Initialization, Processing, where Defined as the initial set of entity names in the elderly breast cancer patient care knowledge base in a subgraph, N′ kg It is defined as a set of entity names in the knowledge base of nursing care for elderly breast cancer patients in the subgraph;

[0132] (2) Define i∈(1,2,3), according to the formula To filter, where i is a parameter, is the set of entity names in the i-th generation elderly breast cancer patient care knowledge base, is the set of entity names in the i-1 generation elderly breast cancer patient care knowledge base;

[0133] (3) The entities and edges between subgraphs are defined as follows:

[0134]

[0135] Where N sub The set of entity names in the nursing knowledge base for elderly breast cancer patients after calculation for the 3-degree descendant, E sub The set of edges of all directed relationships in the elderly breast cancer patient care knowledge base after calculation for the 3-degree descendants.

[0136] In the present invention, the question enhancement is to use the large voice model to answer the background information knowledge base pkg' of the elderly breast cancer patient's questions and integrate them into two information points as the background information for the large voice model to answer the user's questions; specifically including:

[0137] (1) Knowledge tuple T, each element is concatenated with commas into a string [knowledge tuple], and then inserted into the "reference information" section of the prompt template; define T = {(n1,ρ(n1,n2),n2)|(n1,n2)∈E sub}, where (n1, n2) is a combination of two ordered positions, ρ is a partial function of the relationship of all connections, E sub is the set of all directed relationship edges in the nursing knowledge base for elderly breast cancer patients after calculation for the children within 3 degrees;

[0138] (2) The relation set R′ kg Each element is concatenated with commas into a string [relationship set] and inserted into the 'Focus points' section of the prompt word.

[0139] As a specific implementation of the present invention, the prompt word template has the following structure:

[0140] Scenario: Answering questions before and after surgery for elderly breast cancer patients

[0141] Reference information: [Knowledge tuple]

[0142] Focus: [Relationship Set]

[0143] Original question: q

[0144] Question after interpreting the original question: llm(pattern ir (N′ kg ,R′ kg ,q))

[0145] Please answer.

[0146] The following is an explanation and introduction of the reply given after the communication of the present invention by comparing it with the conventional reply through a specific embodiment.

[0147] Example 1

[0148] Scenario: Answering questions before and after surgery for elderly breast cancer patients

[0149] Reference information: (Functional exercises of the affected limb, including fist and wrist rotation), (Functional exercises of the affected limb, including elbow flexion), (Fist and wrist rotation, limited time, after returning to the ward), (Elbow flexion, limited time, 3rd day)

[0150] Points to pay attention to: Time relationship

[0151] User's original question: When do you do exercises?

[0152] Question after understanding the original question: When should elderly breast cancer patients do rehabilitation exercises before and after surgery?

[0153] Please answer the question

[0154] 1. Answers from large language models

[0155] The time for postoperative rehabilitation exercises for breast cancer patients varies depending on the movements. If it is a fist-twisting exercise, it should be performed after returning to the ward; if it is an elbow flexion exercise, it can be performed on the third day after surgery. Functional exercises for the affected limb include fist-twisting and elbow flexion. When performing rehabilitation exercises, you should pay attention to the doctor's advice and guidance, arrange the exercise time and intensity reasonably according to your own physical recovery, pay close attention to the body's reaction, and report to the doctor in time if you feel any discomfort.

[0156] 2. Answers that do not follow the above series of processes

[0157] (1) The time for doing exercises usually varies depending on the situation. If it is in school, it is usually done during the morning break, usually between the second and third classes, around 9:30 to 10:30.

[0158] (2) If it is in the workplace, some units may organize employees to do work breaks around 10 a.m. or 3 or 4 p.m. to relieve fatigue and improve work efficiency.

[0159] (3) If you are doing daily exercise, the time is more flexible and can be arranged according to your own schedule, such as after getting up in the morning, after dinner, etc. In which scenario did you ask about the time for exercise?

[0160] Example 2

[0161] Question: When should breast cancer patients do rehabilitation exercises after surgery?

[0162] Intent: The questioner wants to obtain information on the specific time points for breast cancer patients to perform rehabilitation exercises after surgery

[0163] Reference knowledge graph: (Functional exercise of the affected limb, -> including, fist and wrist rotation), (Functional exercise of the affected limb, -> including, elbow flexion), (fist and wrist rotation, -> time limit, after returning to the ward), (elbow flexion, -> time limit, 3rd day)

[0164] Task: You are a professional oncology nurse. Please answer this question based on the reference knowledge graph. 1. Use the large language model to answer the prompt words and form the answer:

[0165] Hello, the time nodes for breast cancer patients to perform rehabilitation exercises after surgery are as follows:

[0166] (1) The fist-clenching and wrist-twisting exercise can be performed after returning to the ward. The fist-clenching and wrist-twisting exercise mainly helps promote blood circulation in the affected limb and prevents thrombosis. The patient can gently clench his fist, then release it, repeating this exercise while rotating his wrist.

[0167] (2) Elbow flexion can be performed on the third day after surgery. The elbow flexion should be performed slowly to avoid excessive force and to prevent pulling on the wound.

[0168] When doing rehabilitation exercises, you must pay attention to gradual progress. If you feel uncomfortable, stop in time and inform the medical staff. At the same time, patients should strictly follow the instructions of doctors and nurses to exercise to ensure the rehabilitation effect and safety.

[0169] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for elderly breast cancer patients to communicate using a portable intelligent speaker, characterized in that: The specific steps are: S1 defines the knowledge base and the parameters and logical relationships in the knowledge base, and builds a hybrid knowledge base of vector database and graph database. S2 defines the model and its parameters and logical relationships, and uses the large language model to standardize user questions, search for background information, and enhance questions; S3 answers user questions through vector search and graph search modes in the hybrid knowledge base.

2. The method for elderly breast cancer patients to communicate using portable intelligent speakers using question and answer according to claim 1, characterized in that: In S1, the storage method of the hybrid knowledge base is to store entity names and entity relationship names in the vector database, and the relationship between entities in the graph database; when building a hybrid knowledge base, the following definitions are included: (1) Collection of entity names The set of all actual relationship names (2) The set of all directed relationship edges (3) A partial function represents the relationship between all the connections (4) A total function brt encodes any name into an n-dimensional vector V, that is, brt:N∪R→V. Then a knowledge base kg is a four-tuple kg=(n,e,ρ,brt), 3. The method for elderly breast cancer patients to communicate using portable intelligent speakers using question and answer according to claim 2, characterized in that: In S2, the specific steps of question standardization are: (1) Establishing a large language model Define the large language model as llm, the user question as q, the input prompt word of the large language model as p, and the answer of the large language model as r, that is, The large language model is defined as the answer to any question: llm:S→S; (2) Separate entities and relationships Use the large language model LLM to decompose the entities and relations of user questions, and use a prompt word template pattern dt After embedding the user's question, the large language model is called, where the pattern dt :S→S, this process is That is, the large language model llm is required to return two sets The question entity set and the question relationship set; (3) Standardize entities and relationships It includes two parts: encoding and query. The encoding is to use the full function brt to encode each element in the entity set and the relationship set. The specific formula of the encoding is: V nq ={brt(n)|n∈N q },V rq ={brt(r)|r∈R q } Among them, V nq To encode the disassembled entity set, N q is the entity set after disassembly, R q is the set of relations after disassembly, V rq To encode the disassembled relation set; The query is coded in the elderly breast cancer patient care knowledge base pkg N kg 、E kg In the query, similar entities and relationships are queried. For each element, the three results with the lowest difference are queried. The difference is calculated using the Euclidean distance, where E kg is the set of all directed edges in the nursing knowledge base for elderly breast cancer patients, N kg A collection of entity names in the knowledge base for nursing care of elderly breast cancer patients; (4) Intent Recognition Use the large language model LLM to identify the user's question intent and use a prompt word template pattern ir Embed user questions, entities and relations after entity standardization, and call the large language model to complete the questions. This process is recorded as llm (pattern ir (N′ kg ,R′ kg ,q)), where pattern ir :N×R×S→S.

4. The method for elderly breast cancer patients to communicate using portable intelligent speakers using question and answer according to claim 3, characterized in that: The query steps in step (3) of S2 are: (1) Let V nkg ={brt(n)|n∈N kg },u∈V nkg ,u=<u1,u2,…u n >,v∈V nq ,v=<v1,v2,…v n >, where V nkg is the entity set encoded in the knowledge base kg, and u is V nkg A subset of u1,u2,…u n is the node in u, V nq To encode the entity set after disassembly, v is V nq A subset of v1, v2, … v n is a node in v; (2) Using the difference function d, the input is two vectors of equal length and the output is their real distance, that is: (3) All N q Perform the following operations on all elements in to obtain a distance set Dt, namely Dt n ={((u,v),d(u,v))|(u,v)∈V nq ×V nkg } Screen three N for each v kg The elements with the lowest difference form a subset of After encoding, the encoded subset Dt′ is obtained r ; (4) According to Dt′ n , Dt′ r To N kg , R kg Screening is performed to form two screened subsets N′ kg , R′ kg , there exists n∈N′ kg So that brt(n)∈{t(1)(2)|t∈Dt′ n }.

5. The method for elderly breast cancer patients to communicate using portable intelligent speakers using question and answer according to claim 3, characterized in that: In step (2) of S2, the prompt word template pattern dt include: (1) Scenario: Answering questions before, after, and during the recovery period for elderly breast cancer patients (2) Task: Perform entity recognition and relationship recognition in the knowledge graph scenario for the user’s question, and return two sets, one is the entity set and the other is the relationship set. (3) User questions: Ask specific questions; The prompt word template pattern of step (4) of S2 ir include: (1) Scenario: Answering questions before and after surgery for elderly breast cancer patients; Reference terms and relations: {rehabilitation exercises, time nodes, breast cancer surgery, time relations} (2) Task: Identify the user's question intention, complete the incomplete verbs and nouns in the user's question, and give the completed question; (3) User questions: Ask specific questions.

6. The method for elderly breast cancer patients to communicate using portable intelligent speakers using question and answer according to claim 1, characterized in that: The background information search adopts a breadth-first algorithm, including searching the elderly breast cancer patient care knowledge base pkg to form a sub-graph pkg′=(N sub ,E sub ,ρ,brt), for each node n∈N′ kg Search its descendants within 3 degrees, filtering with entities only.

7. The method for elderly breast cancer patients to communicate using portable intelligent speakers using question and answer according to claim 6, characterized in that: The steps of searching for its descendants within 3 degrees and filtering only entities include: (1) Initialization, Processing, where Defined as the initial set of entity names in the elderly breast cancer patient care knowledge base in a subgraph, N′ kg It is defined as a set of entity names in the knowledge base of nursing care for elderly breast cancer patients in the subgraph; (2) Define i∈(1,2,3), according to the formula To filter, where i is a parameter, is the set of entity names in the i-th generation elderly breast cancer patient care knowledge base, is the set of entity names in the i-1 generation elderly breast cancer patient care knowledge base; (3) The entities and edges between subgraphs are defined as follows: E sub =N sub ×N sub ∩E kg N sub The set of entity names in the nursing knowledge base for elderly breast cancer patients after calculation for the 3-degree descendant, E sub The set of edges of all directed relationships in the elderly breast cancer patient care knowledge base after calculation for the 3-degree descendants.

8. The method for elderly breast cancer patients to communicate using portable intelligent speakers using question and answer according to claim 1, characterized in that: The question enhancement is to use the large language model to answer the background information knowledge base pkg′ of the elderly breast cancer patients’ questions, and integrate it into two information points as the background information for the large language model to answer the user’s questions; Specifically include: (1) Knowledge tuple T, each element is concatenated with commas into a string [knowledge tuple], and then inserted into the "reference information" section of the prompt template; define T = {(n1,ρ(n1,n2),n2)|(n1,n2)∈E sub }, where (n1, n2) is a combination of two ordered positions, ρ is a partial function of the relationship of all connections, E sub is the set of all directed relationship edges in the nursing knowledge base for elderly breast cancer patients after calculation for the children within 3 degrees; (2) The relation set R′ kg Each element of is concatenated with commas into a string [relationship set], which is inserted into the 'Focus points' section of the prompt word.

9. The method for elderly breast cancer patients to communicate using portable intelligent speakers through question and answer according to claim 8, characterized in that: The structure of the prompt word template for question enhancement includes: (1) Scenario: Answering questions before and after surgery for elderly breast cancer patients (2) Reference information: [Knowledge tuple] (3) Focus: [Relationship Set] (4) Original question: q (5) Questions after interpreting the original question: llm(pattern ir (N′ kg ,R′ kg ,q)) (6) Please provide your answer.

10. A portable smart speaker, characterized in that: The invention comprises a memory and a computer program, which can be executed by one or more processors and can be used to implement the method for elderly breast cancer patients to communicate by using a portable smart speaker through question and answer as described in any one of claims 1 to 9.