A customer service system query method and computer program product based on named entity recognition

CN123012082APending Publication Date: 2026-10-30CHENGDU BOSS INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611188677.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

目前现有的智能客服系统主要采用“关键字检索”或“关键字+向量检索”的混合召回方案,以及通用的问答大模型生成答案,这样的方式在家电等具体的垂直领域中存在同义词召回困难、大模型幻觉问题、上下文固化等缺陷,导致智能客服系统的专业度和准确性不足

Benefits of technology

[0014]本说明书实施例提供的方案,可以通过命名实体识别模型对用户输入进行同义词实体和专业术语实体的分类处理,形成同义词扩展增强的文档检索与专业术语定义检索的双层知识检索架构,最终将目标文档片段和标准定义文本作为上下文约束封装至提示词模板来生成输入提示词,通过该输入提示词生成回答,解决了传统智能客服系统在家电垂直领域中同义词表达召回困难与大模型领域知识幻觉的问题,提升了家电智能客服系统的回答准确率、召回率,且回答的专业性更强,用户满意度更高。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012082A_ABST
    Figure CN123012082A_ABST
Patent Text Reader

Abstract

The application discloses a customer service system query method and computer program product based on named entity recognition. The method comprises obtaining an original query sentence input by a user, identifying entities in the original query sentence and labeling the entity types of each entity; based on a preset mapping dictionary, querying the standard words corresponding to the synonymous entities, rewriting the original query sentence into an enhanced query sentence containing the standard words, and matching and recalling target document segments in a preset knowledge base according to semantic similarity; querying the standard definition text corresponding to the professional term entity; based on a prompt word template, packaging the target document segment, the standard definition text and the original query sentence to obtain an input prompt word, and generating answer information corresponding to the input prompt word. In the application, the problems of difficulty in recalling synonymous expressions and field knowledge illusion of large models in the traditional intelligent customer service system in the home appliance vertical field are solved, the accuracy and recall rate of the answer are improved, the answer is more professional, and the user satisfaction is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification belong to the field of large language model technology, and specifically relate to a customer service system query method and computer program product based on named entity recognition. Background Technology

[0002] With the popularization of smart homes, the product categories and models in the home appliance sector (such as range hoods, gas stoves, and dishwashers) have experienced explosive growth. When users consult through customer service systems, they often use non-standardized colloquial synonyms (such as calling a "range hood" or "exhaust fan") or highly technical terms (such as "instant suction technology," "inverter motor," and "thermal melt washing"). Currently, existing intelligent customer service systems mainly adopt a hybrid recall scheme of "keyword retrieval" or "keyword + vector retrieval," as well as general question-and-answer large models to generate answers. This approach suffers from defects such as difficulty in synonym recall, large model illusion problems, and contextual rigidity in specific vertical fields such as home appliances, resulting in insufficient professionalism and accuracy of intelligent customer service systems. Summary of the Invention

[0003] The embodiments of this disclosure provide a customer service system query method and computer program product based on named entity recognition, which aims to solve one or more of the above-mentioned problems and other potential problems.

[0004] According to a first aspect of this disclosure, a query method for a customer service system based on named entity recognition is provided. The method includes obtaining an original query statement input by a user, identifying entities in the original query statement based on a pre-trained named entity recognition model, and labeling the entity type of each entity. The entity types include synonym entities and technical term entities.

[0005] Based on the pre-defined mapping dictionary, the standard words corresponding to the synonym entities are queried, and the original query statement is rewritten into an enhanced query statement containing the standard words, so as to retrieve the target document fragments by matching the semantic similarity of the enhanced query statement in the pre-defined knowledge base.

[0006] Based on a pre-defined database of professional terminology definitions, query the standard definition text corresponding to the professional term entities;

[0007] The input prompts are encapsulated based on the prompt word template, the target document fragment, the standard definition text, and the original query statement. Then, the corresponding answer information is generated according to the large language model, and the answer information is output.

[0008] According to a second aspect of this disclosure, a customer service system query device based on named entity recognition is provided. The device includes an entity recognition module, which is configured to acquire the original query statement input by the user, identify entities in the original query statement based on a pre-trained named entity recognition model, and label the entity type of each entity. The entity types include synonym entities and technical term entities.

