Text processing method and device, electronic device and computer-readable storage medium

By determining the initial historical text of the association relationship from the historical text database, obtaining the network knowledge text and performing text embedding processing, the high cost problem caused by the networking and colloquialization of user questions in short text matching technology is solved, and the user experience and matching effect are improved.

CN114661878BActive Publication Date: 2025-09-09工银科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210287153.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2025-09-09
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

In application scenarios based on short text matching technology, the user experience is poor due to the networked and colloquial nature of user questions and the high cost of building structured external knowledge.

Method used

In response to receiving the initial search text, the initial historical text of the associated relationship is determined from the historical text database, the network knowledge text is obtained, and the initial search text and the historical text are subjected to text embedding processing, a monosemous and polysemous vocabulary is constructed, and the similarity is calculated using a semantic encoding model to determine the target text.

Benefits of technology

It improves text matching effects, reduces the cost of building structured external knowledge, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661878B_ABST
    Figure CN114661878B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text processing method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied in the fields of natural language processing and finance. The text processing method includes: in response to receiving an initial search text, determining, based on the initial search text, an initial historical text associated with the initial search text from a historical text database, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text have a one-to-one correspondence; obtaining a network knowledge text based on the initial search text and the initial historical text; using the network knowledge text, performing text embedding processing on the initial search text and the initial historical text, respectively, to obtain a processed target search text and a target historical text; and determining, based on the target search text and the target historical text, a target text corresponding to the target historical text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of natural language processing and finance, and more specifically, to a text processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the development of artificial intelligence technology, text matching technology in natural language processing (NLP) will be applied in many scenarios such as question-answering robots, plagiarism detection, and web search.

[0003] In the process of realizing the concept of the present disclosure, the inventors discovered that there are at least the following problems in the related technology: in the application scenario based on short text matching technology, the user experience is poor due to the networking and colloquial nature of user questions and the high cost of building structured external knowledge. Summary of the Invention

[0004] In view of this, the present disclosure provides a text processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to a first aspect of the present disclosure, a text processing method is provided, comprising:

[0006] In response to receiving the initial search text, determining, based on the initial search text, an initial historical text associated with the initial search text from a historical text database, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text are in one-to-one correspondence;

[0007] Acquire network knowledge text according to the initial search text and the initial history text;

[0008] Using the network knowledge text, respectively perform text embedding processing on the initial search text and the initial history text to obtain processed target search text and target history text; and

[0009] According to the target search text and the target historical text, a target text corresponding to the target historical text is determined.

[0010] According to an embodiment of the present disclosure, the method further includes, after determining, in response to receiving the initial search text, an initial historical text associated with the initial search text from a historical text database based on the initial search text:

[0011] Perform word segmentation on the initial search text and the initial history text to obtain an initial search text word sequence and an initial history text word sequence;

[0012] Preprocessing the initial search text word sequence and the initial history text word sequence to obtain a preprocessed search text word sequence and a history text word sequence, wherein the preprocessing includes at least one of stop word filtering and punctuation mark filtering; and

[0013] The pre-processed search text word sequence and the historical text word sequence are matched to obtain a matching vocabulary set and a difference vocabulary set, wherein the difference vocabulary set includes a search text difference vocabulary set and a historical text difference vocabulary set.

[0014] According to an embodiment of the present disclosure, the matching vocabulary set includes matching vocabulary in the search text word sequence and the historical text word sequence, the search text difference vocabulary set includes first difference vocabulary in the search text word sequence that does not match the historical text word sequence, and the historical text difference vocabulary set includes second difference vocabulary in the historical text word sequence that does not match the search text word sequence;

[0015] The above-mentioned acquisition of network knowledge text based on the above-mentioned initial search text and the above-mentioned initial history text includes:

[0016] According to each target word in the matching words, the first difference words, and the second difference words, respectively, the network knowledge text is obtained, wherein the network knowledge text includes one or more word meaning texts corresponding to the target words;

[0017] In the case where the network knowledge text includes the word meaning text, constructing a monosyllabic vocabulary, wherein the monosyllabic vocabulary is used to represent the corresponding relationship between at least one of the target words and the word meaning text; and

[0018] In the case where the network knowledge text includes a plurality of the word meaning texts, a polysemous vocabulary is constructed, wherein the polysemous vocabulary is used to represent the correspondence between at least one of the target words and the plurality of the word meaning texts.

[0019] According to an embodiment of the present disclosure, the method further includes, before using the network knowledge text to perform text embedding processing on the initial search text and the initial history text to obtain the processed target search text and target history text:

[0020] The word meaning categories are determined based on the above-mentioned univocal vocabulary, the above-mentioned polysemous vocabulary, the above-mentioned matching vocabulary set and the above-mentioned difference vocabulary set, wherein the above-mentioned word meaning categories include univocal matching vocabulary set, polysemous matching vocabulary set, univocal difference vocabulary set and polysemous difference vocabulary set.

[0021] According to an embodiment of the present disclosure, the above method further includes:

[0022] Input one or more of the above word meaning texts and the above initial search text into a pre-trained semantic encoding model to obtain a search text similarity result;

[0023] Inputting one or more of the above-mentioned word meaning texts and the above-mentioned initial historical text into the above-mentioned pre-trained semantic encoding model to obtain a historical text similarity result; and

[0024] According to a preset threshold, based on the search text similarity result and the historical text similarity result, the search text word meaning set and the historical text word meaning set are determined.

[0025] According to an embodiment of the present disclosure, determining the search text word meaning set and the historical text word meaning set based on the search text similarity result and the historical text similarity result according to the preset threshold includes:

