A text large model illusion alleviating method, device, equipment and medium

By acquiring updated document data, preprocessing it, extracting knowledge triples and storing them in a graph database, and using queries for entity recognition and concatenation to generate responses, the problem of the inability to update in real time after training a large text model is solved, achieving efficient hallucination relief and accurate responses.

CN117992584BActive Publication Date: 2026-05-12UNISOUND SHANGHAI INTELLIGENT TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNISOUND SHANGHAI INTELLIGENT TECH CO LTD
Filing Date
2023-12-23
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

The parameters of existing large text models are fixed after training and cannot be updated in real time, which leads to the illusion of generating false or outdated information. Furthermore, retraining is costly and makes it difficult to update knowledge efficiently.

Method used

By acquiring updated document data, preprocessing it, extracting knowledge triples and storing them in a graph database, and using user-input queries for entity recognition and retrieval, the system can generate response results by concatenating the data, thus avoiding the need to retrain a large text model.

Benefits of technology

Without retraining a large text model, it effectively alleviates the illusion problem, generates fact-related correct responses, and improves the timeliness and accuracy of information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117992584B_ABST
    Figure CN117992584B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of text large model hallucination mitigation method, device, equipment and medium, the method comprises: obtaining updated document data;The updated document data is preprocessed;Extract knowledge triple from preprocessed document data;Knowledge triple is stored in graph database;Obtain the Query input by user, and the entity recognition of Query;In graph database, corresponding entity node and the content associated with entity are retrieved;The corresponding entity node and the content associated with entity are spliced to obtain Prompt, and Prompt is spliced with Query;The splicing of Prompt and Query is used as the input of text large model, and the response result is generated.The present application relies on the reasoning ability of text large model to selectively understand the information retrieved, and finally outputs the correct fact-related content, effectively mitigates the hallucination problem of text large model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of model illusion relief technology, specifically to a method, apparatus, device, and medium for relieving large model illusions in text. Background Technology

[0002] Triples are a structured representation method in knowledge graphs, used to organize and present knowledge in the real world. They represent knowledge as a graph, where entities and relations are the nodes and edges. Large text models are currently a popular technique, a method for modeling objective world knowledge using a massive Transformer Decoder structure. This method uses text generation techniques to achieve various text understanding and text generation tasks, including question answering.

[0003] Currently, once a large text model is trained, its parameters are fixed and cannot be updated in real time. Therefore, when users ask questions about time-sensitive tasks, it cannot generate the correct response. The training cost of large text models is high, and it is not practical to retrain them by feeding in the latest knowledge. Therefore, how to efficiently update knowledge and avoid the phenomenon of large text models generating false or outdated information is the main problem that needs to be solved. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and medium for alleviating large text model hallucinations, which can solve the above-mentioned technical problems.

[0005] In a first aspect, embodiments of the present invention provide a method for alleviating large-scale textual hallucinations, including:

[0006] Retrieve updated document data;

[0007] Preprocess the updated document data;

[0008] Extract knowledge triples from preprocessed document data;

[0009] Store the knowledge triples in a graph database;

[0010] Obtain the query input by the user and perform entity recognition on the query;

[0011] Retrieve the corresponding entity nodes and their associated content from the graph database;

[0012] The corresponding entity node and the content associated with the entity are concatenated to obtain the Prompt, and the Prompt is concatenated with the Query.

[0013] The concatenation of Prompt and Query is used as input to a large text model to generate response results.

[0014] Furthermore, in the aforementioned method for mitigating large-scale textual illusions, the updated document data undergoes preprocessing, including:

[0015] Perform data cleaning, deduplication, and sensitive information filtering on the updated document data.

[0016] Furthermore, in the aforementioned method for alleviating hallucinations in a large text model, knowledge triples are extracted from the preprocessed document data, including:

[0017] The preprocessed document data is used as the input text set, and the elements in the text set are encoded and mapped to the latent state space;

[0018] The GPlinker information extraction algorithm is used to identify and extract entities and relationships between entities from text data to obtain knowledge triples.

[0019] Furthermore, in the aforementioned method for alleviating the illusion of a large text model, the knowledge triples are stored in a graph database, including:

[0020] Create a graph space in the graph database Nebula, define the schema for knowledge triples, and store the knowledge triples in the graph database.