[0009] The synonym query module is configured to query the standard words corresponding to synonym entities based on a preset mapping dictionary, rewrite the original query statement into an enhanced query statement containing the standard words, and retrieve the target document fragments based on the semantic similarity of the enhanced query statement in the preset knowledge base.

[0010] The terminology query module is configured to query the standard definition text corresponding to the terminology entity based on a preset terminology definition library;

[0011] The prompt word generation module is configured to encapsulate the target document fragment, standard definition text, and original query statement based on the prompt word template to obtain the input prompt words, and then generate the corresponding answer information according to the large language model and output the answer information.

[0012] According to a third aspect of this disclosure, an electronic device is provided, including one or more processors and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform a method provided according to a first scheme.

[0013] According to a fourth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to the first aspect.

[0014] The solution provided in the embodiments of this specification can classify user input into synonym entities and technical term entities using a named entity recognition model, forming a two-layer knowledge retrieval architecture of synonym-enhanced document retrieval and technical term definition retrieval. Finally, the target document fragment and standard definition text are encapsulated as contextual constraints into a prompt word template to generate input prompt words. The answer is generated through these input prompt words. This solves the problems of difficulty in recalling synonym expressions and knowledge illusion in large model domains in traditional intelligent customer service systems in the home appliance vertical field. It improves the accuracy and recall rate of the answer in the home appliance intelligent customer service system, and the answer is more professional, resulting in higher user satisfaction. Attached Figure Description

[0015] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0016] Figure 1 A flowchart illustrating a customer service system query method based on named entity recognition, according to some embodiments of this disclosure, is shown.

[0017] Figure 2 A schematic diagram illustrating the principle of a customer service system query method based on named entity recognition, according to some embodiments of this disclosure, is shown.

[0018] Figure 3 A flowchart illustrating a customer service system query method based on named entity recognition, according to further embodiments of this disclosure, is shown.

[0019] Figure 4 A schematic diagram of the structure of a customer service system query device based on named entity recognition, according to some embodiments of the present disclosure, is shown.

[0020] Figure 5 A schematic block diagram of an electronic device according to some embodiments of the present disclosure is shown. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0022] The terms “comprising” and “having”, and any variations thereof, in this specification, claims, and the foregoing drawings are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. Depending on the context, the word “if” as it applies herein may be interpreted as “when”, “in response to determination”, or “in response to detection”.

[0023] As mentioned earlier, existing technologies suffer from three main shortcomings: First, synonym recall is difficult: traditional keyword matching struggles to cover all colloquial synonyms, while vector retrieval, despite its semantic understanding capabilities, often fails to accurately recall semantically similar terms referring to specific models or components within a vertical domain, preventing users from accessing the correct knowledge base documents. Second, there is the "large model illusion" problem: general-purpose large language models (LLMs) lack in-depth training on specific technical terms in the home appliance field. When user questions involve technical terms, large models often fail to accurately understand their physical meaning or technical parameters, easily fabricating explanations based on probability, resulting in an "illusion" phenomenon that severely impacts the professionalism of the customer service system and the user experience. Third, contextual rigidity: existing retrieval-augmented generation (RAG) technologies typically only retrieve document fragments, failing to explicitly inject definitions for specific technical terms, resulting in a lack of crucial background knowledge support when generating answers. Therefore, a solution is needed that can improve the knowledge recall accuracy of synonym queries in vertical domains, eliminate the illusion of large models understanding technical terms, and enhance the professionalism and accuracy of intelligent customer service systems.

[0024] Figure 1 The diagram illustrates a flowchart of a customer service system query method 100 based on named entity recognition, representing some embodiments of this disclosure. Method 100 can be executed, for example, by a server corresponding to the customer service system. The customer service system is a service terminal system used by an enterprise to handle customer inquiries such as telephone calls and online chats. The server can be a standalone server device, such as a rack-mounted, blade, tower, or cabinet-type server, or a workstation, mainframe, or other hardware device with strong computing power. Alternatively, it can be a server cluster composed of multiple servers. The servers in the cluster can be arranged symmetrically, where each server is functionally and hierarchically equivalent in the transaction chain, and each server can independently provide services. Providing services independently can be understood as requiring no assistance from other servers. Figure 1 As shown, in method 100, step 102 can obtain the original query statement input by the user, identify the entities in the original query statement based on the pre-trained named entity recognition model, and label the entity type of each entity. The entity types include synonym entities and technical term entities.