[0026] In response to the search text similarity result being greater than the preset threshold, determining a search text unisense matching word meaning set, a search text polysense matching word meaning set, a search text unisense difference word meaning set, and a search text polysense difference word meaning set based on the polysense matching word set, the unisense difference word set, and the polysense difference word set;

[0027] In response to the above-mentioned historical text similarity result being greater than the above-mentioned preset threshold, the historical text unisense matching word meaning set, the historical text polysense matching word meaning set, the historical text unisense difference word meaning set and the historical text polysense difference word meaning set are determined based on the above-mentioned polysense matching vocabulary set, the above-mentioned unisense difference vocabulary set and the above-mentioned polysense difference vocabulary set.

[0028] According to an embodiment of the present disclosure, the text embedding process includes embedding categories, and the method further includes:

[0029] In the case where the word sense category is a polysemous matching word sense set, determining the embedding category to be a permutation embedding;

[0030] In the case where the word sense category is a single-meaning difference word sense set, determining the embedding category to be a fixed embedding; and

[0031] In the case where the above-mentioned word sense category is a polysemous difference word sense set, the above-mentioned embedding category is determined to be a combined embedding.

[0032] According to an embodiment of the present disclosure, determining the target text corresponding to the target historical text based on the target search text and the target historical text includes:

[0033] Input the target search text and the target historical text into a pre-trained semantic matching model to obtain a matching result;

[0034] Sorting the target historical texts according to the matching results to obtain a sorting result; and

[0035] According to the above sorting results, the target text corresponding to the above target historical text is determined.

[0036] According to a second aspect of the present disclosure, a text processing device is provided, including: a first determination module, an acquisition module, a processing module and a second determination module.

[0037] a first determining module configured to, in response to receiving an initial search text, determine, based on the initial search text, from a historical text database an initial historical text associated with the initial search text, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text have a one-to-one correspondence;

[0038] An acquisition module, configured to acquire network knowledge text based on the initial search text and the initial history text;

[0039] a processing module, configured to perform text embedding processing on the initial search text and the initial history text using the network knowledge text, to obtain processed target search text and target history text; and

[0040] The second determining module is used to determine the target text corresponding to the target historical text according to the target search text and the target historical text.

[0041] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0042] one or more processors;

[0043] a memory for storing one or more instructions,

[0044] When the one or more instructions are executed by the one or more processors, the one or more processors implement the method described above.

[0045] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored. When the executable instructions are executed by a processor, the processor implements the method described above.

[0046] According to a fifth aspect of the present disclosure, a computer program product is provided, wherein the computer program product comprises computer-executable instructions, and the computer-executable instructions are used to implement the method described above when executed.

[0047] According to an embodiment of the present disclosure, an initial historical text is determined based on an initial search text, and network knowledge text is obtained based on the initial search text and the initial historical text. Then, a target search text and a target historical text are obtained through text embedding processing, and a target text corresponding to the target historical text is determined. The above-mentioned technical means at least partially overcome the technical problem in the related art of short text matching technology in application scenarios, which is that the user's search text is networked and colloquial, and the cost of building structured external knowledge is high, resulting in a poor user experience, thereby improving the text matching effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0049] Figure 1 The system architecture to which the text processing method according to an embodiment of the present disclosure can be applied is schematically shown;

[0050] Figure 2 The flowchart of the text processing method according to the embodiment of the present disclosure is schematically shown;

[0051] Figure 3 Schematically shows a flow chart of a method for obtaining a matching vocabulary set and a difference vocabulary set according to an embodiment of the present disclosure;

[0052] Figure 4 A schematic diagram schematically illustrates a word segmentation processing method according to an embodiment of the present disclosure;

[0053] Figure 5 The overall flow chart of the text processing method according to the embodiment of the present disclosure is schematically shown;

[0054] Figure 6(a) to Figure 6(f) Schematically shows a schematic diagram of word sense embedding discrimination according to an embodiment of the present disclosure;

[0055] Figure 7 A schematic diagram schematically illustrates a text embedding category according to an embodiment of the present disclosure;

[0056] Figure 8 A block diagram schematically illustrates a text processing apparatus according to an embodiment of the present disclosure; and

[0057] Figure 9A block diagram of an electronic device suitable for implementing a text processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0058] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0059] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0060] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0061] When expressions such as “at least one of A, B, and C, etc.” are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., “a system having at least one of A, B, and C” should include but is not limited to systems having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, and C, etc.). When expressions such as “at least one of A, B, or C, etc.” are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., “a system having at least one of A, B, or C” should include but is not limited to systems having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, and C, etc.).

[0062] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.

[0063] In the technical solution disclosed herein, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0064] With the development of artificial intelligence technology, text matching technology in natural language processing (NLP) will be applied in many scenarios such as question-answering robots, plagiarism detection, and web search.

[0065] Text matching technology can be divided into short text matching technology, long text matching technology and document matching technology according to the length of the text. Among them, short text matching technology is difficult to understand the text due to the lack of contextual information. Therefore, in order to enhance the effect of short text matching in related technologies, matching algorithms such as DSSM (Deep Structured Semantic Models, semantic models based on deep networks), DRMM (Deep Relevance Matching Model, deep relevance matching model), Match Pyramid (constructing matching matrix), BERT (Bidirectional Encoder Representation from Transformers) are usually adopted to expand the contextual information in short texts by introducing external knowledge.

[0066] However, current short text matching technologies often introduce structured external knowledge that is difficult to use directly. This not only requires significant effort to build knowledge networks, but also has limited applicability. Consequently, existing external knowledge plays a diminishing role in text matching. For example, in public domain applications, user questions are increasingly networked and colloquial, rendering existing external knowledge inadequate. Furthermore, in vertical domain applications, existing external knowledge often lacks specific context, requiring the intervention of specialized personnel and resulting in a lengthy and time-consuming process.