[0021] Furthermore, in the aforementioned method for alleviating hallucinations in a large text model, obtaining the user-input query and performing entity recognition on the query includes:

[0022] The query is transformed into a latent state space using the pre-trained language model BERT.

[0023] The hidden state space is computed using the CRF algorithm, and the state at each position is transformed into the probability of the beginning, the middle of an entity, the end of an entity, and a non-entity.

[0024] Furthermore, in the aforementioned method for mitigating the illusion of a large text model, the corresponding entity nodes and their associated content are retrieved from the graph database, including:

[0025] Using nGQL statements in a graph database, you can retrieve results for entity nodes with one or more hops.

[0026] Furthermore, in the aforementioned method for alleviating the illusion of a large text model, the concatenation of Prompt and Query is used as input to the large text model to generate response results, including:

[0027] Formalize the concatenation of Prompt and Query;

[0028] The text big model encodes the formal representation to obtain the hidden layer representation;

[0029] Based on the encoding structure of the large text model, output the hidden layer representation;

[0030] Based on the hidden layer representation, the maximum generation probability of words in the vocabulary at each time step is calculated, and the word with the highest probability value in the probability distribution is taken as the response generation result at the current time step.

[0031] Secondly, embodiments of the present invention also provide a text-based large model illusion relief device, comprising:

[0032] The retrieval module is used to retrieve updated document data.

[0033] Preprocessing module: Used to preprocess the updated document data;

[0034] Extraction module: Used to extract knowledge triples from preprocessed document data;

[0035] Storage module: Used to store knowledge triples in a graph database;

[0036] Entity recognition module: used to obtain the query input by the user and perform entity recognition on the query;

[0037] The retrieval module is used to retrieve the corresponding entity nodes and related content from the graph database.

[0038] The concatenation module is used to concatenate the extracted entity nodes and the content associated with the entities to obtain the Prompt, and then concatenate the Prompt with the Query.

[0039] Input module: Used to take the concatenation of Prompt and Query as input to the large text model and generate response results.

[0040] Thirdly, embodiments of the present invention also provide an electronic device, including: a processor and a memory;

[0041] The processor executes any of the text-based large model illusion mitigation methods described above by calling programs or instructions stored in the memory.

[0042] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a program or instructions that cause a computer to execute any of the textual large model illusion relief methods described above.

[0043] The beneficial effects of this invention are as follows: This invention acquires updated document data; preprocesses the updated document data; extracts knowledge triples from the preprocessed document data; stores the knowledge triples in a graph database; acquires the user-input query and performs entity recognition on the query; retrieves the corresponding entity nodes and related content from the graph database; concatenates the retrieved entity nodes and related content to obtain a Prompt; concatenates the Prompt with the query; and uses the concatenation of the Prompt and query as input to a large text model to generate response results. This invention updates knowledge by establishing knowledge triples, then performs named entity recognition on the user-input query, retrieves relevant information about entity nodes from the knowledge triples, and concatenates them as a Prompt. This allows for the output of correct, fact-related content without requiring retraining and fine-tuning of the large text model, effectively alleviating the problem of factual illusions that are prone to occur in large text models. Attached Figure Description

[0044] Figure 1 A method for alleviating hallucinations in a large text model provided in this invention. Figure 1 ;

[0045] Figure 2 A method for alleviating hallucinations in a large text model provided in this invention. Figure 2 ;

[0046] Figure 3 A method for alleviating hallucinations in a large text model provided in this invention. Figure 3 ;

[0047] Figure 4 A method for alleviating hallucinations in a large text model provided in this invention. Figure 4 ;

[0048] Figure 5 A diagram of a text-based large-scale model hallucination relief device provided in an embodiment of the present invention;

[0049] Figure 6 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0050] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0051] Figure 1 A method for alleviating hallucinations in a large text model provided in this invention. Figure 1 .

[0052] Firstly, embodiments of the present invention provide a method for alleviating large-scale textual hallucinations, combined with... Figure 1 It includes eight steps, S101 to S108:

[0053] S101: Retrieve updated document data.

[0054] Specifically, in this embodiment of the invention, document data containing updated knowledge is acquired.

[0055] S102: Preprocess the updated document data.

[0056] Specifically, in this embodiment of the invention, the collected document data containing updated knowledge is preprocessed. The preprocessing includes operations such as data cleaning, deduplication, and sensitive information filtering to improve the processing efficiency of the document data.