[0025] In this embodiment, the working principle of the method is as follows: Figure 2As shown, users can input natural language questions through the user interface of the intelligent customer service system. The input natural language question text will be recorded as the original query statement, such as: "How do I use this high-suction intelligent cruise boost?". A pre-trained Named Entity Recognition (NER) model can be used to identify entities and label entity types in the original query statement. This NER model can be implemented using an architecture based on Bidirectional Encoder Representations from Transformers (BERT) plus Conditional Random Field (CRF), or a Bidirectional Long Short-Term Memory (BiLSTM) network plus CRF architecture. Taking the BERT+CRF architecture as an example, each character or word segmentation unit in the original query statement can be transformed into a corresponding input feature vector. The BERT model semantically encodes the input feature vector through a multi-layer bidirectional Transformer encoder, outputting a hidden state vector containing contextual semantic information for each position. The CRF layer receives the hidden state vector and learns the transition constraints between labels. A well-trained named entity recognition model can extract a list of entities from the original query. Each entity can contain attributes such as entity name, entity type, and its start and end positions in the original text. Taking "How do I use this powerful intelligent cruise boost?" as an example, the model can label "powerful suction" as a synonym entity and "intelligent cruise boost" as a technical term entity.

[0026] In method 100, step 104 can query the standard words corresponding to the synonym entities based on the preset mapping dictionary, rewrite the original query statement into an enhanced query statement containing the standard words, and retrieve the target document fragments based on the semantic similarity of the enhanced query statement in the preset knowledge base.

[0027] In this embodiment, a mapping dictionary between synonyms and standard words can be pre-constructed. This mapping dictionary can, for example, store synonyms and standard words in key-value pairs, where the keys are colloquial synonyms and the values ​​are formal standard product / component names in the home appliance field, i.e., standard words. After retrieving the standard words corresponding to the identified synonym entities through this mapping dictionary, the original query statement can be rewritten to obtain an enhanced query statement. The rewriting method can be, for example, keeping all the original characters of the original query statement unchanged, only appending the standard words in parentheses after the identified synonym entities. For example, the standard word corresponding to "high suction power" is "high air volume range hood," so the generated enhanced query statement could be "How to use the intelligent cruise boost of this high suction power (high air volume range hood)?" In this way, the semantic gap caused by synonyms in vertical fields can be effectively overcome, thereby improving the recall rate of subsequent searches. Next, the enhanced query can be transformed into a query vector. An approximate nearest neighbor search is then performed on a pre-defined knowledge base for the home appliance domain. This calculates the cosine similarity or inner product similarity between the query vector and the corresponding document fragment vectors in the knowledge base. This retrieves the target document fragments with the highest similarity or those with similarity exceeding a preset threshold. The retrieved target document fragments exhibit a high semantic match with the user's true intent, enabling the subsequent large model to answer questions based on highly relevant background knowledge derived from these target document fragments, thus improving accuracy. The knowledge base can be obtained, for example, by collecting unstructured text such as home appliance product manuals, technical documents, and after-sales Q&A records, segmenting them into text fragments of appropriate length, and then vectorizing and indexing these fragments.

[0028] In method 100, step 106 can query the standard definition text corresponding to the professional term entity based on a preset professional term definition library.

[0029] In this embodiment, for the identified technical term entities, a query is performed based on a preset technical term definition library to obtain the corresponding standard definition text. Taking "intelligent cruise boost" as an example, the corresponding standard definition text could be "a technology that refers to the automatic adjustment of motor speed by the range hood based on the pressure of the public flue to prevent backflow." The technical term definition library can be stored, for example, in the form of a relational database or a graph database, associating the corresponding term names (i.e., technical term entities) with the standard definition text. Through this method, a dual-path parallel architecture can be formed, with one path retrieving relevant document fragments through synonyms and the other path generating the standard definition text, allowing the model to understand the terms and achieving a collaborative query process without interference.

[0030] In method 100, step 108 can encapsulate the target document fragment, standard definition text, and original query statement based on the prompt word template to obtain the input prompt word, so as to generate the answer information corresponding to the input prompt word according to the large language model and output the answer information.