[0067] In the process of realizing the concept of the present disclosure, the inventors discovered that there are at least the following problems in the related technology: in the application scenario based on short text matching technology, the user experience is poor due to the networking and colloquial nature of user questions and the high cost of building structured external knowledge.

[0068] To at least partially address the technical issues in the related art, the present disclosure provides a text processing method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the fields of natural language processing and finance. The text processing method includes: in response to receiving an initial search text, determining, based on the initial search text, an initial historical text associated with the initial search text from a historical text database, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text have a one-to-one correspondence; obtaining a network knowledge text based on the initial search text and the initial historical text; using the network knowledge text, performing text embedding processing on the initial search text and the initial historical text, respectively, to obtain a processed target search text and a target historical text; and determining, based on the target search text and the target historical text, a target text corresponding to the target historical text.

[0069] It should be noted that the text processing methods and apparatuses provided in the embodiments of the present disclosure can be used in the fields of natural language processing and finance, for example, in customer service at bank branches. The text processing methods and apparatuses provided in the embodiments of the present disclosure can also be used in any field other than natural language processing and finance, for example, in question-answering robots. The application fields of the text processing methods and apparatuses provided in the embodiments of the present disclosure are not limited.

[0070] Figure 1 The system architecture to which the text processing method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that, Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.

[0071] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0072] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only).

[0073] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0074] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0075] It should be noted that the text processing method provided in the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the text processing apparatus provided in the embodiments of the present disclosure can generally be located in the server 105. The text processing method provided in the embodiments of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and that is capable of communicating with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the text processing apparatus provided in the embodiments of the present disclosure can also be located in a server or server cluster that is different from the server 105 and that is capable of communicating with the terminal devices 101, 102, 103 and / or the server 105. Alternatively, the text processing method provided in the embodiments of the present disclosure can also be executed by the terminal devices 101, 102, or 103, or by a terminal device other than the terminal devices 101, 102, or 103. Accordingly, the text processing apparatus provided in the embodiments of the present disclosure can also be located in the terminal devices 101, 102, or 103, or by a terminal device other than the terminal devices 101, 102, or 103.

[0076] For example, the search text and the historical text may be originally stored in any one of the terminal devices 101, 102, or 103 (for example, the terminal device 101, but not limited thereto), or stored on an external storage device and imported into the terminal device 101. The terminal device 101 may then locally execute the text processing method provided by the embodiment of the present disclosure, or send the search text and the historical text to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the search text and historical text instructions may execute the text processing method provided by the embodiment of the present disclosure.

[0077] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0078] Figure 2 The flowchart of the text processing method according to the embodiment of the present disclosure is schematically shown.

[0079] like Figure 2 As shown, the text processing method includes operations S201 to S204.

[0080] In operation S201, in response to receiving an initial search text, an initial historical text having an associated relationship with the initial search text is determined from a historical text database based on the initial search text, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text have a one-to-one correspondence.

[0081] According to an embodiment of the present disclosure, the initial search text may include a question text input by a user through a terminal device.

[0082] According to an embodiment of the present disclosure, at least one set of historical texts and matching texts may be stored in a historical text database, and an initial historical text may be determined in the historical text database based on an initial search text input by a user.

[0083] In operation S202 , network knowledge text is acquired according to the initial search text and the initial history text.

[0084] According to an embodiment of the present disclosure, network data crawling may be performed based on the initial search text and the initial history text to obtain network knowledge text.

[0085] In operation S203, the network knowledge text is used to perform text embedding processing on the initial search text and the initial history text respectively to obtain the processed target search text and target history text.

[0086] According to an embodiment of the present disclosure, the network knowledge text may be embedded into the initial search text and the initial history text respectively, thereby obtaining the target search text and the target history text.

[0087] In operation S204 , a target text corresponding to the target historical text is determined according to the target search text and the target historical text.

[0088] According to an embodiment of the present disclosure, a target text corresponding to the target history text may be determined as an answer to the initial search text based on the target search text and the target history text after text embedding processing.

[0089] According to an embodiment of the present disclosure, an initial historical text is determined based on an initial search text, and network knowledge text is obtained based on the initial search text and the initial historical text. Then, a target search text and a target historical text are obtained through text embedding processing, and a target text corresponding to the target historical text is determined. The above-mentioned technical means at least partially overcome the technical problem in the related art of short text matching technology in application scenarios, which is that the user's search text is networked and colloquial, and the cost of building structured external knowledge is high, resulting in a poor user experience, thereby improving the text matching effect.

[0090] Reference below Figures 3 to 7 , combined with specific embodiments Figure 2 The method shown is further explained.

[0091] Figure 3 The flowchart of the method for obtaining a matching vocabulary set and a difference vocabulary set according to an embodiment of the present disclosure is schematically shown.

[0092] like Figure 3 As shown, the method for obtaining a matching vocabulary set and a difference vocabulary set includes operations S301 to S303.

[0093] In operation S301 , word segmentation is performed on the initial search text and the initial history text respectively to obtain an initial search text word sequence and an initial history text word sequence.

[0094] According to an embodiment of the present disclosure, word segmentation processing methods may include a dictionary-based word segmentation algorithm and a statistics-based machine learning algorithm. The statistics-based machine learning algorithm may include algorithms such as HMM (Hidden Markov Model), CRF (Conditional Random Fields), and SVM (Support Vector Machine).

[0095] According to an embodiment of the present disclosure, the word segmentation method may further include a word lattice graph segmentation method. The word lattice graph may include a directed acyclic graph that can be used to represent information about characters and words in a sentence. For example, the initial search text (user_question) and the initial historical text (local_question) may be segmented using a word lattice graph to obtain the initial search text word sequence (user_tokens) and the initial historical text word sequence (local_tokens), respectively.

[0096] In operation S302 , the initial search text word sequence and the initial history text word sequence are preprocessed to obtain a preprocessed search text word sequence and a history text word sequence, wherein the preprocessing includes at least one of stop word filtering and punctuation mark filtering.

[0097] According to an embodiment of the present disclosure, stop words in the initial search text word sequence and the initial history text word sequence may be filtered out based on a stop word dictionary.

[0098] According to an embodiment of the present disclosure, punctuation marks in the initial search text word sequence and the initial history text word sequence may be filtered out based on a Python or Java method.

[0099] In operation S303 , the pre-processed search text word sequence and the historical text word sequence are matched to obtain a matching vocabulary set and a difference vocabulary set, wherein the difference vocabulary set includes a search text difference vocabulary set and a historical text difference vocabulary set.

[0100] According to an embodiment of the present disclosure, common word matching can be performed on the search text word sequence and the historical text word sequence, and the common words in the two matched word sequences are used as matching words to determine the matching word set (match_tokens), and the unique words in each of the two matched word sequences are used as difference words to determine the search text difference word set (user_dif_tokens) and the historical text difference word set (local_dif_tokens).

[0101] According to an embodiment of the present disclosure, by segmenting and preprocessing the initial search text and the initial historical text respectively, and then matching the search text word sequence and the historical text word sequence obtained after preprocessing to obtain a matching vocabulary set and a difference vocabulary set, the matching words and difference words between the initial search text input by the user and the local initial historical text can be extracted for subsequent operations such as text embedding judgment.

[0102] Figure 4 The following schematically illustrates a word segmentation processing method according to an embodiment of the present disclosure.

[0103] like Figure 4 As shown, for example, when the text is "research life is very fulfilling", the text can be divided into words such as "research", "life", "fulfilling", and "graduate student" through the word grid cutting method.

[0104] According to an embodiment of the present disclosure, the initial search text (user_question) and the initial history text (local_question) may be segmented according to a segmentation method of a word lattice graph.

[0105] Figure 5 The overall flow chart of the text processing method according to an embodiment of the present disclosure is schematically shown.

[0106] According to an embodiment of the present disclosure, the matching vocabulary set includes matching vocabulary in the search text word sequence and the historical text word sequence, the search text difference vocabulary set includes first difference vocabulary in the search text word sequence that does not match the historical text word sequence, and the historical text difference vocabulary set includes second difference vocabulary in the historical text word sequence that does not match the search text word sequence;

[0107] Acquiring network knowledge text based on the initial search text and the initial historical text includes: acquiring network knowledge text based on each target vocabulary in the matching vocabulary, the first difference vocabulary, and the second difference vocabulary. The network knowledge text includes one or more word meaning texts corresponding to the target vocabulary. When the network knowledge text includes one word meaning text, a monosemous vocabulary is constructed, and the monosemous vocabulary is used to represent the correspondence between at least one target vocabulary and one word meaning text. When the network knowledge text includes multiple word meaning texts, a polysemous vocabulary is constructed, and the polysemous vocabulary is used to represent the correspondence between at least one target vocabulary and multiple word meaning texts.

[0108] According to an embodiment of the present disclosure, the word meaning text may be used to explain the text description of the target vocabulary.

[0109] According to an embodiment of the present disclosure, it is possible to pre-determine whether a target vocabulary is searchable on a network platform, and crawl the semantic texts of the searchable target vocabulary.

[0110] According to an embodiment of the present disclosure, when crawling one semantic text, a monosemous vocabulary (semantic_1V1) of the target vocabulary and its meaning can be constructed; when crawling multiple semantic texts, a polysemous vocabulary (semantic_1VN) of the target vocabulary and its meaning can be constructed.

[0111] like Figure 5 As shown, the initial historical text 502 having an associated relationship with the initial search text in the local historical text database can be determined based on the initial search text 501, and then the matching vocabulary set 503, the search text difference vocabulary set 504 and the historical text difference vocabulary set 505 are obtained based on the initial search text 501 and the initial historical text 502. Then, based on each target vocabulary in the above vocabulary sets, the network knowledge text can be obtained respectively, and the monosemous vocabulary table 506 and the polysemous vocabulary table 507 can be constructed respectively according to the network knowledge text.

[0112] According to an embodiment of the present disclosure, before performing text embedding processing on the initial search text and the initial history text using the network knowledge text to obtain the processed target search text and target history text:

[0113] The word sense categories are determined based on the unisense vocabulary, the polysense vocabulary, the matching vocabulary set and the difference vocabulary set. The word sense categories include the unisense matching vocabulary set, the polysense matching vocabulary set, the unisense difference vocabulary set and the polysense difference vocabulary set.

[0114] like Figure 5 As shown, the word meaning category can be determined based on the matching vocabulary set 503, the search text difference vocabulary set 504, the historical text difference vocabulary set 505, the monosemous vocabulary table 506 and the polysemous vocabulary table 507, so as to subsequently perform network knowledge text embedding processing according to the word meaning category, and determine the target text 5010 corresponding to the target historical text 509 with the highest similarity probability value based on the target search text 508 and the target historical text 509 obtained by the embedding processing.

[0115] According to an embodiment of the present disclosure, network knowledge text is obtained based on matching vocabulary, first differential vocabulary, and second differential vocabulary, and then a monosemous vocabulary list and a polysemous vocabulary list are constructed based on the number of word meaning texts in the network knowledge text. Through the above technical means, the network knowledge word meaning text corresponding to each word can be obtained to address the technical issues of network-based and colloquial user input search texts and the high cost of constructing professional external knowledge, so that the network knowledge text can be subsequently introduced into the initial search text and initial historical text, thereby expanding the contextual information of the text.

[0116] Figure 6(a) to Figure 6(f) The following schematically illustrates a diagram of word sense embedding discrimination according to an embodiment of the present disclosure.

[0117] According to an embodiment of the present disclosure, one or more word meaning texts and an initial search text are input into a pre-trained semantic coding model to obtain a search text similarity result. One or more word meaning texts and an initial historical text are input into a pre-trained semantic coding model to obtain a historical text similarity result. Based on the search text similarity result and the historical text similarity result, a search text word meaning set and a historical text word meaning set are determined according to a preset threshold.

[0118] According to an embodiment of the present disclosure, it is possible to predetermine whether a word in a matching word set is a monosemous word. If it is a monosemous word, it can be considered that the initial search text and the initial historical text are embedded with the same word meaning text, and the word meaning text can be determined as a redundant word meaning and filtered.

[0119] According to an embodiment of the present disclosure, a BERT model can be selected as a semantic encoding model to perform semantic vector representation on the initial search text and the initial historical text, as well as the word meaning texts in the polysemous matching vocabulary set, the single-meaning difference vocabulary set, and the polysemous difference vocabulary set, and calculate the semantic similarity between the word meaning text and the initial search text and the initial historical text. The search text word meaning set (user_semantic) and the historical text word meaning set (local_semantic) are determined by a preset threshold (θ).

[0120] According to an embodiment of the present disclosure, determining the search text word sense set and the historical text word sense set based on the search text similarity result and the historical text similarity result according to a preset threshold includes:

[0121] In response to the search text similarity result being greater than a preset threshold, the search text unisense matching word sense set, the search text polysense matching word sense set, the search text unisense difference word sense set, and the search text polysense difference word sense set are determined based on the polysense matching word set, the unisense difference word set, and the polysense difference word set. In response to the historical text similarity result being greater than a preset threshold, the historical text unisense matching word sense set, the historical text polysense matching word sense set, the historical text unisense difference word sense set, and the historical text polysense difference word sense set are determined based on the polysense matching word set, the unisense difference word set, and the polysense difference word set.

[0122] As shown in Figure 6(a), for a polysemous matching vocabulary set, the semantic similarity of each word semantic text (word_semantic) with the initial search text (user_question) and the initial historical text (local_question) can be calculated. If the similarity between the word semantic text (word_semantic) and the initial search text (user_question) is greater than a preset threshold, the search text can be determined to match the word semantic set (user_match_semantic); if the similarity between the word semantic text (word_semantic) and the initial historical text (local_question) is greater than a preset threshold, the historical text can be determined to match the word semantic set (local_match_semantic).

[0123] As shown in FIG6(b), after the threshold judgment, the search text matching word meaning set (user_match_semantic) can be determined as the search text monosemous matching word meaning set (user_match_semantic_1V1) and the search text polysemous matching word meaning set (user_match_semantic_1VN) according to the number of retained word meaning texts corresponding to each vocabulary.

[0124] As shown in Figure 6(c), after the threshold judgment, the historical text matching word meaning set (local_match_semantic) can be determined as the historical text monosemous matching word meaning set (local_match_semantic_1V1) and the historical text polysemous matching word meaning set (local_match_semantic_1VN) according to the number of retained word meaning texts corresponding to each vocabulary.

[0125] As shown in Figure 6(d), for a polysemous difference vocabulary set, the semantic similarity of each word semantic text (word_semantic) with the initial search text (user_question) and the initial historical text (local_question) can be calculated. If the similarity between the word semantic text (word_semantic) and the initial search text (user_question) is greater than a preset threshold, the search text difference word semantic set (user_dif_semantic) can be determined; if the similarity between the word semantic text (word_semantic) and the initial historical text (local_question) is greater than a preset threshold, the historical text matching word semantic set (local_dif_semantic) can be determined.

[0126] As shown in Figure 6(e), after the threshold judgment, the search text difference word sense set (user_dif_semantic) can be determined as the search text unisense difference word sense set (user_dif_semantic_1V1) and the search text polysense difference word sense set (user_dif_semantic_1VN) according to the number of retained semantic texts corresponding to each vocabulary.

[0127] As shown in Figure 6(f), after the threshold judgment, the historical text difference word meaning set (local_dif_semantic) can be determined as the historical text single-sense difference word meaning set (local_dif_semantic_1V1) and the historical text polysemous difference word meaning set (local_dif_semantic_1VN) according to the number of retained word meaning texts corresponding to each vocabulary.

[0128] According to an embodiment of the present disclosure, for a set of univocal difference words, semantic similarity calculations can be performed on each word semantic text (word_semantic) with the initial search text (user_question) and the initial historical text (local_question). If the similarity between the word semantic text (word_semantic) and the initial search text (user_question) is greater than a preset threshold, the word semantic text can be added to the search text univocal difference word semantic set (user_dif_semantic_1V1). If the similarity between the word semantic text (word_semantic) and the initial historical text (user_question) is greater than a preset threshold, the word semantic text can be added to the historical text univocal difference word semantic set (local_dif_semantic_1V1).

[0129] According to the embodiments of the present disclosure, by utilizing the search text similarity results and the historical text similarity results obtained by the semantic coding model, the search text word meaning set and the historical text word meaning set are determined respectively. The interference of redundant information in deep semantic coding can be reduced through similarity judgment, and the key semantics can be extracted based on deep semantic understanding technology, so that the streamlined and converted network knowledge can be subsequently embedded into the search text and historical text, thereby improving the matching effect.

[0130] Figure 7 A schematic diagram of text embedding categories according to an embodiment of the present disclosure is schematically shown.

[0131] According to an embodiment of the present disclosure, text embedding processing includes embedding categories, and the text processing method further includes:

[0132] If the word sense category is a polysemous matching word sense set, the embedding category is determined to be permutation embedding. If the word sense category is a monosemous difference word sense set, the embedding category is determined to be fixed embedding. If the word sense category is a polysemous difference word sense set, the embedding category is determined to be combination embedding.

[0133] According to an embodiment of the present disclosure, the word meaning text can be embedded into the initial search text and the initial history text respectively by arrangement, fixing and combination according to the word meaning category to obtain multiple target search texts (new_user_questions) and target history texts (new_local_questions).

[0134] like Figure 7As shown, for example, fixed embedding can be performed on the initial search text 701 and the search text unisense difference word meaning set 702, as well as the historical text unisense difference word meaning set 703 and the initial historical text 704. Permutation embedding can be performed on the search text polysense matching word meaning set 705 and the historical text polysense matching word meaning set 706. Combined embedding can be performed on the search text polysense difference word meaning set 707 and the historical text polysense difference word meaning set 708 to obtain the target search text 709 and the target historical text 7010.

[0135] According to the embodiments of the present disclosure, by determining the embedding category of text embedding processing based on the word sense category, and embedding the corresponding word sense text into the initial search text and the initial historical text respectively through arranged embedding, fixed embedding and combined embedding, the fusion effect of the network knowledge word sense text in the search text and the historical text is improved, the context information of the search text and the historical text is expanded, and the real-time and domain-specific expansion of the semantic context information is achieved.

[0136] According to an embodiment of the present disclosure, determining a target text corresponding to the target historical text according to the target search text and the target historical text includes:

[0137] The target search text and target historical text are input into a pre-trained semantic matching model to obtain matching results. The target historical text is sorted based on the matching results to obtain sorting results. Based on the sorting results, the target text corresponding to the target historical text is determined.

[0138] According to an embodiment of the present disclosure, a KBERT model may be selected as a semantic matching model to perform semantic matching on a target search text and a target historical text obtained after processing based on different text embedding categories.

[0139] According to an embodiment of the present disclosure, the KBERT model designs soft positions and visible matrices in the network structure. The soft positions can alleviate the impact of external knowledge embedding on the destruction of the original sentence structure, and the visible matrix can avoid the impact of noise knowledge on the overall semantics of the sentence.

[0140] According to an embodiment of the present disclosure, the target search text and the target history text can be sorted according to their similarity probability values, and the target search text and the target history text with the highest similarity probability value can be used as the semantic matching results of the initial search text and the parameter history text. Then, the target text corresponding to the target history text can be determined, and the target text can be used as the answer to the initial search text.

[0141] According to an embodiment of the present disclosure, by utilizing a semantic matching model to obtain similarity probability values ​​between a target search text embedded with network knowledge and a target historical text, the local historical text with the highest similarity probability value can be used as the semantic matching result most similar to the user search text, and the target text corresponding to the local historical text can be determined as the answer to the user search text, thereby improving the matching effect between the user search text and the local historical text.

[0142] Figure 8 The block diagram schematically shows a text processing apparatus according to an embodiment of the present disclosure.

[0143] like Figure 8 As shown, the text processing device 800 includes a first determining module 801 , an acquiring module 802 , a processing module 803 and a second determining module 804 .

[0144] The first determination module 801 is used to determine, in response to receiving an initial search text, an initial historical text associated with the initial search text from a historical text database based on the initial search text, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text have a one-to-one correspondence.

[0145] The acquisition module 802 is used to acquire network knowledge text according to the initial search text and the initial history text.

[0146] The processing module 803 is used to use the network knowledge text to perform text embedding processing on the initial search text and the initial history text respectively, so as to obtain the processed target search text and target history text.

[0147] The second determining module 804 is configured to determine a target text corresponding to the target historical text according to the target search text and the target historical text.

[0148] According to an embodiment of the present disclosure, an initial historical text is determined based on an initial search text, and network knowledge text is obtained based on the initial search text and the initial historical text. Then, a target search text and a target historical text are obtained through text embedding processing, and a target text corresponding to the target historical text is determined. The above-mentioned technical means at least partially overcome the technical problem in the related art of short text matching technology in application scenarios, which is that the user's search text is networked and colloquial, and the cost of building structured external knowledge is high, resulting in a poor user experience, thereby improving the text matching effect.

[0149] According to an embodiment of the present disclosure, the text processing device 800 further includes a word segmentation module, a preprocessing module, and a matching module.

[0150] The word segmentation module is used to perform word segmentation processing on the initial search text and the initial history text respectively to obtain the initial search text word sequence and the initial history text word sequence.

[0151] The preprocessing module is used to preprocess the initial search text word sequence and the initial history text word sequence to obtain a preprocessed search text word sequence and a history text word sequence, wherein the preprocessing includes at least one of stop word filtering and punctuation filtering.

[0152] The matching module is used to match the preprocessed search text word sequence and the historical text word sequence to obtain a matching vocabulary set and a difference vocabulary set, wherein the difference vocabulary set includes the search text difference vocabulary set and the historical text difference vocabulary set.

[0153] According to an embodiment of the present disclosure, the matching vocabulary set includes matching vocabulary that matches in the search text word sequence and the historical text word sequence, the search text difference vocabulary set includes first difference vocabulary that does not match the historical text word sequence in the search text word sequence, and the historical text difference vocabulary set includes second difference vocabulary that does not match the search text word sequence in the historical text word sequence.