[0057] S103: Extract knowledge triples from preprocessed document data.

[0058] Specifically, in this embodiment of the invention, the extraction of knowledge triples from preprocessed document data is implemented using the GPlinker extraction algorithm. The specific method is described in detail below.

[0059] S104: Store the knowledge triples in a graph database.

[0060] Specifically, in this embodiment of the invention, storing the knowledge triples in a graph database involves graph storage, the specific method of which is described in detail below.

[0061] S105: Obtain the query input by the user and perform entity recognition on the query.

[0062] Specifically, in this embodiment of the invention, relevant entity content is extracted based on the user input query, and the specific method is described in detail below.

[0063] S106: Retrieve the corresponding entity nodes and related content from the graph database.

[0064] Specifically, in this embodiment of the invention, after entity recognition of the Query, the corresponding triplet is obtained by graph retrieval.

[0065] S107: Extract the corresponding entity node and concatenate the content associated with the entity to obtain the Prompt, and then concatenate the Prompt with the Query.

[0066] Specifically, in this embodiment of the invention, the extracted knowledge triples are concatenated with natural language to obtain the Prompt, and the Prompt is concatenated with the Query with natural language.

[0067] For example, a user query might be: Where was the 2022 conference held?

[0068] Results obtained through step S106:

[0069] {time: 2022; location: Beijing; event: conference held}

[0070] Build and generate Prompt:

[0071] The conference will be held in Beijing in 2022.

[0072] Answer the following questions based on the information above:

[0073] Concatenate Prompt and Query; for example:

[0074] The conference will be held in Beijing in 2022.

[0075] Answer the following questions based on the information above:

[0076] Where was the 2022 conference held?

[0077] S108: Use the concatenation of Prompt and Query as input to the large text model to generate response results.

[0078] Specifically, in this embodiment of the invention, the steps of using the concatenation of Prompt and Query as input to the large text model and generating response results are described in detail below.

[0079] It should be understood that in the large text model, the Prompt serves as background knowledge for the generated content, and the quality of the generated response depends on the quality of the Prompt.

[0080] Furthermore, in the aforementioned method for mitigating large-scale textual illusions, the updated document data undergoes preprocessing, including:

[0081] Perform data cleaning, deduplication, and sensitive information filtering on the updated document data.

[0082] Figure 2 A method for alleviating hallucinations in a large text model provided in this invention. Figure 2 .

[0083] Furthermore, in the aforementioned method for alleviating hallucinations in a large text model, knowledge triples are extracted from the preprocessed document data and combined with... Figure 2 It includes two steps, S201 to S202:

[0084] S201: The preprocessed document data is used as the input text set. The elements in the text set are encoded and mapped to the hidden state space.

[0085] Specifically, in this embodiment of the invention, the preprocessed document data, as the input text set, can be represented as X, where x∈X, x=[x1,x2,…,x…]. n Encode x and then map it to the hidden state space h = [h1, h2, ..., h]. n ],

[0086] h i =f emb (x i ).

[0087] S202: Use the information extraction algorithm GPlinker to identify and extract entities and relationships between entities from text data to obtain knowledge triples.

[0088] Specifically, in this embodiment of the invention, the GPlinker information extraction algorithm is used to identify and extract entities and relationships from text data to obtain knowledge triples, such as entities like people, places, and organizations, and the corresponding relationships between them:

[0089] spo i =GPlinker(h i ).

[0090] Furthermore, in the aforementioned method for alleviating the illusion of a large text model, the knowledge triples are stored in a graph database, including:

[0091] Create a graph space in the graph database Nebula, define the schema for knowledge triples, and store the knowledge triples in the graph database.

[0092] Specifically, in this embodiment of the invention, a graph space is created in the graph database Nebula, and the schema of knowledge triples is defined, that is, the metadata of nodes, edges and their attributes in the graph database is defined, and the extracted spokets are... i Triples are stored in a graph database.

[0093] Figure 3 A method for alleviating hallucinations in a large text model provided in this invention. Figure 3 .

[0094] Furthermore, in the aforementioned method for alleviating hallucinations in a large text model, the user-input query is obtained, entity recognition is performed on the query, and then... Figure 3 It includes two steps, S301 to S302:

[0095] S301: Transform the Query into a latent state space using the pre-trained language model BERT.