[0031] In this embodiment, a preset prompt template is used. This prompt template can be a dynamic prompt template, which combines the retrieved target document fragment, the obtained standard definition text, and the original query statement according to a preset structure to obtain the input prompt. As an example, this preset structure can include four parts: the first part is a system role setting prompt, such as "You are a professional home appliance customer service representative; please answer user questions based on the following known information," used to set behavioral boundaries and answering styles for the large model. The second part is the target document fragment from the knowledge base, used to present the search results in the form of a direct quote. The third part is the standard definition text from a professional terminology definition library, used to list the obtained terminology definitions. The fourth part is the original query statement. In the structured design of the prompt template, the terminology definitions can be placed after the target document fragment and before the original query statement. This ensures that the model first obtains broad background knowledge and then precise definitions, and also makes the definitions adjacent to the question to strengthen their binding effect. Furthermore, depending on actual needs, the priority of the terminology definitions can be higher than that of the target document fragment. If there is a potential conflict between the two contents, the terminology definitions will take precedence. The input prompts are fed into a general-purpose large language model (such as an autoregressive language model based on the Transformer architecture). The large language model outputs a coherent, context-sensitive natural language answer, i.e., the response information. This response information is then output to the user through the customer service system interface, completing a full intelligent question-and-answer interaction. Because the input prompts explicitly incorporate standard definition text and target document fragments, the large model's generation process can be constrained within the semantic space defined by real-world domain knowledge. This avoids illusions caused by a lack of domain knowledge, improving the accuracy and professionalism of the response information.

[0032] As an example, taking the aforementioned question "How do I use this powerful intelligent cruise boost?" as an example, the structure of the input prompt word obtained by encapsulating the prompt word template can be:

[0033] "You are a professional home appliance customer service representative. Please answer user questions based on the following known information."

[0034] Known information:

[0035] 1. Relevant document fragments: [Target document fragments retrieved from the knowledge base]

[0036] 2. Definitions of technical terms:

[0037] - Intelligent cruise boost: This refers to the technology in which the range hood automatically adjusts the motor speed according to the pressure of the public flue to prevent backflow.

[0038] User issue:

[0039] How do I use this powerful suction smart cruise booster?

[0040] In one possible implementation, the method further includes:

[0041] Training samples were constructed based on user history dialogue data and product instruction manual text. The training samples were labeled with synonym entities, standard product component name entities, and technical terminology entities.

[0042] Based on the training samples, a named entity recognition model is trained. The named entity recognition model uses a BERT pre-trained model as the embedding layer and incorporates a conditional random field as the output layer.

[0043] In this embodiment, raw text corpora can be collected from multiple sources, such as user historical dialogue corpora (e.g., customer service dialogue logs of home appliance companies) and product instruction manuals. After preprocessing such as data cleaning and irrelevant noise removal, the raw text corpora are labeled to construct training samples. The corpora are labeled with at least three types of entity tags: first, synonym entities, including colloquial expressions used by users in daily life; second, standard product component name entities, including standardized product names in the home appliance field; and third, professional terminology entities, including domain terms with specific technical meanings. During the model training phase, the BERT pre-trained model will serve as the embedding layer. It can learn deep contextual semantic representation capabilities on general corpora through two pre-training tasks: Masked Language Model and Next Sentence Prediction. It outputs a high-dimensional semantic vector for each character or word unit that integrates the bidirectional semantic information of that character in the context of the entire sentence. Next, by connecting a CRF layer to the output layer of the BERT pre-trained model as the final output layer of the overall model, the CRF layer can learn and model the transition probability matrix between label sequences. For example, during training, the CRF optimizes the model parameters by maximizing the likelihood probability of the correct label sequence; in the prediction phase, the CRF uses the Viterbi algorithm to search for the sequence with the highest global score among all legal label sequences as the final output. Ultimately, the trained NER model combines the deep semantic understanding capability of BERT with the sequence-constrained reasoning capability of CRF, making it suitable for question-answering scenarios in the home appliance field where users use colloquial language, express themselves flexibly, but the entity categories are relatively concentrated.

[0044] In one possible implementation, the original query statement is rewritten as an enhanced query statement containing standard terms, including:

[0045] The original characters of the original query statement are preserved, and standard words are inserted in a preset format at the synonym entities to obtain an enhanced query statement; or,

[0046] The enhanced query statement is obtained by replacing synonym entities in the original query statement with standard words.

