CN111651606B - Text processing method and device and electronic equipment - Google Patents
Text processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN111651606B CN111651606B CN202010505583.9A CN202010505583A CN111651606B CN 111651606 B CN111651606 B CN 111651606B CN 202010505583 A CN202010505583 A CN 202010505583A CN 111651606 B CN111651606 B CN 111651606B
- Authority
- CN
- China
- Prior art keywords
- sentence
- character relation
- interactive
- binary group
- triples
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title abstract description 12
- 230000002452 interceptive effect Effects 0.000 claims abstract description 166
- 238000013145 classification model Methods 0.000 claims abstract description 88
- 238000000034 method Methods 0.000 claims abstract description 41
- 238000012549 training Methods 0.000 claims abstract description 29
- 238000012545 processing Methods 0.000 claims abstract description 19
- 238000002372 labelling Methods 0.000 claims description 31
- 230000004931 aggregating effect Effects 0.000 claims description 9
- 238000004891 communication Methods 0.000 description 50
- 238000000605 extraction Methods 0.000 description 46
- 230000008569 process Effects 0.000 description 8
- 230000003993 interaction Effects 0.000 description 7
- 239000000284 extract Substances 0.000 description 6
- 206010023126 Jaundice Diseases 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000002457 bidirectional effect Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 206010035664 Pneumonia Diseases 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 201000010099 disease Diseases 0.000 description 2
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000036541 health Effects 0.000 description 2
- 206010020772 Hypertension Diseases 0.000 description 1
- 208000019693 Lung disease Diseases 0.000 description 1
- 241000124033 Salix Species 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000006116 polymerization reaction Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000009469 supplementation Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
- G06F16/355—Class or cluster creation or modification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/117—Tagging; Marking up; Designating a block; Setting of attributes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/01—Customer relationship services
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Business, Economics & Management (AREA)
- Development Economics (AREA)
- Data Mining & Analysis (AREA)
- Accounting & Taxation (AREA)
- Databases & Information Systems (AREA)
- Economics (AREA)
- Finance (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Machine Translation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a text processing method, a text processing device and electronic equipment, wherein the method comprises the following steps: obtaining an interactive text containing a plurality of interactive sentences; obtaining a binary group comprising an entity word and a trigger word in an interactive sentence; obtaining at least one character relation descriptor corresponding to the context sentence of the interactive sentence where the binary group is located; inputting at least the binary group and at least one character relation descriptor corresponding to the binary group into the multi-classification model to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model; the entity words and the trigger words in the binary groups and the target character relation description words corresponding to the binary groups form triples corresponding to the interactive sentences; the multi-classification model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples are also provided with character relation descriptor labels corresponding to the binary group labels in the context sentences of the first sentence samples, and P is the number of the character relation descriptor types.
Description
Technical Field
The present disclosure relates to the field of text processing technologies, and in particular, to a text processing method, a text processing device, and an electronic device.
Background
In customer service systems or other interactive systems, communication records, such as voice or text, are typically recorded between users. To facilitate data management, it is often necessary to process the content of the communication record, thereby obtaining summarized content.
At present, a triplet extraction model of entity and relationship is generally adopted to extract the content of the communication record, so as to obtain a triplet composed of the entity, the trigger word and the role, and the triplet is used for representing the summarized content of the communication record. The joint extraction model in such schemes is typically built and trained based on sequence labeling algorithms, which rely on sentences with manually labeled entities, roles, and trigger words. For example, for general chapter information, the triple extraction model may be used to extract the triple of the sentence, so as to obtain the triple information of the complete entity and relationship, for example (china, capital, beijing).
However, the relationship of character reference may be hidden in the interactive sentences of the communication records, for example, "i am difficult to produce when i am child is born, and there is jaundice later", then the relationship of character corresponding to the entity word and the trigger word (disease, jaundice) may be identified as "i am", but actually "child", so the current extraction model has the situation of extraction error when performing triplet extraction on the interactive sentences of the communication content, so that the accuracy is lower.
Disclosure of Invention
In view of this, the present application provides a text processing method, a text processing device, and an electronic device, as follows:
a text processing method, the method comprising:
obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences;
obtaining a binary group in the interactive sentence, wherein the binary group comprises an entity word and a trigger word;
obtaining at least one character relation descriptor corresponding to a context sentence of the interactive sentence where the binary group is located;
inputting at least the two groups and at least one character relation descriptor corresponding to the two groups into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the two groups output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relationship description words corresponding to the two-tuple form a three-tuple corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples are at least provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, and P is the number of the character relation descriptor types.
The method, preferably, obtains the two-tuple in the interactive sentence, including:
inputting the interactive sentences into a pre-trained sequence annotation model to obtain a binary group output by the sequence annotation model;
the sequence labeling model is obtained by training at least two second sentence samples with entity word labels and trigger word labels.
The method preferably obtains at least one character relation descriptor corresponding to the context sentence of the interactive sentence where the binary group is located, and the method is realized by any one or more of the following modes:
obtaining at least one character relation descriptor in sentence indexes corresponding to the binary groups in the interactive text;
at least one character relation descriptor closest to the binary group is obtained in the interactive text;
at least one character relation description word is obtained in the interactive sentences adjacent to the interactive sentences before and after the interactive sentences where the binary groups are located in the interactive text;
and obtaining at least one character relation descriptor in the interactive sentence before the interactive sentence where the binary group is located in the interactive text.
The above method, preferably, the method further comprises:
Obtaining attribute characteristics of entity words in the binary groups and character subject descriptors of the binary groups in a grammar tree;
at least inputting the two groups and at least one character relation descriptor corresponding to the two groups into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the two groups output by the multi-classification model, wherein the method comprises the following steps:
and inputting the binary group and at least one character relation descriptor corresponding to the binary group, the attribute characteristics and the task subject descriptor into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model.
The above method, preferably, the method further comprises:
and aggregating the triples according to the target person relationship descriptors therein so that the triples with the same target person relationship descriptors are in the same triplet set.
In the above method, preferably, the triplet further has a confidence value corresponding to the target character relationship descriptor;
wherein the method further comprises:
adding the confidence values corresponding to the triples in the triplet set to obtain the scores corresponding to the target character relation descriptors;
And obtaining a target triplet set corresponding to the score meeting the threshold condition, wherein the target triplet set represents user portrait information of the user corresponding to the target person relationship descriptor.
The above method, preferably, the method further comprises:
and arranging the triples in the triplet set according to the time attribute corresponding to the triples.
A text processing apparatus, the apparatus comprising:
a text obtaining unit, configured to obtain an interactive text, where the interactive text includes a plurality of interactive sentences;
the binary group obtaining unit is used for obtaining a binary group in the interactive sentence, wherein the binary group comprises an entity word and a trigger word;
the character relation obtaining unit is used for obtaining at least one corresponding character relation description word in the context sentence of the interactive sentence where the binary group is located;
the target relation obtaining unit is used for inputting at least the binary group and at least one character relation descriptor corresponding to the binary group into a pre-trained multi-classification model so as to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relationship description words corresponding to the two-tuple form a three-tuple corresponding to the interactive sentence;
The multi-classification model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples are at least provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, and P is the number of the character relation descriptor types.
The above device, preferably, further comprises:
the portrait obtaining unit is used for aggregating the triples according to the target person relation descriptors therein so that the triples with the same target person relation descriptors are in the same triplet set; the triplet also has a confidence value corresponding to the target character relation descriptor; adding the confidence values corresponding to the triples in the triplet set to obtain the scores corresponding to the target character relation descriptors; and obtaining a target triplet set corresponding to the score meeting the threshold condition, wherein the target triplet set represents user portrait information of the user corresponding to the target person relationship descriptor.
An electronic device, comprising:
a memory for storing an application program and data generated by the operation of the application program;
A processor for executing the application program to realize: obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining a binary group in the interactive sentence, wherein the binary group comprises an entity word and a trigger word; obtaining at least one character relation descriptor corresponding to a context sentence of the interactive sentence where the binary group is located; inputting at least the two groups and at least one character relation descriptor corresponding to the two groups into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the two groups output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relation description words corresponding to the two-tuple form a three-tuple of the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples are at least provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, and P is the number of the character relation descriptor types.
According to the technical scheme, in the text processing method, the text processing device and the electronic equipment disclosed by the application, after the interactive text containing a plurality of interactive sentences is obtained, the tuples in the interactive sentences are obtained firstly, such as real words and trigger words, then character relation descriptors in the context sentences of the interactive sentences where the tuples are located are counted, then the character relation descriptors and the tuples can be used as inputs of a pre-trained multi-classification model, further, one target character relation descriptor corresponding to the tuples output by the multi-classification model is obtained, and the target character relation descriptors at the moment can form triples of the interactive sentences together with entity words and trigger words in the tuples, so that the triples are extracted, and the multi-classification model is obtained by training sentence samples with character relation descriptor tags in the context sentences. Therefore, aiming at the condition that the character relation descriptors are hidden, the character relation descriptors existing in the context sentence of the sentence where the binary group is located are learned and classified by utilizing the multi-classification model, so that the target character relation descriptors corresponding to the binary group are obtained, the situation that the extraction of the ternary group or the extraction error cannot be realized when the character relation descriptors are hidden in the interactive sentence where the binary group is located is avoided, and the extraction accuracy of the ternary group is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a text processing method according to a first embodiment of the present application;
fig. 2 and fig. 3 are respectively another flowchart of a text processing method according to a first embodiment of the present application;
fig. 4 is a schematic structural diagram of a text processing device according to a second embodiment of the present application;
fig. 5 is another schematic structural diagram of a text processing device according to a second embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
fig. 7 is a flowchart illustrating triple extraction of a communication text in the protection field according to an embodiment of the present application.
Detailed Description
Taking the technical scheme in the application as an example applied to the insurance field, the application exemplifies triage of interactive sentences generated by insurance consultants and clients about pre-sale and after-sale consultants:
Firstly, the consultant and the customer are usually contacted in an online mode, then more personal information and family information of the customer are known through deep communication, then personalized family shopping insurance scheme design is carried out for the customer, and finally the customer selects products which meet the mind to apply.
There are many ways in which the communication records of the consultants and clients are usually recorded, such as telephone communication, online consultation, etc. While the advisor may remain in intermittent contact with the client for perhaps one to two weeks. In order to facilitate the following of the client situation, the consultant generally makes a communication summary after the communication is completed. However, since the recording habits of the consultants are different from person to person, and the time and place may cause inconvenience in timely recording, the manual way of making a call junction has a great limitation. Therefore, the method for manually recording and totalizing the communication records by pure manpower is time-consuming and labor-consuming, does not have a unified standardized format, is not easy to have complete overall cognition for the clients, and is not convenient for the companies to master the client profile in the marketing process.
Based on the above, the inventor of the application finds that the communication summary, the expression form and the writing format recorded by the consultant manually are relatively random, the recording quality is low, and some communication contents are not summarized. In addition, some consultants feedback is time-consuming, labor-consuming, low in efficiency and easy to miss. Because the consultants do different recording habits and personal thinking modes, the call summary does not have a unified standardized format, so that the company is not easy to grasp the client profile in the marketing process. Therefore, at present, a triplet extraction model can be adopted to extract a triplet composed of entity words, trigger words and character relation descriptors of text contents recorded by a consultant, and then the triplet is used as a communication summary content to represent a user portrait of a user corresponding to the character relation descriptors.
However, the current triplet extraction model can directly extract the triplet for articles or paragraphs and the like in which character relation descriptors are explicitly expressed in text contents, but can not extract character relation descriptors or ash in the case that character relations are hidden in the text or character relations are not expressed in the text.
The inventor of the application further researches and proposes a triplet acquisition scheme based on joint labeling and cross-context. In the scheme, the call summary can be generated by automatically and structurally analyzing the personal information of the user and the family information of the user in the communication records of the consultant and the client based on the joint labeling and the cross-context indication. Of course, further, the call nodules can be connected in series according to the communication record time axis, and comprehensive reasoning is performed to form a user portrait with perfect user.
Specifically, the text processing method in the technical scheme in the application may include the following processing flows:
firstly, obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining a binary group in the interactive sentence, wherein the binary group comprises an entity word and a trigger word; then, obtaining at least one character relation descriptor corresponding to the context sentence of the interactive sentence where the binary group is located; then at least inputting the binary group and at least one character relation descriptor corresponding to the binary group into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relationship description words corresponding to the two-tuple form a three-tuple corresponding to the interactive sentence;
The multi-classification model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples are at least provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, and P is the number of the character relation descriptor types.
Therefore, aiming at the condition that the character relation descriptors are hidden, the character relation descriptors existing in the context sentence of the sentence where the binary group is located are learned and classified by utilizing the multi-classification model, so that the target character relation descriptors corresponding to the binary group are obtained, the situation that the extraction of the ternary group or the extraction error cannot be realized when the character relation descriptors are hidden in the interactive sentence where the binary group is located is avoided, and the extraction accuracy of the ternary group is improved.
In summary, aiming at the communication records between the consultants and the clients in the insurance field, the technical scheme of the application can automatically generate all communication records based on joint labeling and cross-context indication, and on the other hand, the technical scheme of the application connects the communication record time axes in series, carries out comprehensive reasoning according to the communication knot set, and improves the accuracy of user image extraction.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, a flowchart of an implementation of a text processing method according to an embodiment of the present application may be applicable to an electronic device capable of performing data processing, such as a computer or a server. The technical scheme in the embodiment is mainly used for extracting triples in sentences, such as entity words, trigger words and character relation descriptors, and improves extraction accuracy.
Specifically, the method in this embodiment may include the following steps:
step 101: and obtaining the interactive text.
Wherein, the interactive text can contain a plurality of interactive sentences. The interactive sentences in the interactive text can be sentences obtained by manually recording the handwriting content of one user or multiple users in the speech interaction process between the users and then carrying out text recognition, or the interactive sentences can be sentences obtained by recognizing the audio content recorded in the speech interaction process between the users and then carrying out audio processing, or the interactive sentences are sentences obtained by manually recording the electronic content of one user or multiple users in the speech interaction process between the users and then carrying out processing, and the like.
Taking an interaction scenario for pre-sale consultation in the insurance field as an example, the obtained interaction text in the embodiment includes: "you good, what you can help", "you good, i want to ask what you have insurance about children", "good, please provide younger children from birth to present physical condition", "child 2 years old", "how physically you look like", "i have difficulty producing child at that time, have jaundice at a later time", etc.
Step 102: the tuples in the interactive statement are obtained.
The two-tuple comprises entity words and trigger words in the sentence.
Specifically, in this embodiment, a binary set extraction algorithm or a model may be used to perform binary set extraction on each interactive sentence in the interactive text, so as to obtain a binary set composed of a physical word and a trigger word in the interactive sentence. For example, entity word and trigger word extraction is performed on the interactive sentence, so as to obtain a binary group consisting of "gender" and "woman", or obtain a binary group consisting of "age" and "2 years", and so on.
It should be noted that, in this embodiment, it is not limited that each sentence in the interactive text can extract a tuple, and only a part of interactive sentences may obtain a tuple. In this embodiment, only one tuple can be extracted from one interactive sentence, and one or more tuples may be extracted.
Step 103: and obtaining at least one corresponding character relation descriptor in the context sentence of the interactive sentence where the binary group is located.
The context sentence of the interactive sentence where the binary group is located can be understood as one or more interactive sentences which are adjacent to the interactive sentence where the binary group is located in the upper and lower directions in all interactive sentences of the interactive text. Taking the two-tuple "age" and "2 years" as an example, the interactive sentences in which they are located are: "child 2 years old", the context sentence of the interactive sentence contains 1 to M interactive sentences in the above, or the context sentence of the interactive sentence contains 1 to N interactive sentences in the below, or the context sentence of the interactive sentence contains 1 to M interactive sentences in the above and 1 to N interactive sentences in the below. Wherein M is a positive integer greater than or equal to 1, and N is a positive integer greater than or equal to 1.
Specifically, in this embodiment, text recognition may be performed on the context sentence of the interactive sentence where the tuple is located, so as to identify one or more character relationship descriptors corresponding to the context sentence of the interactive sentence where the tuple is located, for example, identify the character relationship descriptors such as "child" and "me" in the context sentence of the interactive sentence where the tuple is "age" and "2 year".
Step 104: at least inputting the binary group and at least one character relation descriptor corresponding to the binary group into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model.
Based on the above, the entity word and the trigger word in the binary group and the target character relation descriptor corresponding to the binary group form a triplet corresponding to the interactive sentence where the binary group is located.
The multi-classification model in this embodiment refers to: the model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples serving as training samples of the multi-classification model are provided with character relation descriptor labels corresponding to the binary group labels in the context sentences of the first sentence samples, and P is the number of the character relation descriptors needing to be classified in the multi-classification model, such as 8 character relation descriptors of principal, wife, husband, son, daughter, father, mother and the like. That is, the sentence sample in the training sample of the multi-classification model not only has the binary group label, but also has the character relation descriptor label, and the character relation descriptor label can be specifically a character relation descriptor manually selected and marked from at least one character relation descriptor corresponding to the context sentence of the sentence sample where the binary group label is located, such as 8 character relation descriptors in the foregoing.
Specifically, the multi-classification model can be constructed for various machine learning algorithms based on a neural network and the like, the multi-classification model comprises a plurality of model parameters, and the multi-classification model can learn or train input data based on the model parameters so as to output corresponding output results.
Based on this, the training process of the initially constructed multi-classification model is as follows:
selecting a current first sentence sample, at least counting at least one character relation descriptor corresponding to a binary group label in the current first sentence sample in a context sentence of the current first sentence sample, for example, the binary group label in the current first sentence sample may have 5 character relation descriptors of a person, a wife, a husband, a son and a daughter in the context sentence, and further obtaining attribute characteristics of entity words in the binary group label, character subject descriptors of the binary group label in a grammar tree and the like, wherein the character relation descriptors, the attribute characteristics of the entity words, the character subject descriptors and other characteristic data can be used as input data of a multi-classification model together with the binary group label, so that the variety of input data of the multi-classification model is enriched;
Then, taking the character relation descriptors corresponding to the binary group labels and other characteristic data which are obtained in addition as input of the multi-classification model, and further obtaining an output result of the multi-classification model, wherein the output result comprises the character relation descriptors corresponding to the binary group labels;
comparing the character relation descriptor in the output result with the character relation descriptor label corresponding to the binary group label to obtain a comparison result, wherein the comparison result represents the similarity degree between the character relation descriptor in the output result and the character relation descriptor label corresponding to the binary group label, for example, a loss function of the multi-classification model is utilized to obtain a comparison result, namely a value of the loss function;
according to the comparison result, model parameters in the multi-classification model are adjusted, for example, when character relation descriptors in the comparison result representation output result and character relation descriptor labels corresponding to the binary group labels are greatly different, neuron parameters and the like of a neural network in the multi-classification model are adjusted;
then, a new first sentence sample is selected again as the current first sentence sample, and the execution steps are returned: counting at least one character relation descriptor corresponding to the binary group label in the current first sentence sample in the context sentence of the current first sentence sample until the similarity degree between the character relation descriptor in the finally obtained comparison result representation output result and the character relation descriptor label corresponding to the binary group label meets the training condition, such as that the value of the loss function tends to be unchanged or minimum, and the training of the multi-classification model is completed at the moment.
In a specific implementation, at least one character relation descriptor corresponding to the binary group label in the current first sentence sample in the context sentence of the current first sentence sample may have any one or more of the following:
at least one character relation descriptor in a corresponding sentence index in a context sentence corresponding to a sentence sample where the binary group label is located;
at least one character relation descriptor closest to the binary group label in a context sentence corresponding to the sentence sample where the binary group label is located, such as the character relation descriptor closest to the binary group label in the front and rear sentences;
at least one character relation descriptor in a statement sample adjacent to the statement sample before and after the statement sample where the binary group label is located in a context statement corresponding to the statement sample where the binary group label is located, such as character relation descriptors contained in the statement sample adjacent to the statement sample 3 before and/or 3 after;
at least one person relationship descriptor in a sentence sample before the sentence sample where the binary group label is located in the context sentence corresponding to the sentence sample where the binary group label is located, for example, person relationship descriptors contained in the forward 4 adjacent sentence samples, and the like.
Based on the method, the trained multi-classification model can analyze and learn at least the binary group in the interactive sentence and one or more character relation descriptors corresponding to the binary group, and further extract the target character relation descriptors corresponding to the binary group in the interactive sentence, so that the target character relation descriptors, the entity words and the trigger words in the binary group form a triplet.
According to the above technical scheme, in the text processing method of the first embodiment of the present application, after obtaining the interactive text including a plurality of interactive sentences, first obtaining the tuples in the interactive sentences, such as solid words and trigger words, then counting the character relation descriptors in the context sentences of the interactive sentences in which the tuples are located, then using the character relation descriptors and the tuples as inputs of a pre-trained multi-classification model, and further obtaining a target character relation descriptor corresponding to the tuples output by the multi-classification model, where the target character relation descriptor can form the triples of the interactive sentences together with the entity words and the trigger words in the tuples, thereby realizing the extraction of the triples, and the multi-classification model is obtained by training sentence samples with character relation descriptor tags in the context sentences. Therefore, in the embodiment, aiming at the situation that the character relation descriptor is possibly hidden, the character relation descriptor existing in the context sentence of the sentence where the binary group is located can be learned and classified by using the multi-classification model, so that the target character relation descriptor corresponding to the binary group is obtained, and the situation that the extraction of the ternary group or the extraction error cannot be realized when the character relation descriptor is hidden in the interactive sentence where the binary group is located is avoided, thereby improving the extraction accuracy of the ternary group.
In one implementation, step 102, when obtaining the tuples in the interactive statement, may be implemented by:
and inputting the interactive sentences into a pre-trained sequence labeling model to obtain the binary groups output by the sequence labeling model.
The sequence labeling model can be a model obtained by training at least two second sentence samples with entity word labels and trigger word labels. The entity word tag and the trigger word tag form corresponding binary group tags. It should be noted that the second sentence sample may be the same as or different from the first sentence sample, that is, in this embodiment, the first sentence sample set may be selected in advance and the multiple classification models may be trained by using a plurality of first sentence samples therein, and the other second sentence samples may be selected in advance and the sequence labeling models may be trained by using a plurality of second sentence samples therein; or, in this embodiment, a first sentence sample set may be selected in advance, and a plurality of first sentence samples in the first sentence sample set are used as second sentence samples to train the sequence labeling model first, and then, the first sentence samples with the binary group labels are combined with character relationship descriptor labels in the context sentences of the sentences where the binary group labels are located (of course, the character relationship descriptors existing in the context sentences of the sentences where the binary group labels are contained) to train the multi-classification model.
Specifically, the sequence labeling model in this embodiment may be a bidirectional lstm+crf sequence labeling model based on a self-attention mechanism, and training is performed by using sentence samples with entity word labels and trigger word labels (of course, may also have entity relationship labels) until the value of the loss function of the sequence labeling model tends to be minimum or unchanged, so as to complete model training.
It should be noted that, the sequence labeling model in this embodiment may also extract entity categories corresponding to entity words in the binary groups, such as entity categories of age or gender.
In one implementation manner, step 103 is implemented by any one or any multiple of the following ways when obtaining at least one corresponding character relation descriptor in a context sentence of the interactive sentence where the tuple is located:
obtaining at least one character relation descriptor in sentence indexes corresponding to the binary groups in the interactive text;
at least one character relation descriptor closest to the binary group is obtained in the interactive text;
at least one character relation description word is obtained in the interactive sentences adjacent to the interactive sentences before and after the interactive sentences where the binary groups are located in the interactive text;
And obtaining at least one character relation descriptor in the interactive sentence before the interactive sentence where the binary group is located in the interactive text.
The character relation descriptors and the binary groups are enriched into input data of the multi-classification model, so that the multi-classification model can output the confidence coefficient of the character relation descriptors corresponding to the binary groups, which are accurate, for each character relation descriptor, and the target character relation descriptor with the highest confidence coefficient can be obtained.
Furthermore, in this embodiment, the input data of the multiple classification model may be further enriched, for example, attribute features of entity words in the tuples and character subject descriptors of the tuples in the syntax tree are obtained, and these attribute features and character subject descriptors are input into the multiple classification model together with the tuples and at least one corresponding character relationship descriptor, so as to obtain target character relationship descriptors corresponding to the tuples output by the multiple classification model.
In one implementation, after step 104, the method in this embodiment may further include the following steps, as shown in fig. 2:
Step 105: the triples are aggregated according to the target person relationship descriptors therein such that triples having the same target person relationship descriptors are in the same triplet set.
For example, triples having the same target person relationship descriptor, such as "child" or "mom", are partitioned together, whereby triples having the same target person relationship descriptor are in the same triplet set. Taking an interaction scene between a consultant and a customer in the insurance field as an example, in this embodiment, after triples having the same target character relation descriptor in the interaction text are aggregated into a triplet set, information of character granularity can be obtained, namely, the triplet set aggregated by the character relation descriptor, so as to generate a summary about the communication text, where the summary is composed of triples corresponding to each target character relation descriptor.
It should be noted that, in this embodiment, before the triples are aggregated, the triples may be arranged according to respective corresponding time attributes, and then the triples are connected in series according to a time sequence, and then the triples are aggregated according to the target person relationship descriptors therein, so that the triples having the same target person relationship descriptors are in the same triples set, and accordingly, the triples in the triples set are connected in series according to the time sequence;
Or, in this embodiment, after the triples are aggregated, the triples in each triplet set are arranged according to the time attribute corresponding to the triples, so that the triples in the triplet set are serially connected in time sequence.
Based on the above, the triplet may further have a confidence value corresponding to the target person relationship descriptor, and the confidence may further form a source group with the entity word, the trigger word, and the target person relationship descriptor in the triplet. Further, after step 105, the present embodiment may further include the following steps, as shown in fig. 3:
step 106: and adding the confidence values corresponding to the triples in the triples set to obtain the scores corresponding to the target character relationship descriptors.
For example, the confidence values for the triples contained in each triplet set are summed, whereby each triplet set has a score for its corresponding target person relationship descriptor, such as "child" or "mother".
Step 107: and obtaining a target triplet set corresponding to the score meeting the threshold condition, wherein the target triplet set represents user portrait information of the user corresponding to the target person relationship descriptor.
The score corresponding to the triplet set represents the accuracy or the confidence of the user image information of the user corresponding to the target character relationship descriptor, so that the target triplet set corresponding to the score which satisfies the threshold condition, for example, is greater than or equal to the preset threshold value, is considered to be capable of accurately representing the user image information of the user corresponding to the target character relationship descriptor, or is considered to be the minor junction content with higher reliability for representing the user image information of the user corresponding to the target character relationship descriptor, and for other triplet sets with scores smaller than the threshold value, the user image information of the user corresponding to the target character relationship descriptor cannot be accurately represented, or is considered to be the minor junction content with lower reliability for representing the user image information of the user corresponding to the target character relationship descriptor.
Referring to fig. 4, a schematic structural diagram of a text processing apparatus according to a second embodiment of the present application may be configured in an electronic device capable of performing data processing, such as a computer or a server. The technical scheme in the embodiment is mainly used for extracting triples in sentences, such as entity words, trigger words and character relation descriptors, and improves extraction accuracy.
Specifically, the apparatus in this embodiment may include the following units:
a text obtaining unit 401, configured to obtain an interactive text, where the interactive text includes a plurality of interactive sentences;
a binary group obtaining unit 402, configured to obtain a binary group in the interactive sentence, where the binary group includes an entity word and a trigger word;
a person relationship obtaining unit 403, configured to obtain at least one corresponding person relationship descriptor in a context sentence of an interactive sentence where the tuple is located;
a target relationship obtaining unit 404, configured to input at least the tuple and at least one person relationship descriptor corresponding to the tuple into a multi-classification model trained in advance, so as to obtain a target person relationship descriptor corresponding to the tuple output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relationship description words corresponding to the two-tuple form a three-tuple corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples are at least provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, and P is the number of the character relation descriptor types.
As can be seen from the above technical solution, in the text processing apparatus according to the second embodiment of the present application, after obtaining an interactive text including a plurality of interactive sentences, first obtaining the tuples in the interactive sentences, such as solid words and trigger words, then counting the character relationship descriptors in the context sentences of the interactive sentences in which the tuples are located, then using these character relationship descriptors and tuples as inputs of a pre-trained multi-classification model, and further obtaining a target character relationship descriptor corresponding to the tuples output by the multi-classification model, where the target character relationship descriptor and the entity words and trigger words in the tuples together form a triplet of the interactive sentences, thereby implementing triplet extraction, where the multi-classification model is obtained by training sentence samples having a tuple tag and a character relationship descriptor tag in the context sentences. Therefore, in the embodiment, aiming at the situation that the character relation descriptor is possibly hidden, the character relation descriptor existing in the context sentence of the sentence where the binary group is located can be learned and classified by using the multi-classification model, so that the target character relation descriptor corresponding to the binary group is obtained, and the situation that the extraction of the ternary group or the extraction error cannot be realized when the character relation descriptor is hidden in the interactive sentence where the binary group is located is avoided, thereby improving the extraction accuracy of the ternary group.
Based on the above implementation, the apparatus in this embodiment may further include the following units, as shown in fig. 5:
a portrait obtaining unit 405, configured to aggregate the triples according to the target person relationship descriptors therein, so that triples having the same target person relationship descriptor are in the same triplet set; the triplet also has a confidence value corresponding to the target character relation descriptor; adding the confidence values corresponding to the triples in the triplet set to obtain the scores corresponding to the target character relation descriptors; and obtaining a target triplet set corresponding to the score meeting the threshold condition, wherein the target triplet set represents user portrait information of the user corresponding to the target person relationship descriptor.
It should be noted that, the specific implementation of each unit in this embodiment may refer to the corresponding content in the foregoing, which is not described in detail herein.
Referring to fig. 6, a schematic structural diagram of an electronic device according to a third embodiment of the present application may be a device such as a computer or a server capable of performing data processing. The technical scheme in the embodiment is mainly used for extracting triples in sentences, such as entity words, trigger words and character relation descriptors, and improves extraction accuracy.
Specifically, the electrons in the present embodiment may include the following structures:
a memory 601 for storing an application program and data generated by the running of the application program;
a processor 602, configured to execute the application program to implement: obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining a binary group in the interactive sentence, wherein the binary group comprises an entity word and a trigger word; obtaining at least one character relation descriptor corresponding to a context sentence of the interactive sentence where the binary group is located; inputting at least the two groups and at least one character relation descriptor corresponding to the two groups into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the two groups output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relation description words corresponding to the two-tuple form a three-tuple of the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with the binary group labels, the first sentence samples are at least provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, and P is the number of the character relation descriptor types.
According to the technical scheme, in the electronic device provided by the third embodiment of the application, after the interactive text containing a plurality of interactive sentences is obtained, the tuples in the interactive sentences are obtained first, such as solid words and trigger words, then character relation descriptors in the context sentences of the interactive sentences in which the tuples are located are counted, then the character relation descriptors and the tuples can be used as inputs of a pre-trained multi-classification model, and further a target character relation descriptor corresponding to the tuples output by the multi-classification model is obtained, and the target character relation descriptors at the moment can form triples of the interactive sentences together with entity words and trigger words in the tuples, so that triples are extracted, and the multi-classification model is obtained through training sentence samples with character relation descriptor tags in the context sentences. Therefore, in the embodiment, aiming at the situation that the character relation descriptors are hidden, the character relation descriptors existing in the context sentence of the sentence where the binary group is located are classified by using the multi-classification model, so that the target character relation descriptors corresponding to the binary group are obtained, and the situation that the extraction of the ternary group or the extraction error cannot be realized due to the fact that the character relation descriptors are hidden in the interactive sentence where the binary group is located is avoided, and the extraction accuracy of the ternary group is improved.
It should be noted that, the specific implementation of the processor in this embodiment may refer to the corresponding content in the foregoing, which is not described in detail herein.
Taking the technical scheme in the application as an example applied to the insurance field, the application exemplifies triage of interactive sentences generated by insurance consultants and clients about pre-sale and after-sale consultants:
first, communication record data (interactive data of voice or text) between a consultant and a customer is preprocessed to obtain communication record text (interactive text) with characters (character relations).
And then, carrying out joint extraction of information trigger words, entities and entity categories of sentence granularity on the interactive sentences in the interactive text based on a bidirectional LSTM+CRF sequence labeling model of a self-attention mechanism to obtain a binary group collection result (at least comprising the trigger words and the entity words).
And acquiring relevant characteristics of each binary group in the context, such as a plurality of character relation descriptors and the like, inputting the relevant characteristics into a multi-classification model to predict corresponding reference relations (character relation descriptors) of the binary groups, and perfecting the binary groups into the ternary groups containing character information.
Finally, aiming at the interactive text corresponding to the one-way communication record, the extraction result of sentence-level user information is fused, and a call junction of the communication text is generated, namely, corresponding triples with the same reference relationship in the communication text are aggregated together to be used as the call junction.
And the triples are connected in series according to the communication records of the consultant and the customer from the beginning of establishing contact, and the communication records after being connected in series are comprehensively inferred to obtain the final user portrait information.
It can be seen that, in this application, when the customized information is extracted from the communication record between the consultant and the client: firstly, carrying out full automatic generation of call knots on all communication records of a consultant and a client based on joint labeling and cross-context indication technology; secondly, the communication record time axis is connected in series, comprehensive reasoning is carried out according to the call nub set, and the accuracy of user portrait extraction is improved.
Therefore, through the scheme provided by the application, the automatic full coverage of the call summary of the communication records between the consultant and the client can be realized, and the manpower and time cost of the consultant are saved. Meanwhile, according to the scheme, the call summary format standard is unified, accurate user figures of clients can be comprehensively obtained through comprehensive inference according to a time axis, and assistance and guidance are provided for a company to master client profiles in the marketing process.
As shown in the flowchart shown in fig. 7, when the communication record between the consultant and the client is processed in the present application, the following procedure may be specifically included:
1. And preprocessing data to obtain the communication record text with the role.
In this application, the communication record text of the consultant and the customer may be obtained from the database (if the communication record is a telephone record, the audio data of the telephone is required to be first identified to transfer the voice into the text), if the role of the communication record text in the database is unknown, the role identification is required according to the consultant's start term. Based on the above, a text form communication record text with character information can be obtained. For convenience, the communication record text referred to below refers to the communication record text in text form with character information attached.
2. Information trigger words, entity words and entity categories in sentences in the text are extracted.
In order to automatically generate practical and detailed call summary and business side to formulate user basic information to be extracted, such as information of who consults, sex, age, occupation, health condition, social security condition, family condition, income condition, budget and the like of a protected person, the extraction of user information basic elements is converted into a sequence labeling problem. For example, a sequence labeling model is built in advance, and then three important information of entity identification, entity category and trigger word extraction in sentence samples are labeled in a combined mode, and the three information is extracted only by training the sequence labeling model. Specific examples of information trigger words, entity words, and entity categories are shown in table 1 below.
Table 1 trigger words, entity categories
Information trigger word | Entity | Entity class |
For whom to consult | Girl's child | Relationship of figures |
Sex (sex) | Female | Sex (sex) |
Birthday | 2018.02.02 | Birthday |
Age of | Age 2 | Age of |
Budget for a vehicle | 2 thousands of | Amount of money |
Health care | Pneumonia of the lung | Disease of the human body |
Address of | North region of Guangxi Liuzhou City willow | Address of |
Specific examples of the information trigger words, entity words, and entity categories in the labels in the sample are shown in table 2 below.
TABLE 2 Label
The "BIESO" in table 2 has the following meanings: b represents the beginning of an entity word, I represents the inside of the entity word, E represents the end of the entity word, S represents a single entity word, and O represents the rest. For example, the labels of "2" and "thousand" indicate that i am B-Money-hedge and E-Money-hedge, respectively, are "2" being the beginning of this entity word, "thousand" being the end of this entity word, "the entity type is the amount, and the trigger word is" Budget ".
Based on the information, the labeled sample data in the format is input into a bidirectional LSTM+CRF sequence labeling model based on a self-attention mechanism to perform joint extraction training of information trigger words, entity words and entity categories. And inputting the text of the communication record to be predicted into a trained sequence labeling model for sequence labeling, thus obtaining a binary group (2-tuple) set result such as (gender, girl), (age, 2 years), (family character relationship, daughter), (disease, pneumonia) and the like.
The information trigger words mainly comprise two types of sources, wherein one type is obtained directly by the consultant or the labeling actively mentioned by the user, and the other type is obtained indirectly according to the entity class labeling.
It should be noted that, unlike the rule dictionary-based method or the method of respectively establishing a plurality of sequence labeling tasks, in the method, three elements of an information trigger word, an entity and an entity category can be identified simultaneously by using one model, so that the accuracy and recall rate effects are better.
3. By cross-context reference, the bigram (information trigger word, entity) is supplemented with a persona relationship subject.
In this application, the information extraction based on the communication record is different from the information extraction of the general chapter. General chapter information extraction can obtain complete triplet information of entities and relations from sentence granularity, such as (china, capital, beijing). However, subject or some reference relationships in the communication record text are generally implicit in the communication record context and sometimes omitted. If consultation for multiple persons is interposed in the middle, the character relation subject is difficult to determine by simple extraction. For example, in the case of "i am not producing children at the time and having jaundice later", the subject in this sentence is "i am" but for (illness, jaundice) the subject should be "child", which is implied, and thus cannot be judged only by sentence level. Based on the above, statistics of cross-context reference relations need to be carried out on the binary groups in the method, accurate role information can be supplemented for the binary groups extracted by the joint labeling, and then a perfect and more valuable information extraction result can be formed.
Specifically, the person referring task can be abstracted into a multi-classification problem in the application. There are 8 commonly used character relationships: principal, wife, husband, son, daughter, father, mother, and others. Firstly, establishing sentence granularity index information for a communication record text, and then carrying out feature supplementation on the binary groups extracted in the step 2 (information trigger words and entity words). Additional features herein may be the following: the gender attribute, age attribute, sex of the consultant, normalized character relation existing in the sentence index, the nearest character reference relation of the binary group, character reference relation within 3 of the upward sentence window of the binary group, character subject related in grammar tree related to the binary group, character relation related before the sentence index, and the like.
For example, if a sentence is the 13 th sentence of the full-pass dialogue, the "character reference relationship within 3 in the window of the binary group upward sentence" is to find the character reference relationship existing in the 10 th sentence, the 11 th sentence and the 12 th sentence, "the person, the wife, the husband, the son, the daughter, the father, the mother and others" see which of the character reference relationships exist in the 13 th sentence upward backtracking window (the 10 th sentence, the 11 th sentence and the 12 th sentence).
For another example, the grammar tree in natural language mainly extracts main guests and fixed-form complements. The character subject related in the syntax tree related to the binary group means: the subject of the current sentence is extracted, for example, the sentence "mother of me taitai has hypertension", namely, mother, and the term "me tai" is the idiom of "mother" and does not belong to the grammar tree extraction character relationship.
For another example, if a sentence is the 13 th sentence of the full-pass dialogue, then the "character relation related before indexing the sentence" is to find the normalized character reference relation appeared from the 1 st sentence to the 13 th sentence.
Based on this, in the present application, the two tuples extracted in step 2 (information trigger words, entities) are marked with roles, and the complementary features corresponding to the two tuples are input into the multi-classification model together, so as to obtain the score of each personal relationship subject corresponding to the two tuples, where the score is the highest, and is considered as the subject (target person relationship descriptor) of the 2 tuples. And finally obtaining the triples (3-tuple) of the character relations, the information trigger words and the entity words.
4. And fusing sentence-level user information extraction results.
And (3) aggregating the triples (character relations, information trigger words and entity words) obtained in the step (3) according to the character relations to obtain character granularity information, so as to generate a communication text call summary, namely a set of triples with the same character relations.
5. And (5) comprehensively reasoning the communication record series connection.
The triples obtained in the step 3 can be connected in series according to a time axis corresponding to the communication record of the consultant and the customer from the beginning of establishing contact, and then the triples are aggregated according to the mode in the step 4. The specific polymerization mode is as follows: and aggregating the four-tuple (character relation, information trigger word, entity and character relation predictive value) according to the character relation, summing the character relation predictive values of the four-tuple in the aggregated triple set, and finally taking the triple set with the four-tuple value larger than a certain threshold value as the user portrait information of the user corresponding to the character relation.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (4)
1. A method of text processing, the method comprising:
obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences;
obtaining the binary group in the interactive sentence, which comprises the following steps: inputting the interactive sentences into a pre-trained sequence annotation model to obtain a binary group output by the sequence annotation model; the sequence labeling model is obtained by training at least two second sentence samples with entity word labels and trigger word labels, and the two tuples comprise entity words and trigger words;
Obtaining at least one character relation descriptor corresponding to a context sentence of the interactive sentence where the binary group is located;
inputting at least the two groups and at least one character relation descriptor corresponding to the two groups into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the two groups output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relationship description words corresponding to the two-tuple form a three-tuple corresponding to the interactive sentence; the multi-classification model is obtained by training at least P first sentence samples with binary group labels, the first sentence samples are provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, P is the number of the kinds of the character relation descriptors, and the ternary groups are provided with confidence values corresponding to the target character relation descriptors;
arranging the triples according to the respective corresponding time attributes to connect the triples in series according to the time sequence, and then, aggregating the triples according to the target person relationship descriptors therein to enable the triples with the same target person relationship descriptors to be in the same triplet set;
Or, aggregating the triples according to the target person relationship descriptors therein so that the triples with the same target person relationship descriptors are in the same triplet set, and arranging the triples in the triplet set according to the time attribute corresponding to the triples;
adding the confidence values corresponding to the triples in the triplet set to obtain the scores corresponding to the target character relation descriptors; obtaining a target triplet set corresponding to the score meeting a threshold condition, wherein the target triplet set characterizes user image information of a user corresponding to the target character relation descriptor;
the method further comprises the steps of: obtaining attribute characteristics of entity words in the binary groups and character subject descriptors of the binary groups in a grammar tree; the method for obtaining the target character relation descriptor corresponding to the binary group output by the multi-classification model comprises the following steps of: and inputting the binary group and at least one character relation descriptor corresponding to the binary group, the attribute feature and the character subject descriptor into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model, wherein the target character relation descriptor comprises a character relation subject.
2. The method according to claim 1, wherein the obtaining of the corresponding at least one character relation descriptor in the context sentence of the interactive sentence in which the two-tuple is located is achieved by any one or more of the following ways:
obtaining at least one character relation descriptor in sentence indexes corresponding to the binary groups in the interactive text;
at least one character relation descriptor closest to the binary group is obtained in the interactive text;
at least one character relation description word is obtained in the interactive sentences adjacent to the interactive sentences before and after the interactive sentences where the binary groups are located in the interactive text;
and obtaining at least one character relation descriptor in the interactive sentence before the interactive sentence where the binary group is located in the interactive text.
3. A text processing apparatus, the apparatus comprising:
a text obtaining unit, configured to obtain an interactive text, where the interactive text includes a plurality of interactive sentences;
the binary group obtaining unit is used for obtaining a binary group in the interactive sentence, wherein the binary group comprises an entity word and a trigger word; the binary group obtaining unit is specifically used for inputting the interactive sentence into a pre-trained sequence labeling model so as to obtain a binary group output by the sequence labeling model; the sequence labeling model is obtained by training at least two second sentence samples with entity word labels and trigger word labels;
The character relation obtaining unit is used for obtaining at least one corresponding character relation description word in the context sentence of the interactive sentence where the binary group is located;
the target relation obtaining unit is used for inputting at least the binary group and at least one character relation descriptor corresponding to the binary group into a pre-trained multi-classification model so as to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relationship description words corresponding to the two-tuple form a three-tuple corresponding to the interactive sentence; the multi-classification model is obtained by training at least P first sentence samples with binary group labels, the first sentence samples are at least provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, and P is the number of the character relation descriptor types;
the image acquisition unit is used for arranging the triples according to the respective corresponding time attribute so as to connect the triples in series according to the sequence of time, and then, the triples are aggregated according to the target person relationship descriptors therein so that the triples with the same target person relationship descriptors are in the same triplet set;
Or, aggregating the triples according to the target person relationship descriptors therein so that the triples with the same target person relationship descriptors are in the same triplet set, and arranging the triples in the triplet set according to the time attribute corresponding to the triples;
the triplet also has a confidence value corresponding to the target character relation descriptor; the portrait obtaining unit is further used for adding confidence values corresponding to triples in the triples set to obtain scores corresponding to the target character relation descriptors; obtaining a target triplet set corresponding to the score meeting a threshold condition, wherein the target triplet set represents user image information of a user corresponding to the target character relation descriptor;
the text processing device is also used for obtaining attribute characteristics of entity words in the binary groups and character subject descriptors of the binary groups in the grammar tree; the method for obtaining the target character relation descriptor corresponding to the binary group output by the multi-classification model comprises the following steps of: and inputting the binary group and at least one character relation descriptor corresponding to the binary group, the attribute feature and the character subject descriptor into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model, wherein the target character relation descriptor comprises a character relation subject.
4. An electronic device, comprising:
a memory for storing an application program and data generated by the operation of the application program;
a processor for executing the application program to realize: obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining the binary group in the interactive sentence, which comprises the following steps: inputting the interactive sentences into a pre-trained sequence annotation model to obtain a binary group output by the sequence annotation model; the sequence labeling model is obtained by training at least two second sentence samples with entity word labels and trigger word labels, and the two tuples comprise entity words and trigger words; obtaining at least one character relation descriptor corresponding to a context sentence of the interactive sentence where the binary group is located; inputting at least the two groups and at least one character relation descriptor corresponding to the two groups into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the two groups output by the multi-classification model; the entity words and the trigger words in the two-tuple and the target character relation description words corresponding to the two-tuple form a three-tuple of the interactive sentence; the multi-classification model is obtained by training at least P first sentence samples with binary group labels, the first sentence samples are provided with character relation descriptor labels corresponding to the binary group labels in context sentences of the first sentence samples, P is the number of the kinds of the character relation descriptors, and the ternary groups are provided with confidence values corresponding to the target character relation descriptors;
Arranging the triples according to the respective corresponding time attributes to connect the triples in series according to the time sequence, and then, aggregating the triples according to the target person relationship descriptors therein to enable the triples with the same target person relationship descriptors to be in the same triplet set;
or, aggregating the triples according to the target person relationship descriptors therein so that the triples with the same target person relationship descriptors are in the same triplet set, and arranging the triples in the triplet set according to the time attribute corresponding to the triples;
adding the confidence values corresponding to the triples in the triplet set to obtain the scores corresponding to the target character relation descriptors; obtaining a target triplet set corresponding to the score meeting a threshold condition, wherein the target triplet set characterizes user image information of a user corresponding to the target character relation descriptor;
the processor is further configured to implement: obtaining attribute characteristics of entity words in the binary groups and character subject descriptors of the binary groups in a grammar tree; the method for obtaining the target character relation descriptor corresponding to the binary group output by the multi-classification model comprises the following steps of: and inputting the binary group and at least one character relation descriptor corresponding to the binary group, the attribute feature and the character subject descriptor into a pre-trained multi-classification model to obtain a target character relation descriptor corresponding to the binary group output by the multi-classification model, wherein the target character relation descriptor comprises a character relation subject.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010505583.9A CN111651606B (en) | 2020-06-05 | 2020-06-05 | Text processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010505583.9A CN111651606B (en) | 2020-06-05 | 2020-06-05 | Text processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111651606A CN111651606A (en) | 2020-09-11 |
CN111651606B true CN111651606B (en) | 2024-03-01 |
Family
ID=72343393
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010505583.9A Active CN111651606B (en) | 2020-06-05 | 2020-06-05 | Text processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111651606B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112347767B (en) * | 2021-01-07 | 2021-04-06 | 腾讯科技(深圳)有限公司 | Text processing method, device and equipment |
CN114676705B (en) * | 2021-06-17 | 2024-10-15 | 腾讯云计算(北京)有限责任公司 | Dialogue relation processing method, computer and readable storage medium |
CN113505224B (en) * | 2021-07-08 | 2023-01-10 | 万翼科技有限公司 | Structured information extraction and model construction method, device and storage medium |
CN118552202B (en) * | 2024-07-29 | 2024-10-11 | 卓世智星(青田)元宇宙科技有限公司 | Natural language intelligent interaction method for large language model |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111125367A (en) * | 2019-12-26 | 2020-05-08 | 华南理工大学 | Multi-character relation extraction method based on multi-level attention mechanism |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11222052B2 (en) * | 2011-02-22 | 2022-01-11 | Refinitiv Us Organization Llc | Machine learning-based relationship association and related discovery and |
CN109165385B (en) * | 2018-08-29 | 2022-08-09 | 中国人民解放军国防科技大学 | Multi-triple extraction method based on entity relationship joint extraction model |
-
2020
- 2020-06-05 CN CN202010505583.9A patent/CN111651606B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111125367A (en) * | 2019-12-26 | 2020-05-08 | 华南理工大学 | Multi-character relation extraction method based on multi-level attention mechanism |
Non-Patent Citations (1)
Title |
---|
基于句法语义特征的实体关系抽取技术;姚春华 等;通信技术;第第51卷卷(第第8期期);第1828-1835页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111651606A (en) | 2020-09-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111651606B (en) | Text processing method and device and electronic equipment | |
CN109933664B (en) | Fine-grained emotion analysis improvement method based on emotion word embedding | |
CN111325029B (en) | Text similarity calculation method based on deep learning integrated model | |
CN109508459B (en) | Method for extracting theme and key information from news | |
CN113505586A (en) | Seat-assisted question-answering method and system integrating semantic classification and knowledge graph | |
CN109726745B (en) | Target-based emotion classification method integrating description knowledge | |
CN111368075A (en) | Article quality prediction method and device, electronic equipment and storage medium | |
CN111858940A (en) | Multi-head attention-based legal case similarity calculation method and system | |
CN110287314B (en) | Long text reliability assessment method and system based on unsupervised clustering | |
CN113569023A (en) | Chinese medicine question-answering system and method based on knowledge graph | |
CN112861541A (en) | Commodity comment sentiment analysis method based on multi-feature fusion | |
CN113360582B (en) | Relation classification method and system based on BERT model fusion multi-entity information | |
TWI734085B (en) | Dialogue system using intention detection ensemble learning and method thereof | |
CN110222192A (en) | Corpus method for building up and device | |
CN113761377A (en) | Attention mechanism multi-feature fusion-based false information detection method and device, electronic equipment and storage medium | |
CN114936277A (en) | Similarity problem matching method and user similarity problem matching system | |
CN116361472A (en) | Public opinion big data analysis system for social network comment hot events | |
CN115392254A (en) | Interpretable cognitive prediction and discrimination method and system based on target task | |
Ruposh et al. | A computational approach of recognizing emotion from Bengali texts | |
WO2022061877A1 (en) | Event extraction and extraction model training method, apparatus and device, and medium | |
WO2023207566A1 (en) | Voice room quality assessment method, apparatus, and device, medium, and product | |
CN116503127A (en) | Model training method, retrieval method and related device | |
CN111813927A (en) | Sentence similarity calculation method based on topic model and LSTM | |
CN111191455A (en) | Legal provision prediction method in traffic accident damage compensation | |
CN114036289A (en) | Intention identification method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |