Method for determining the logic of dialogue sentences and non-transitory computer-readable media
The method enhances Alzheimer's Disease detection by generating a language defect report and using vector concatenation to improve the accuracy of logical judgment in dialogue sentences, addressing the limitations of existing models.
Patent Information
- Application Number
- TW113122447
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2026-07-11
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Existing deep learning models for Alzheimer's Disease detection focus on local low-order features within single utterances, limiting the ability to model patient-level tasks and lacking interpretability, while neglecting the global high-order representations needed for dialogue hierarchy descriptions.
A method involving a large language model to generate a language defect report, followed by an embedding model to create vectors, and a pre-trained model to concatenate these vectors, enhancing the detection of logical issues in dialogue sentences.
Improves the accuracy of downstream models by providing a comprehensive language defect report and logical judgment, enabling quick detection of language defects in dialogue without relying on speech data.
Smart Images

Figure IMG-2_DRAW_113122447-A0304-14-0001-1 
Figure IMG-2_DRAW_113122447-A0304-14-0002-2 
Figure IMG-2_DRAW_113122447-A0304-14-0003-3
Abstract
Description
Technical Field
[0001] This invention relates to language analysis, and in particular to a method for determining the logic of dialogue sentences and non-transient computer-readable media. Prior Technology
[0002] Recent deep learning models have been used to learn latent language patterns from verbatim transcripts. Convolutional Neural Networks (CNNs) and Bidirectional Long Short-Term Memory (BLSTM) architectures have demonstrated discriminative capabilities, while BERT-like models (BERT stands for Bidirectional Encoder Representations from Transformers) have further improved Alzheimer's Disease (AD) detection using fine-tuning techniques. These transcript-based detection methods involve less sensitive data than speech, which carries a lower risk of identity leakage. However, the detection of language defects is limited because past research has focused only on language patterns within a single utterance used for feature extraction, rather than from the perspective of understanding the entire dialogue. For example, identified local low-order features, such as pauses and punctuation, can only characterize defects in a disjointed spoken expression. Local low-order feature representations limit the ability to model patient-level AD detection tasks, biasing predictive models and limiting interpretability. There is a research gap in generating global high-order representations for systematically summarizing dialogue hierarchy descriptions. Summary of the Invention
[0003] In view of this, the present invention proposes a method for judging the logic of dialogue sentences, thereby solving the above problems.
[0004] A method for determining the logic of a dialogue sentence according to an embodiment of the present invention includes, executed by a processor: executing a large language model to generate a language defect report based on a dialogue text and a prompt text; executing an embedding model to generate a first vector based on the language defect report; executing a pre-trained language model to generate a plurality of second vectors based on a dialogue text; executing the pre-trained language model to concatenate each of the plurality of second vectors with the first vector; and executing the pre-trained language model to generate a logical judgment result based on each of the plurality of second vectors concatenated with the first vector.
[0005] According to an embodiment of the present invention, a non-transitory computer-readable medium is used to store a plurality of instructions, which, when executed by a processor, cause a plurality of operations, the plurality of operations including: executing a large language model to generate a language defect report based on a dialogue text and a prompt text; executing an embedding model to generate a first vector based on the language defect report; executing a pre-trained language model to generate a plurality of second vectors based on a dialogue text; executing a pre-trained language model to concatenate each of the plurality of second vectors with the first vector; and executing a pre-trained language model to generate a logical judgment result based on each of the plurality of second vectors concatenated with the first vector.
[0006] In summary, the core concept of this invention is to enhance textual input information using a large-scale language model for downstream tasks. To this end, this invention proposes a language defect report generation and a performance-enhanced embedding summarization embedder. The performance-enhanced embedding improves the accuracy of downstream machine learning models, while the language defect report explains the logical problems of participants. The model and method proposed in this invention can quickly detect the logicality of participants' sentences, requiring only a text-based dialogue as input. The output of this invention is a logical judgment result with a language defect report.
[0007] The foregoing description of the disclosure and the following description of the embodiments are intended to demonstrate and explain the spirit and principles of the present invention, and to provide a further explanation of the scope of the patent application of the present invention. Simple Explanation of the Diagram
[0008] Figure 1 is a model architecture diagram for judging the logic of dialogue sentences according to an embodiment of the present invention; Figure 2 is an internal architecture diagram of a summary embedder according to an embodiment of the present invention; Figure 3 is an internal architecture diagram of a pre-trained language model according to an embodiment of the present invention; Figure 4 is a flowchart illustrating a method for determining the logic of dialogue sentences according to an embodiment of the present invention; and Figure 5 is an architecture diagram of a system for judging the logic of dialogue sentences according to an embodiment of the present invention. Implementation
[0009] The following detailed description of the features and advantages of the present invention is sufficient to enable anyone skilled in the art to understand the technical content of the present invention and implement it accordingly. Based on the disclosure, patent claims, and drawings in this specification, anyone skilled in the art can easily understand the relevant objectives and advantages of the present invention. The following embodiments further illustrate the points of the present invention, but are not intended to limit the scope of the present invention in any way.
[0010] Figure 1 is a model architecture diagram for judging the logic of dialogue sentences according to an embodiment of the present invention. As shown in Figure 1, this model includes a summary embedding unit 1 and a pre-trained language model 3. The summary embedding unit 1 generates a first vector h0 based on the dialogue text D and the prompt text P, and the pre-trained language model 3 generates a judgment result R based on the dialogue text D and the first vector h0.
[0011] Figure 2 is an internal architecture diagram of a summary embedding unit 1 according to an embodiment of the present invention. As shown in Figure 2, the summary embedding unit 1 includes a large language model 12 and an embedding model 14. The large language model 12 generates a language defect report L based on the dialogue text D and the prompt text P. The embedding model 14 generates a first vector h0 based on the language defect report L.
[0012] Figure 3 is an internal architecture diagram of a pre-trained language model 3 according to an embodiment of the present invention. As shown in Figure 3, the pre-trained language model 3 includes an embedding model 32, a concatenation function 34, and a dense layer 36. The embedding model 32 generates multiple second vectors h1, h2, and h3 based on the dialogue text D; in other words, it performs sentence embedding operations. In one embodiment, the transformer DNN architecture can be used to implement the embedding model 32. The concatenation function 34 is used to concatenate a first vector h0 after each of the second vectors h1, h2, and h3. The dense layer 36 generates a judgment result R based on these second vectors h1, h2, and h3 concatenated with the first vector h0.
[0013] Figure 4 is a flowchart illustrating a method for determining the logic of a dialogue sentence according to an embodiment of the present invention, including steps S1 to S5. These steps can be stored in a non-transitory computer-readable medium in the form of multiple instructions, which are used to cause multiple operations when executed by a processor.
[0014] In step S1, the processor executes a Large Language Model (LLM) 12 to generate a Linguistic Deficits Profile (LMP) based on the dialogue text D and the prompt text P. In one embodiment, the Large Language Model 12 uses the gpt-35-turbo engine provided by Azure OpenAI, a sophisticated and easily accessible chatbot. In one embodiment, both the dialogue text D and the prompt text P are obtained before executing the method for judging the logic of the dialogue sentences.
[0015] The dialogue text D can be a text file pre-stored in a storage device, loaded by the processor as input to the large language model 12. In one embodiment, the dialogue text D is a verbatim transcript comprising multiple sentences, each beginning with a speaker identifier; Table 1 below is an example of dialogue text D.
[0016] Table 1, Example of Dialogue Text D. Investigator: Okay. Investigator: This is a picture. Participants: All actions. Participant: Uh, I'll start telling you. Investigator: Just say it. Participant: The mother is wiping the dishes. Participant: The sink is clogged, water is overflowing and splashing onto the floor. Participant: A boy falls off a stool and grabs cookies from a cookie jar. Participant: The girl put her finger to her lips, indicating that she would not say it or something similar. Participant: Uh, my shoes are getting my mother wet. Participant: I was looking outside, but I didn't see anything. Participant: It doesn't look like it's snowing. Participants: Not much to say. Participant: All I saw was water overflowing and the boy falling off the stool. Investigator: Okay, no problem. Participant: I don't know if snow is an action. Participant: I didn't see it snowing. Participant: It looks very bright outside. Investigator: Okay. Participant: I don't know.
[0017] The prompt text P can be a text file pre-stored in a storage device, loaded by the processor as input to the large language model 12. In one embodiment, the prompt text includes four parts: an instruction specifying the object designated in the dialogue text D and the scenario involved in the dialogue text D; a description of language defect attributes describing multiple language defect problems and multiple definitions associated with the multiple language defect problems; notification constraints specifying the allowed and prohibited operations of the large language model 12; and format constraints specifying the output format of the language defect report L, including multiple items corresponding to the multiple language defect problems. The design of the above four parts restricts the output format of the LLM to ensure the quality of the language defect report L. Regarding the second part, the description of language defect attributes, special emphasis is placed on the categories of clinically relevant information. In previous studies, language defects have been identified as some measurable tasks, including anomia, speech incoherence, and agrammatism. However, these attributes may not be comprehensive enough for generating the language defect report L. In this case, the present invention extends these measurable tasks, introduces 13 language defect attributes, and queries the LLM to obtain precise definitions of the attributes. Derived attributes include: empty talk, diminishing rhetoric, roundabout rhetoric, word / phrase revisions, word / phrase repetitions, telegraphic rhetoric, misuse of pronouns, poor grammar, hesitation and pauses, lack of narrative coherence, limited recall of details, simplified sentence structures, and difficulty in organizing descriptions. Table 2 below is an example of a prompt text P.
[0018] Table 2 shows an example of the prompt text P. Instructions for use: The dialogue text is a conversation between a participant (PAR) and an investigator (INV). You need to detect whether the participant exhibits language deficiencies as defined below. Analyze the provided dialogue to determine if the PAR displays any language deficiency issues. If problems are found, fill in the corresponding information in the response form. If not, leave the form blank. Only analyze the content appearing in the dialogue; do not involve psychological definitions. Keep the summary brief and accurate. Language defect attribute description: 1. Empty talk Definition: A powerful expression that lacks meaningful information. 2. Gradually weakening words Definition: Dropped words, the last few words of a sentence are almost inaudible. 3. Indirect language Definition: A roundabout word or concept in a discourse, where it is difficult to find a suitable word, leading to a pause or roundabout expression. 4. Word / Phrase Revision: Definition: To check and change individual words or phrases in written content. 5. Word / phrase repetition: Definition: Using the same words or phrases multiple times within a short period of time. 6. Telegraphic language: Definition: A concise and refined form of communication that retains only basic words, similar to the concise expressions in telegrams. 7. Incorrect use of pronouns: Definition: The incorrect use of pronouns in a sentence may lead to confusion or ambiguity regarding the intended subject or object. 8. Grammatical errors: Definition: Incorrect or non-standard use of language rules and structures. 9. Hesitation and pauses: Definition: Speech is frequently interrupted, with pauses or hesitations. 10. Lack of narrative coherence: Definition: This refers to a story lacking clarity, logical progression, or coherent structure. It makes it difficult to organize descriptions logically and coherently, disrupting the flow of the narrative. 11. Limited memory of details: Definition: Difficulty in remembering and expressing specific details. 12. Simplified sentence structure: Definition: Using simple and direct sentence structures, typically shorter and clearer syntax. 13. Difficult to organize and describe: Definition: Difficulty in coherently and logically arranging information or events when providing a narrative or description of events. This difficulty may result in a disjointed or fragmented story, making it difficult for the listener to follow the sequence of events. Notification constraints: The summary should be consistent with the questions detected in the answer sheet. You should only analyze what appears in the dialogue, not anything in the definition of language defects. The resulting analysis should be traceable back to the conversation. You should not fabricate additional content that does not exist in the conversation. Keep the summary concise and accurate. Please fill in the 13 questions in the table below and paste the sentences from the dialogue that you think have this attribute into the following format: If you do not detect any issues, please leave the following blank: Formatting constraints: Problem detection results: empty talk Weakening words roundabout language Word / phrase revision: Word / phrase repetition: Telegraphic language: Incorrect use of pronouns: Grammatical errors: Hesitation and pause: The narrative lacks coherence. My memory of the details is limited. Simplified sentence structure: Difficult to describe in an organized manner: summary:
[0019] In one embodiment, to ensure a stable response, after sending the prompt text P as shown in Table 2, the processor submits a follow-up prompt "Please answer the form" to ensure that the output format of the large language model 12 meets expectations and to obtain the final language defect report L. Table 3 shows examples extracted from the language defect report L. Many hesitations and pauses are detected because "uh" frequently appears in the dialogue. Lack of coherence in the narrative can be judged from the dialogue. The sentence "I don't know" indicates that the participant has limited memory of details. In addition, as can be seen from the examples in Table 3, the output of the large language model 12 includes: "Example" is the detected sentence directly extracted from the dialogue text D, and "Description" is the explanation given by the large language model 12 for detecting this language defect attribute.
[0020] Table 3, Example of a language deficiency report. Hesitation and pause example: Uh, I'll start telling you now. Uh, Mother's shoes are getting wet. I have no idea. The narrative lacks coherence describe: The description seems disjointed and fragmented. Limited memory of details example: I don't know if snow is a movement. I didn't see it snowing.
[0021] In step S2, the processor executes embedding model 14 to generate a first vector h0 based on the language defect report L. In one embodiment, embedding model 14 is text-embedding-ada-002, a text embedder used to generate 1536-dimensional attribute embeddings. , where 1536 is the preset dimension of text-embedding-ada-002; Because there are 14 fields in the format constraint. Then, max pooling is performed on these attribute embeddings, and a dense layer (size 512) is connected to obtain the first vector. ,in The above process selects the most prominent attribute from all attribute embeddings and transforms them into a more compact feature representation. In other embodiments, the model architecture of embedding model 14 is a transformer.
[0022] In step S3, the processor executes the embedding model 32 in the pre-trained language model to generate multiple h1, h2, and h3 vectors based on the dialogue text D. Please refer to Figure 2 and Table 1. The pre-trained language model 3 is associated with Bidirectional Encoder Representations from Transformers (BERT) and uses the configuration provided by HuggingFace. In one embodiment, the pre-trained language model 3 uses the AdamW optimizer with a learning rate of 2e-5 and is trained for 4 epochs. In one embodiment, ALBERT: A Lite BERT for Self-supervised Learning of Language Representations is used as the backbone to process the tokenized textual input obtained from the verbatim transcript (i.e., the dialogue text D), namely the second vectors h1, h2, and h3. The ALBERT network is a highly efficient BERT-like model with enhanced capabilities for handling long paragraphs.
[0023] In step S4, the processor executes the concatenation function 34 in the pre-trained language model 3 to concatenate the first vector with each second vector. Specifically, for each second vector... ,in The concatenation function 34 concatenates the first vector h0 to each of the second vectors h1, h2 and h3, as shown in Figure 3. This enhances the feature space in a way that is based on personal report perception.
[0024] In step S5, the processor executes a dense layer 36 in the pre-trained language model to generate a logical judgment result R based on each of the first vectors concatenated with the second vector. In one embodiment, two dense layers 36 are used, with sizes of 640 and 2, respectively, ultimately outputting a logical judgment result R for each sentence: logically normal or logically abnormal.
[0025] In one embodiment, after step S5, based on the logical judgment result R of all sentences, a majority vote can be used to determine whether the participant is logically normal or logically abnormal, thereby further inferring whether the participant has Alzheimer's disease.
[0026] Figure 5 is an architecture diagram of a system for determining dialogue sentence logic according to an embodiment of the present invention. As shown in Figure 5, the system 100 for determining dialogue logic includes a storage device 50 and a processor 70.
[0027] Storage device 50 is used to store the aforementioned non-transitory computer-readable media. In one embodiment, storage device 50 may be implemented using at least one of the following: flash memory, hard disk drive (HDD), solid-state drive (SSD), dynamic random access memory (DRAM), static random access memory (SRAM), or other non-volatile memory. However, the present invention is not limited to the above examples.
[0028] Processor 70 is electrically connected to storage device 50 to load a plurality of instructions recorded in a non-transitory computer-readable medium, thereby executing the method for determining dialogue sentence logic as described in an embodiment of the present invention. In one embodiment, processor 70 may be at least one of the following: personal computer, network server, central processing unit (CPU), graphics processing unit (GPU), microcontroller (MCU), application processor (AP), field programmable gate array (FPGA), application specific integrated circuit (ASIC), system-on-a-chip (SOC), deep learning accelerator, or any electronic device with similar functionality; the present invention does not limit the hardware type of processor 70.
[0029] In summary, the core concept of this invention is to enhance textual input information using a large-scale language model for downstream tasks. To this end, this invention proposes a language defect report generation and a performance-enhanced embedding summarization embedder. The performance-enhanced embedding improves the accuracy of downstream machine learning models, while the language defect report explains the logical problems of participants. The model and method proposed in this invention can be used to quickly detect the logicality of participants' sentences, requiring only a text-based dialogue as input. The output of this invention is a logical judgment result with a language defect report.
[0030] While the present invention has been disclosed above with reference to the foregoing embodiments, it is not intended to limit the invention. Any modifications and refinements made without departing from the spirit and scope of the invention are within the scope of patent protection of the present invention. For details regarding the scope of protection defined in the present invention, please refer to the appended claims.
[0031] S1-S5: Steps 1: Summary Embedder 12: Large-scale language models 14: Embedded Model 3: Pre-trained language model 32: Embedded Model 34: Concatenation function 36: Dense Layer 50: Storage device 70: Processor 100: A system for judging the logic of dialogue sentences h0: First vector h1, h2, h3: Second vector D: Dialogue Text P: Prompt Text L: Language Deficiency Report R: Judgment result
Claims
1. A method for determining the logic of dialogue sentences, comprising executing, on a processor: executing a large language model to generate a language defect report based on a dialogue text and a cue text; executing an embedding model to generate a first vector based on the language defect report, wherein the embedding model generates multiple attribute embeddings, performs max pooling on the attribute embeddings, and connects them to a dense layer to generate the first vector; executing a pre-trained language model to generate multiple second vectors based on multiple sentences in the dialogue text; executing the pre-trained language model to concatenate the first vector with each of the second vectors; and executing the pre-trained language model to generate a logic judgment result corresponding to one of the sentences based on each of the second vectors concatenated with the first vector; wherein the cue text includes: An operation description is provided to specify the objects in the dialogue text and the scenarios involved in the dialogue text; a language defect attribute description is provided to describe multiple language defect issues and multiple definitions associated with these language defect issues; a notification constraint is provided to specify the allowed and prohibited operations of the large language model; and a format constraint is provided to specify the output format of the language defect report, including multiple items corresponding to these language defect issues.
2. The method for determining the logic of dialogue sentences as described in claim 1, wherein the pre-trained language model is associated with a transducer-based bidirectional encoder representation technique.
3. The method for determining the logic of dialogue sentences as described in Request 1, wherein the embedding model is text-embedding-ada-002.
4. The method for determining the logic of dialogue sentences as described in Request 1, wherein the large language model is the gpt-35-turbo engine.
5. A non-transitory computer-readable medium for storing a plurality of instructions, which, when executed by a processor, cause a plurality of operations, including: Execute a large language model to generate a language defect report based on a dialogue text and a prompt text; An embedding model is executed to generate a first vector based on the language defect report, wherein the embedding model generates multiple attribute embeddings, performs max pooling on the attribute embeddings, and connects them to a dense layer to generate the first vector; a pre-trained language model is executed to generate multiple second vectors based on multiple sentences in the dialogue text; the pre-trained language model is executed to concatenate the first vector with each of the second vectors; and the pre-trained language model is executed to generate a logical judgment result corresponding to one of the sentences based on each of the concatenated second vectors; wherein the prompt text includes: an operation instruction for specifying the object specified in the dialogue text and the scenario involved in the dialogue text; a language defect attribute description for describing multiple language defect issues and multiple definitions associated with the language defect issues; a notification constraint for specifying the operations allowed and prohibited by the large language model; and a format constraint for specifying the output format of the language defect report, including multiple items corresponding to the language defect issues.
6. The non-transitory computer-readable medium as described in claim 5, wherein the pre-trained language model is associated with a transducer-based bidirectional encoder representation technique.
7. The non-transitory computer-readable media as described in claim 5, wherein the embedding model is text-embedding-ada-002.
8. The non-transitory computer-readable media as described in claim 5, wherein the large language model is the gpt-35-turbo engine.