[0047] In this embodiment, the rewriting of the enhanced query statement can include two methods. One is append-based rewriting, which retains all the original characters in the original query statement without any deletion or replacement operations, and inserts the standard words in a preset format (e.g., appending with parentheses as delimiters). For example, if the original query is "How to use this high-suction intelligent cruise boost?", after identifying the synonym entity "high suction" and obtaining the standard word "high airflow range hood", the rewritten result is "How to use the intelligent cruise boost of this high-suction (high airflow range hood)?". This method can guide the encoder to establish a close semantic association between synonyms and standard words, and maintain consistency with user input. The other is substitution-based rewriting, which directly replaces the corresponding synonym entities in the original query statement with the standard words obtained from the query. Using the above example, the resulting enhanced query statement is "How to use the intelligent cruise boost of this high airflow range hood?". This method can reduce the noise interference that may be caused by additional symbols such as parentheses, and has better retrieval efficiency. In actual deployment, you can choose the current rewriting method as needed, or you can choose automatically based on the actual recall rate of the target document fragment.

[0048] Figure 3 A flowchart illustrating a customer service system query method 300 based on named entity recognition, representing further embodiments of this disclosure, is shown. Figure 3 As shown, in method 300, step 302 can obtain the original query statement input by the user, identify the entities in the original query statement based on the pre-trained named entity recognition model, and label the entity type of each entity. The entity types include synonym entities and technical term entities.

[0049] In this embodiment, step 302 can be referred to step 102, and will not be repeated here.

[0050] In method 300, step 304 can query the standard words corresponding to the synonym entities based on a preset mapping dictionary, and rewrite the original query statement into an enhanced query statement containing the standard words.

[0051] In this embodiment, step 304 can be referred to step 104, and will not be repeated here.

[0052] In method 300, step 306 can calculate the first semantic similarity score between the enhanced query statement and each candidate document fragment in a preset knowledge base, and recall the candidate document fragments whose first semantic similarity score is not lower than the first threshold as target document fragments.

[0053] In this embodiment, when calculating cosine similarity and other similarities between the enhanced query and each candidate document fragment, the calculated similarity value can be used as the first semantic similarity score. If the first semantic similarity score is lower than a first threshold, it indicates that the candidate document fragment is not sufficiently relevant to the user's question, and recalling it would result in unreliable recall results. Conversely, the corresponding candidate document fragment is considered reliable. Finally, candidate document fragments with a first semantic similarity score not lower than the first threshold, i.e., reliable candidate document fragments, are recalled as target document fragments.

[0054] In method 300, step 308 may respond to the fact that the first semantic similarity scores of all candidate document fragments are lower than the first threshold, calculate the second semantic similarity scores between the original query statement and each candidate document fragment, and recall the candidate document fragments whose second semantic similarity scores are not lower than the first threshold as target document fragments.

[0055] In this embodiment, if the first semantic similarity score corresponding to all candidate document fragments is lower than the first threshold, it indicates that the synonym mapping may not be accurate enough. For example, a certain synonym may have multiple possible standardized mappings, and the system may have selected the wrong one. In this case, to avoid the retrieval deviating from the user's true intent, the enhanced query statement can be omitted, and the original query statement can be used instead to avoid directly returning invalid answers or empty results. Finally, the second semantic similarity score between the original query statement and each candidate document fragment is calculated, and candidate document fragments with a second semantic similarity score not lower than the first threshold are used as target document fragments for recall. Furthermore, if the second semantic similarity scores are still all lower than the first threshold, an empty result can be returned directly to avoid errors in the response caused by incorrect or invalid answers.

[0056] In method 300, step 310 can query the standard definition text and technical documents corresponding to the technical term entities based on a preset technical term definition library, and associate the access path of the technical documents with the technical term entities.

[0057] In this embodiment, the terminology definition library can store not only standard definition texts but also corresponding detailed technical documents, and associate the access paths of these technical documents with the terminology entities. In most simple question-and-answer scenarios, the highly condensed and generalized explanations represented by the standard definition texts are sufficient. However, this may be insufficient when users continuously seek further details. Therefore, by associating with technical documents, when the model requires more in-depth technical support, the relevant content from the complete technical documents can be retrieved via the access path as supplementary information, ensuring the comprehensiveness of the final generated answer.

[0058] In method 300, step 312 may respond to the fact that each technical document fragment marked in the technical document does not match the target document fragment at least partially, by adding the mismatched technical document fragment to the target document fragment.

[0059] In this embodiment, since the technical documents may be extensive, the most important technical document segments can be pre-annotated during the construction of the technical documents. This allows for comparison of each technical document segment with the target document segment. If a technical document segment does not match the target document, it indicates that the segment is not present in the target document and can be added as part of the final target document segment. In this way, some content from the technical document segments can be incorporated into the target document segment. When the model cannot directly access the technical documents due to network fluctuations or hardware failures, the technical document segments already added to the target document segment can assist the large model in generating more accurate and professional answers.

[0060] In method 300, step 314 can encapsulate the target document fragment, standard definition text, and original query statement based on the prompt word template to obtain the input prompt word, so as to generate the answer information corresponding to the input prompt word according to the large language model and output the answer information.

[0061] In this embodiment, step 314 can be referred to step 108, and will not be repeated here.

[0062] In one possible implementation, the standard definition text corresponding to a technical term entity is queried based on a preset technical term definition database, including:

[0063] In response to the existence of a technical term entity, the standard definition text corresponding to the technical term entity is queried based on the preset technical term definition library;

[0064] In response to the existence of multiple technical term entities, the system queries the standard definition text corresponding to each technical term entity based on the preset technical term definition library, and then concatenates the standard definition texts in the traversal order.

[0065] In this embodiment, a user's initial query in a single inquiry may involve multiple technical terminology entities. For a single technical terminology entity, the standard definition text will be retrieved directly from the technical terminology definition library without further processing. For multiple technical terminology entities, the standard definition text for each entity will be retrieved separately, and the standard definition texts will be concatenated according to the traversal order (i.e., the order in which they appear in the initial query) to obtain a concatenated definition context. This concatenated definition context will then be used to encapsulate and generate input prompts. For example, suppose the user inputs "Can the intelligent cruise boost and instant suction modes of this range hood be turned on simultaneously?", which contains the technical terminology entities "intelligent cruise boost" and "instant suction mode". The concatenated definition context could be: "Intelligent cruise boost: refers to the technology by which the range hood automatically adjusts the motor speed according to the pressure of the common flue to prevent backflow. Instant suction mode: refers to the working mode of the range hood automatically entering maximum airflow operation under high-pressure stir-frying conditions." This approach can guarantee the uniqueness and accuracy of multiple technical terms at the semantic level, prevent information cross-contamination and confusion in multi-term scenarios, and the concatenation method can also simplify the encapsulation of prompt words, reduce the probability of errors in input prompt words, and enable large models to still generate accurate professional responses when faced with complex questions containing multiple technical terms.

[0066] In one possible implementation, the method further includes:

[0067] Calculate the confidence score of each entity output by the named entity recognition model, identify low-confidence entities with confidence scores below a second threshold, and filter out low-confidence entities from synonym entities and terminology entities.

[0068] In this embodiment, the named entity recognition model can also calculate a confidence score for each predicted label during the decoding of the optimal label sequence using the CRF layer. This confidence score reflects the model's certainty about its prediction results, and can be calculated by the CRF layer using marginal probabilities, for example. High-confidence entities with confidence scores not lower than the second threshold will be processed according to the normal procedure. Low-confidence entities with confidence scores below the second threshold are considered prone to misjudgment in complex spoken language environments and need to be filtered out from synonym entities and technical terminology entities to avoid erroneous entities contaminating the target document fragments or triggering the injection of incorrect technical terminology definitions.

[0069] In one possible implementation, the method further includes:

[0070] Determine the cached list of historical entities corresponding to the current session window;

[0071] In response to the fact that no entity was identified in the original query statement of the current round, the last cached synonym entity and term entity were read from the historical entity cache list.

[0072] In this embodiment, a historical entity cache list can also be maintained for each independent session window, storing the entities identified in the historical dialogue. If no entity is identified from the original query in a certain round, for example, if the user uses an abbreviated form such as "Does it consume a lot of electricity?" in a follow-up question, the last cached synonym entities and technical term entities will be read, and the information corresponding to these entities will be inherited into the current round. This ensures that the model understands the contextual referential relationships without the user having to repeat the complete technical terms or product names in each round of dialogue, thereby improving the natural fluency of multi-round dialogues and the user experience.

[0073] Figure 4 This document illustrates a schematic diagram of the structure of a customer service system query device 400 based on named entity recognition, representing some embodiments of this disclosure. The various embodiments in this specification are described in a progressive manner; similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments. Figure 4 As shown, the device 400 includes an entity recognition module 401, which is configured to acquire the original query statement input by the user, identify the entities in the original query statement based on a pre-trained named entity recognition model, and label the entity type of each entity. The entity types include synonym entities and technical term entities.

[0074] The synonym query module 402 is configured to query the standard words corresponding to the synonym entities based on a preset mapping dictionary, rewrite the original query statement into an enhanced query statement containing the standard words, and retrieve the target document fragments based on the semantic similarity of the enhanced query statement in the preset knowledge base.

[0075] The terminology query module 403 is configured to query the standard definition text corresponding to the terminology entity based on the preset terminology definition library;

[0076] The prompt word generation module 404 is configured to encapsulate the target document fragment, standard definition text, and original query statement based on the prompt word template to obtain the input prompt word, and then generate the corresponding answer information according to the large language model and output the answer information.

[0077] In one possible implementation, the device further includes a pre-training module configured to construct training samples based on user history dialogue corpus and product instruction manual text. The training samples are labeled with synonym entities, standard product component name entities, and technical term entities. Based on the training samples, a named entity recognition model is trained. The named entity recognition model uses a BERT pre-trained model as the embedding layer and accesses a conditional random field as the output layer.

[0078] In one possible implementation, the synonym query module 402 is further configured to retain the original characters of the original query statement, insert standard words in a preset format at the synonym entities, and obtain an enhanced query statement; or, replace the synonym entities in the original query statement with standard words to obtain an enhanced query statement.

[0079] In one possible implementation, the synonym query module 402 is further configured to calculate a first semantic similarity score between the enhanced query statement and each candidate document fragment in a preset knowledge base, and recall candidate document fragments with a first semantic similarity score not lower than a first threshold as target document fragments; in response to the first semantic similarity score of all candidate document fragments being lower than the first threshold, calculate a second semantic similarity score between the original query statement and each candidate document fragment, and recall candidate document fragments with a second semantic similarity score not lower than the first threshold as target document fragments.

[0080] In one possible implementation, the terminology query module 403 is further configured to query the standard definition text and technical documents corresponding to the terminology entities based on a preset terminology definition library, and associate the access path of the technical documents with the terminology entities.

[0081] In one possible implementation, the technical terminology query module 403 is further configured to add the mismatched technical document fragments to the target document fragment in response to at least a partial mismatch between the technical document fragments marked in the technical document and the target document fragment.

[0082] In one possible implementation, the terminology query module 403 is further configured to, in response to the existence of a terminology entity, query the standard definition text corresponding to the terminology entity based on a preset terminology definition library; and in response to the existence of multiple terminology entities, query the standard definition text corresponding to each terminology entity based on the preset terminology definition library, and concatenate the standard definition texts according to the traversal order.

[0083] In one possible implementation, the apparatus further includes an entity filtering module configured to calculate the confidence score of each entity output by the named entity recognition model, and determine low-confidence entities whose confidence scores are lower than a second threshold, so as to filter out low-confidence entities among synonym entities and terminology entities.

[0084] In one possible implementation, the device further includes an entity caching module configured to determine a historical entity cache list corresponding to the current session window; in response to no entity being identified in the original query statement of the current round, the last cached synonym entity and term entity are read from the historical entity cache list.

[0085] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this specification is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0086] Figure 5 A block diagram of an electronic device 500 that can implement various embodiments of the present disclosure is shown. For example... Figure 5 As shown, the electronic device 500 includes a processor 510, a disk drive 520, an input / output interface 530, a network interface 540, and a memory 550. The processor 510, disk drive 520, input / output interface 530, network interface 540, and memory 550 can communicate with each other via a communication bus 560.

[0087] The processor 510 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs and implement the technical solution provided in this application.

[0088] The memory 550 can be implemented in the form of ROM (Read Only Memory), RAM (Read Access Memory), static memory, dynamic storage devices, etc. The memory 550 can store the operating system 551 used to control the operation of the electronic device 500, and the basic input / output system (BIOS) 552 used to control the low-level operations of the electronic device 500. Additionally, it can store a web browser 553, a data storage management system 554, etc. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 550 and is called and executed by the processor 510.

[0089] Input / output interface 530 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, vibrators, indicator lights, etc.

[0090] Network interface 540 is used to connect a communication module (not shown in the figure) to enable communication and interaction between the device and other devices. The communication module can communicate via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).

[0091] Bus 560 includes a pathway for transmitting information between various components of the device, such as processor 510, disk drive 520, input / output interface 530, network interface 540, and memory 550.

[0092] It should be noted that although the above-described device only shows the processor 510, disk drive 520, input / output interface 530, network interface 540, memory 550, bus 560, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the method of this application, and does not necessarily include all the components shown in the figures.

[0093] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0094] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Furthermore, although operations are depicted in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0095] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A query method for a customer service system based on named entity recognition, characterized in that, The method includes: Obtain the original query statement input by the user, identify the entities in the original query statement based on the pre-trained named entity recognition model, and label the entity type of each entity. The entity type includes synonym entities and technical term entities. Based on a preset mapping dictionary, the standard words corresponding to the synonym entities are queried, and the original query statement is rewritten into an enhanced query statement containing the standard words, so as to retrieve the target document fragments by matching the semantic similarity of the enhanced query statement in the preset knowledge base. The standard definition text corresponding to the professional term entity is queried based on a preset professional term definition library; The target document fragment, standard definition text, and original query statement are encapsulated based on the prompt word template to obtain input prompt words. Then, the corresponding answer information is generated according to the large language model, and the answer information is output.

2. The customer service system query method based on named entity recognition according to claim 1, characterized in that, The method further includes: Training samples are constructed based on user history dialogue data and product instruction manual text. The training samples are labeled with synonym entities, standard product component name entities, and technical terminology entities. Based on the training samples, a named entity recognition model is trained. The named entity recognition model uses a BERT pre-trained model as the embedding layer and accesses a conditional random field as the output layer.

3. The customer service system query method based on named entity recognition according to claim 1, characterized in that, The step of rewriting the original query statement into an enhanced query statement containing the standard terms includes: The original characters of the original query statement are retained, and the standard words are inserted in a preset format at the synonym entities to obtain an enhanced query statement; or, The synonym entities in the original query statement are replaced with the standard words to obtain the enhanced query statement.

4. The customer service system query method based on named entity recognition according to claim 1, characterized in that, The step of retrieving target document fragments based on semantic similarity matching of the enhanced query statement in a preset knowledge base includes: Calculate the first semantic similarity score between the enhanced query statement and each candidate document fragment in the preset knowledge base, and recall the candidate document fragments whose first semantic similarity score is not lower than the first threshold as target document fragments; In response to the fact that the first semantic similarity score of all the candidate document fragments is lower than the first threshold, the second semantic similarity score between the original query statement and each candidate document fragment is calculated, and the candidate document fragments with the second semantic similarity score not lower than the first threshold are recalled as target document fragments.

5. The customer service system query method based on named entity recognition according to claim 1, characterized in that, The process of querying the standard definition text corresponding to the professional term entity based on a preset professional term definition database includes: Based on a preset professional terminology definition library, the standard definition text and technical documents corresponding to the professional term entity are queried, and the access path of the technical document is associated with the professional term entity.

6. The customer service system query method based on named entity recognition according to claim 5, characterized in that, The method further includes: In response to the fact that each technical document fragment marked in the technical document does not match the target document fragment in at least part, the mismatched technical document fragment is added to the target document fragment.

7. The customer service system query method based on named entity recognition according to claim 1, characterized in that, The process of querying the standard definition text corresponding to the professional term entity based on a preset professional term definition database includes: In response to the existence of the aforementioned technical term entity, the standard definition text corresponding to the technical term entity is queried based on a preset technical term definition library; In response to the existence of multiple technical term entities, the standard definition text corresponding to each technical term entity is queried based on a preset technical term definition library, and the standard definition texts are concatenated in traversal order.

8. The customer service system query method based on named entity recognition according to claim 1, characterized in that, The method further includes: Calculate the confidence score of each entity output by the named entity recognition model, identify low-confidence entities whose confidence scores are lower than a second threshold, and filter out the low-confidence entities from the synonym entities and technical term entities.

9. A customer service system query method based on named entity recognition according to claim 1, characterized in that, The method further includes: Determine the cached list of historical entities corresponding to the current session window; In response to the fact that no entity is identified in the original query statement of the current round, the last cached synonym entity and term entity are read from the historical entity cache list.

10. A computer program product, characterized in that, The system includes a computer program that, when executed by a processor, implements a customer service system query method based on named entity recognition according to any one of claims 1-9.