[0154] According to an embodiment of the present disclosure, the acquisition module 802 includes an acquisition unit, a first construction unit, and a second construction unit.

[0155] The acquisition unit is configured to respectively acquire network knowledge texts according to each target word in the matching words, the first difference words, and the second difference words, wherein the network knowledge texts include one or more word meaning texts corresponding to the target words.

[0156] The first construction unit is used to construct a monosemous vocabulary when the network knowledge text includes a word meaning text, wherein the monosemous vocabulary is used to represent the corresponding relationship between at least one target word and a word meaning text.

[0157] The second construction unit is used to construct a polysemous vocabulary when the network knowledge text includes multiple word meaning texts, wherein the polysemous vocabulary is used to represent the corresponding relationship between at least one target word and multiple word meaning texts.

[0158] According to an embodiment of the present disclosure, the text processing apparatus 800 further includes a third determining module.

[0159] The third determination module is used to determine the word meaning category based on the unisense vocabulary, the polysense vocabulary, the matching vocabulary set and the difference vocabulary set, wherein the word meaning category includes the unisense matching vocabulary set, the polysense matching vocabulary set, the unisense difference vocabulary set and the polysense difference vocabulary set.

[0160] According to an embodiment of the present disclosure, the text processing apparatus 800 further includes: a first encoding module, a second encoding module, and a fourth determining module.

[0161] The first encoding module is used to input one or more word meaning texts and the initial search text into a pre-trained semantic encoding model to obtain a search text similarity result.

[0162] The second encoding module is used to input one or more word meaning texts and initial historical texts into a pre-trained semantic encoding model to obtain historical text similarity results.

[0163] The fourth determining module is configured to determine the search text word sense set and the historical text word sense set based on the search text similarity result and the historical text similarity result according to a preset threshold.

[0164] According to an embodiment of the present disclosure, the fourth determining module includes a first determining unit and a second determining unit.

[0165] The first determination unit is used to determine the search text unisense matching word meaning set, the search text polysense matching word meaning set, the search text unisense difference word meaning set and the search text polysense difference word meaning set based on the polysense matching word set, the unisense difference word meaning set and the polysense difference word meaning set in response to the search text similarity result being greater than a preset threshold.

[0166] The second determination unit is used to determine the historical text unisense matching word meaning set, the historical text polysense matching word meaning set, the historical text unisense difference word meaning set and the historical text polysense difference word meaning set based on the polysense matching word set, the unisense difference word meaning set and the polysense difference word meaning set in response to the historical text similarity result being greater than a preset threshold.

[0167] According to an embodiment of the present disclosure, the text embedding process includes embedding categories, and the text processing apparatus 800 further includes a fifth determining module, a sixth determining module, and a seventh determining module.

[0168] The fifth determination module is used to determine that the embedding category is permutation embedding when the word sense category is a polysemous matching word sense set.

[0169] The sixth determination module is used to determine the embedding category as fixed embedding when the word sense category is a single-meaning difference word sense set.

[0170] The seventh determination module is used to determine that the embedding category is a combined embedding when the word sense category is a polysemous difference word sense set.

[0171] According to an embodiment of the present disclosure, the second determination module 804 includes a matching unit, a sorting unit, and a third determination unit.

[0172] The matching unit is used to input the target search text and the target historical text into the pre-trained semantic matching model to obtain the matching results.

[0173] The sorting unit is used to sort the target historical text according to the matching result to obtain a sorting result.

[0174] The third determining unit is configured to determine a target text corresponding to the target historical text according to the sorting result.

[0175] According to the modules, submodules, units, and subunits of the embodiments of the present invention, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof can be split into multiple modules for implementation. According to the modules, submodules, units, and subunits of the embodiments of the present invention, any one or more thereof can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, according to the modules, submodules, units, and subunits of the embodiments of the present invention, one or more thereof can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is run.

[0176] For example, any multiple of the first determining module 801, the acquisition module 802, the processing module 803 and the second determining module 804 can be combined into one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more modules / units / sub-units in these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first determining module 801, the acquisition module 802, the processing module 803 and the second determining module 804 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the first determination module 801 , the acquisition module 802 , the processing module 803 and the second determination module 804 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.

[0177] It should be noted that the text processing device part in the embodiment of the present disclosure corresponds to the text processing method part in the embodiment of the present disclosure. The description of the text processing device part specifically refers to the text processing method part and will not be repeated here.

[0178] Figure 9 A block diagram of an electronic device suitable for implementing a text processing method according to an embodiment of the present disclosure is schematically shown. Figure 9 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0179] like Figure 9 As shown, the computer electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 909 into a random access memory (RAM) 903. The processor 901 may, for example, include a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (such as an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for executing different actions of the method flow according to an embodiment of the present disclosure.

[0180] Various programs and data required for the operation of the electronic device 900 are stored in the RAM 903. The processor 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. The processor 901 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 902 and / or the RAM 903. It should be noted that the programs may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.

[0181] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the I / O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card or a modem. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in the drive 910 as needed, so that a computer program read therefrom can be installed into the storage portion 908 as needed.

[0182] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0183] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.

[0184] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0185] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 902 and / or the RAM 903 described above and / or one or more memories other than the ROM 902 and the RAM 903 .

[0186] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the text processing method provided by the embodiment of the present disclosure.

[0187] When the computer program is executed by the processor 901, the above functions defined in the system / device of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0188] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0189] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0190] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes may occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, as well as the combination of boxes in the block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in various ways, and all such combinations and / or couplings fall within the scope of the present disclosure.

[0191] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A text processing method, comprising: In response to receiving an initial search text, determining, based on the initial search text, an initial historical text associated with the initial search text from a historical text database, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text are in one-to-one correspondence; Acquiring network knowledge text according to the initial search text and the initial history text; Determining a word sense category based on the number of word sense texts corresponding to the target vocabulary in the network knowledge text, and determining an embedding category for text embedding processing based on the word sense category; Using the network knowledge text, based on the embedding category, respectively performing text embedding processing on the initial search text and the initial history text to obtain processed target search text and target history text; and According to the target search text and the target historical text, a target text corresponding to the target historical text is determined.

2. The method according to claim 1 , further comprising, after determining, in response to receiving the initial search text, an initial historical text associated with the initial search text from a historical text database based on the initial search text: Performing word segmentation processing on the initial search text and the initial history text respectively to obtain an initial search text word sequence and an initial history text word sequence; The initial search text word sequence and the initial historical text word sequence are preprocessed to obtain a preprocessed search text word sequence and a historical text word sequence, wherein: The pre-processing includes at least one of stop word filtering and punctuation filtering; as well as The pre-processed search text word sequence and the historical text word sequence are matched to obtain a matching vocabulary set and a difference vocabulary set, wherein the difference vocabulary set includes a search text difference vocabulary set and a historical text difference vocabulary set.

3. The method according to claim 2, wherein: The matching vocabulary set includes matching vocabulary in the search text word sequence and the historical text word sequence, the search text difference vocabulary set includes first difference vocabulary in the search text word sequence that does not match the historical text word sequence, and the historical text difference vocabulary set includes second difference vocabulary in the historical text word sequence that does not match the search text word sequence; The acquiring of network knowledge text according to the initial search text and the initial history text comprises: According to each target word in the matching words, the first difference words, and the second difference words, respectively, the network knowledge text is obtained, wherein the network knowledge text includes one or more word meaning texts corresponding to the target words; In the case where the network knowledge text includes a word meaning text, constructing a monosyllabic vocabulary, wherein the monosyllabic vocabulary is used to represent the corresponding relationship between at least one target word and one word meaning text; and In the case that the network knowledge text includes a plurality of the word meaning texts, a polysemous vocabulary is constructed, wherein the polysemous vocabulary is used to represent the correspondence between at least one of the target words and the plurality of the word meaning texts.

4. The method according to claim 3 further comprises, before using the network knowledge text to perform text embedding processing on the initial search text and the initial history text to obtain the processed target search text and target history text: The word meaning category is determined based on the univocal vocabulary, the polyvocal vocabulary, the matching vocabulary set and the difference vocabulary set, wherein: The word meaning categories include a single-sense matching vocabulary set, a polysense matching vocabulary set, a single-sense difference vocabulary set, and a polysense difference vocabulary set.

5. The method according to claim 4, further comprising: Inputting one or more of the word meaning texts and the initial search text into a pre-trained semantic encoding model to obtain a search text similarity result; Inputting one or more of the word meaning texts and the initial historical text into the pre-trained semantic encoding model to obtain a historical text similarity result; as well as According to a preset threshold, based on the search text similarity result and the historical text similarity result, a search text word sense set and a historical text word sense set are determined.

6. The method according to claim 5, wherein: The determining of the search text word meaning set and the historical text word meaning set based on the search text similarity result and the historical text similarity result according to the preset threshold comprises: In response to the search text similarity result being greater than the preset threshold, determining a search text unisense matching word sense set, a search text polysense matching word sense set, a search text unisense difference word sense set, and a search text polysense difference word sense set based on the polysense matching word set, the unisense difference word set, and the polysense difference word set; In response to the historical text similarity result being greater than the preset threshold, the historical text unisense matching word meaning set, the historical text polysense matching word meaning set, the historical text unisense difference word meaning set and the historical text polysense difference word meaning set are determined based on the polysense matching vocabulary set, the unisense difference vocabulary set and the polysense difference vocabulary set.

7. The method according to any one of claims 3 to 6, further comprising: In a case where the word sense category is a polysemous matching word sense set, determining the embedding category to be a permutation embedding; In a case where the word sense category is a single-meaning difference word sense set, determining the embedding category to be a fixed embedding; as well as In the case where the word sense category is a polysemous difference word sense set, the embedding category is determined to be a combined embedding.

8. The method according to any one of claims 1 to 6, wherein The determining of the target text corresponding to the target historical text according to the target search text and the target historical text includes: Inputting the target search text and the target historical text into a pre-trained semantic matching model to obtain a matching result; Sorting the target historical texts according to the matching results to obtain a sorting result; and According to the sorting result, a target text corresponding to the target historical text is determined.

9. A text processing device comprising: a first determining module configured to, in response to receiving an initial search text, determine, based on the initial search text, an initial historical text associated with the initial search text from a historical text database, wherein the historical text database includes at least one historical text and at least one matching text, and the at least one historical text and the at least one matching text have a one-to-one correspondence; An acquisition module, configured to acquire network knowledge text according to the initial search text and the initial history text; Determining a word sense category based on the number of word sense texts corresponding to the target vocabulary in the network knowledge text, and determining an embedding category for text embedding processing based on the word sense category; a processing module, configured to perform text embedding processing on the initial search text and the initial history text respectively using the network knowledge text, to obtain processed target search text and target history text; and The second determining module is configured to determine a target text corresponding to the target historical text according to the target search text and the target historical text.

10. An electronic device comprising: one or more processors; a memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to any one of claims 1 to 8.

12. A computer program product comprising computer executable instructions, wherein the computer executable instructions are used to implement the method according to any one of claims 1 to 8 when executed.

Citation Information

Patent Citations

  • Related information obtaining method and apparatus

    CN106557476A

  • Knowledge base-based question answer determination method and apparatus

    CN111159363A