[0096] Specifically, in this embodiment of the invention, the user-inputted Query is represented as: q = [q1, q2, ..., q n ], q = [q1, q2, ..., q n The pre-trained language model BERT is transformed into a hidden state space m = [m1, m2, ..., m]. n ]:

[0097] m i =Bert(q) i ).

[0098] S302: Use the CRF algorithm to calculate the hidden state space, and convert the state at each position into the probability of the beginning, the middle of the entity, the end of the entity, and a non-entity.

[0099] Specifically, in this embodiment of the invention, the CRF algorithm is used to calculate m obtained in the hidden state space, and the state at each position is transformed into a probability distribution of the beginning, the middle of the entity, the end of the entity, and the non-entity probability BIEO. The transformation formula is as follows:

[0100]

[0101] Where g represents the predicted target label l i The score is the unnormalized softmax, where k represents the propagation probability between words, π(x) represents the normalization factor, and c i This corresponds to the probability (O) labels for the beginning (B), middle (I), end (E), and non-entity for each state.

[0102] Furthermore, in the aforementioned method for mitigating the illusion of a large text model, the corresponding entity nodes and their associated content are retrieved from the graph database, including:

[0103] Using nGQL statements in a graph database, you can retrieve results for entity nodes with one or more hops.

[0104] Specifically, in this embodiment of the invention, the nGQL statement is used to search the graph database obtained in S104 to obtain the result of one hop or multiple hops for the node.

[0105] The ngQL statement is: MATCH(event: {clause}) RETURN <hop>(eventi);

[0106] Here, clause represents the query condition, event represents the final query result, hop represents the number of hops, onehop means one hop, and multi-hop means multiple hops, meaning the result obtained by searching based on the result retrieved in one hop.

[0107] For example:

[0108] Result of the first jump:

[0109] MATCH(event: {time: "2022"}) RETURN<one hop> ({time: 2022; location: Beijing; event: conference held});

[0110] Two-hop result:

[0111] <multi hop> ({time: 2018; location: Pyeongchang; event: conference held});

[0112] Figure 4 A method for alleviating hallucinations in a large text model provided in this invention. Figure 4 .

[0113] Furthermore, in the aforementioned method for alleviating hallucinations in a large text model, the concatenation of Prompt and Query is used as input to the large text model to generate response results, combined with... Figure 4 It includes four steps, S401 to S404:

[0114] S401: Formalize the concatenation of Prompt and Query.

[0115] Specifically, in this embodiment of the invention, the formal representation is: y = [y1, y2, ..., y n ].

[0116] S402: The text big model encodes the formal representation to obtain the hidden layer representation.

[0117] Specifically, in this embodiment of the invention, the hidden layer representation u = [u1, u2, ..., u] is obtained by encoding using a large text model. n ]:

[0118] u i =g emb (y i )

[0119] S403: Output hidden layer representations based on the encoding structure of the large text model.

[0120] Specifically, in this embodiment of the invention, the hidden layer representation is completed based on the encoding structure of the large text model Transformer Decoder. Output:

[0121]

[0122] in, Let represent the output of the l-th layer of the model at time t. The hidden layer representation of the final output of the model is as follows:

[0123] S404: Based on the hidden layer representation, calculate the maximum generation probability of words in the vocabulary at each time step, and take the word with the highest probability value in the probability distribution as the response generation result at the current time step.

[0124] Specifically, in this embodiment of the invention, based on the hidden layer representation obtained above, the maximum generation probability of words in the vocabulary at each time step is calculated:

[0125]

[0126] Z t =Max(Prob gen )

[0127] Among them, Prob gen Let W represent the probability distribution of each word in the vocabulary, and b be the training parameters. Finally, the word with the highest probability value in the probability distribution is taken as the result of the response generation at that moment.

[0128] Figure 5 This is a diagram of a text-based large-scale model illusion relief device provided in an embodiment of the present invention.

[0129] Secondly, embodiments of the present invention also provide a text-based large-model hallucination relief device, combined with Figure 5 ,include:

[0130] Module 501: Used to retrieve updated document data.

[0131] Specifically, in this embodiment of the invention, the acquisition module 501 acquires the collected document data containing updated knowledge.

[0132] Preprocessing module 502: Used to preprocess the updated document data.

[0133] Specifically, in this embodiment of the invention, the preprocessing module 502 preprocesses the collected document data containing updated knowledge. The preprocessing includes operations such as data cleaning, deduplication, and sensitive information filtering to improve the processing efficiency of subsequent document data.

[0134] Extraction module 503: Used to extract knowledge triples from preprocessed document data.

[0135] Specifically, in this embodiment of the invention, the extraction module 503 extracts knowledge triples from the preprocessed document data using the GPlinker extraction algorithm. The specific method is described in detail below.

[0136] Storage module 504: Used to store the knowledge triples in a graph database.

[0137] Specifically, in this embodiment of the invention, the storage module 504 stores the knowledge triples in the graph database to perform graph storage.

[0138] Entity recognition module 505: Used to obtain the query input by the user and perform entity recognition on the query.

[0139] Specifically, in this embodiment of the invention, the entity recognition module 505 extracts relevant entity content based on the user input Query.

[0140] Search module 506: Used to retrieve the corresponding entity nodes and related content from the graph database.

[0141] Specifically, in this embodiment of the invention, after the retrieval module 506 performs entity recognition on the Query, the corresponding triplet is obtained by graph retrieval.

[0142] The splicing module 507 is used to splice the extracted entity node and the content associated with the entity to obtain the Prompt, and then splice the Prompt with the Query.

[0143] Specifically, in this embodiment of the invention, the splicing module 507 splices the extracted knowledge triples into natural language to obtain a Prompt, and splices the Prompt with the Query into natural language.

[0144] For example, a user query might be: Where was the 2022 conference held?

[0145] Results obtained through retrieval module 506:

[0146] {time: 2022; location: Beijing; event: conference held}

[0147] Build and generate Prompt:

[0148] The conference will be held in Beijing in 2022.

[0149] Answer the following questions based on the information above:

[0150] Concatenate Prompt and Query; for example:

[0151] The conference will be held in Beijing in 2022.

[0152] Answer the following questions based on the information above:

[0153] Where was the 2022 conference held?

[0154] Input module 508: Used to take the concatenation of Prompt and Query as input to the large text model and generate response results.

[0155] Specifically, in this embodiment of the invention, the input module 508 uses the concatenation of Prompt and Query as input to the large text model to generate response results.

[0156] Thirdly, embodiments of the present invention also provide an electronic device, including: a processor and a memory;

[0157] The processor executes a text-based large model illusion mitigation method as described above by invoking programs or instructions stored in the memory.

[0158] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a program or instructions that cause a computer to execute any of the above-mentioned methods for alleviating the illusion of a large text model.

[0159] Figure 6 This is a schematic block diagram of an electronic device provided in an embodiment of this disclosure.

[0160] like Figure 6 As shown, the electronic device includes at least one processor 601, at least one memory 602, and at least one communication interface 603. The various components of the electronic device are coupled together via a bus system 604. The communication interface 603 is used for information transmission with external devices. It is understood that the bus system 604 is used to implement communication between these components. In addition to a data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 6 The general designated all buses as Bus System 604.

[0161] It is understood that the memory 602 in this embodiment may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.

[0162] In some implementations, memory 602 stores elements such as executable units or data structures, or subsets thereof, or extended sets thereof: operating systems and applications.

[0163] The operating system includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application programs include various applications, such as media players and browsers, used to implement various application functions. A program implementing any method in the text-based large-model hallucination mitigation method provided in this embodiment of the invention can be included in the application programs.

[0164] In this embodiment of the invention, the processor 601 executes the steps of various embodiments of the text-based large model illusion relief method provided by the present invention by calling the program or instructions stored in the memory 602, specifically, the program or instructions stored in the application program.

[0165] Retrieve updated document data;

[0166] Preprocess the updated document data;

[0167] Extract knowledge triples from preprocessed document data;

[0168] Store the knowledge triples in a graph database;

[0169] Obtain the query input by the user and perform entity recognition on the query;

[0170] Retrieve the corresponding entity nodes and their associated content from the graph database;

[0171] The corresponding entity node and the content associated with the entity are concatenated to obtain the Prompt, and the Prompt is concatenated with the Query.

[0172] The concatenation of Prompt and Query is used as input to a large text model to generate response results.

[0173] Any method in the text-based large model illusion mitigation method provided in this embodiment of the invention can be applied to, or implemented by, the processor 601. The processor 601 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed through integrated logic circuits in the hardware of the processor 601 or through software instructions. The processor 601 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0174] The steps of any method in the text-based large model illusion mitigation method provided in this invention can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software units in the decoding processor. The software units can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 602, and processor 601 reads the information in memory 602 and combines it with hardware to complete the steps of the method.

[0175] Those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.

[0176] Those skilled in the art will understand that the descriptions of the various embodiments have different focuses, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0177] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention. All such modifications and variations fall within the scope defined by the appended claims. The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0178] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.< / hop>

Claims

1. A method for alleviating hallucinations in a large textual model, characterized in that, include: Retrieve updated document data; The updated document data is preprocessed; Extract knowledge triples from preprocessed document data; The knowledge triples are stored in a graph database; Obtain the query input by the user and perform entity recognition on the query; The corresponding entity nodes and their associated content are retrieved from the graph database. The corresponding entity node and the content associated with the entity are concatenated to obtain the Prompt, and the Prompt is concatenated with the Query. The concatenation of Prompt and Query is used as input to a large text model to generate response results; The extraction of knowledge triples from preprocessed document data includes: The preprocessed document data serves as the input text set. ,right Encode and map to the hidden state space : In the formula, , , ; The GPlinker information extraction algorithm is used to identify and extract entities and relationships between entities from text data, resulting in knowledge triples. The relationships between entities are as follows: The knowledge triples are stored in a graph database, including: Create a graph space in the graph database Nebula, define the schema of knowledge triples, and store the knowledge triples in the graph database. The process of obtaining the user-input query and performing entity recognition on the query includes: The Query is represented as , The pre-trained language model Bert is transformed into a latent state space. ; In the formula, , ; Using the CRF algorithm to analyze the hidden state space The calculation transforms the state of each position into a probability distribution of BIEO (Breakthrough Identity Principle), representing the beginning, middle, end of an entity, and no entity. The transformation formula is as follows: In the formula, Indicates the predicted target label The score is the unnormalized softmax. Indicates the probability of propagation between words. Represents the normalization factor. The corresponding labels are: the beginning (B), the middle (I), the end (E), and the probability (O) of non-entity for each state. The graph database is used to retrieve the corresponding entity nodes and related content, including: Using nGQL statements in a graph database, you can retrieve results for entity nodes with one or more hops. The ngQL statement is: MATCH(event: {clause}) RETURN <hop> (eventi);< / hop> Here, clause represents the query condition, event represents the final query result, hop represents the number of hops, onehop means one hop, and multi-hop means multiple hops, meaning the result obtained by searching based on the result retrieved in one hop; The process of using the concatenation of Prompt and Query as input to a large text model to generate response results includes: Formalizing the concatenation of Prompt and Query ; The large text model encodes the formal representation to obtain the hidden layer representation. : Based on the encoding structure of the large text model, output the hidden layer representation. : In the formula, Indicates the first At time n, the model... The output of the layer, the hidden layer representation of the final output of the model is as follows: ; Based on the hidden layer representation, calculate the maximum generation probability of words in the vocabulary at each time step: In the formula, This represents the probability distribution of each word generated in the vocabulary. and For training parameters; The word with the highest probability value in the probability distribution is used as the response generation result at the current moment.

2. The method for alleviating large-scale textual hallucinations according to claim 1, characterized in that, The preprocessing of the updated document data includes: The updated document data is then cleaned, deduplicated, and filtered for sensitive information.

3. A device for alleviating large-scale text hallucinations, employing the method for alleviating large-scale text hallucinations as described in any one of claims 1-2, characterized in that, include: The retrieval module is used to retrieve updated document data. Preprocessing module: used to preprocess the updated document data; Extraction module: Used to extract knowledge triples from preprocessed document data; Storage module: used to store the knowledge triples in a graph database; Entity recognition module: used to obtain the query input by the user and perform entity recognition on the query; The retrieval module is used to retrieve the corresponding entity nodes and related content from the graph database. The concatenation module is used to concatenate the extracted entity nodes and the content associated with the entities to obtain the Prompt, and then concatenate the Prompt with the Query. Input module: Used to take the concatenation of Prompt and Query as input to the large text model and generate response results.

4. An electronic device, characterized in that, include: Processor and memory; The processor executes a text-based large model illusion relief method as described in any one of claims 1 to 2 by calling programs or instructions stored in the memory.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that cause a computer to perform a text-based large model illusion relief method as described in any one of claims 1 to 2.