CN111651606A - Text processing method and device and electronic equipment - Google Patents

Text processing method and device and electronic equipment Download PDF

Info

Publication number
CN111651606A
CN111651606A CN202010505583.9A CN202010505583A CN111651606A CN 111651606 A CN111651606 A CN 111651606A CN 202010505583 A CN202010505583 A CN 202010505583A CN 111651606 A CN111651606 A CN 111651606A
Authority
CN
China
Prior art keywords
interactive
sentence
descriptor
character relation
binary
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.)
Granted
Application number
CN202010505583.9A
Other languages
Chinese (zh)
Other versions
CN111651606B (en
Inventor
李思雯
陈健
崔文强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huize Times Technology Co ltd
Original Assignee
Shenzhen Huize Times Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Huize Times Technology Co ltd filed Critical Shenzhen Huize Times Technology Co ltd
Priority to CN202010505583.9A priority Critical patent/CN111651606B/en
Publication of CN111651606A publication Critical patent/CN111651606A/en
Application granted granted Critical
Publication of CN111651606B publication Critical patent/CN111651606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/355Class or cluster creation or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/117Tagging; Marking up; Designating a block; Setting of attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Commerce
    • G06Q30/01Customer relationship services
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (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 entity words and trigger words in the interactive sentences; obtaining at least one corresponding character relation descriptor in a context sentence of an interactive sentence where the binary group is located; inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form triples corresponding to the interactive sentences; the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.

Description

Text processing method and device and electronic equipment
Technical Field
The present application relates to the field of text processing technologies, and in particular, to a text processing method and apparatus, and an electronic device.
Background
In a customer service system or other interactive system, a communication record, such as voice or text, between users is usually recorded. In order to facilitate data management, it is generally necessary to process the content of the communication record, thereby obtaining a summarized content.
At present, a combined extraction model of an entity and a relationship is usually adopted to perform triple extraction on the content of a communication record, so as to obtain a triple composed of the entity, a trigger word and a role, and the summary content of the communication record is represented by the triple. The joint extraction model in such schemes is usually constructed and trained based on sequence labeling algorithms, in which sentences with artificially labeled entities, roles, and trigger words are relied upon. For example, for general discourse information, a combined extraction model can be used to perform a triple extraction on a sentence, so that complete triple information of entities and relationships can be obtained, for example (china, capital, beijing).
However, in the interactive sentences of the communication records, a character reference relationship may be implied, for example, "i am inexpedient when children are born at that time, and later has jaundice", then the character relationship corresponding to the entity word and the trigger word (disease, jaundice) may be identified as "i", but actually is "children", so that the current extraction model has a condition of extraction error when performing triple extraction on the interactive sentences of the communication contents, so that the accuracy is low.
Disclosure of Invention
In view of the above, the present application provides a text processing method, a text processing apparatus, and an electronic device, and the text processing method includes:
a method of text processing, the method comprising:
obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences;
obtaining a binary group in the interactive statement, wherein the binary group comprises an entity word and a trigger word;
obtaining at least one corresponding character relation descriptor in a context sentence of the interactive sentence where the binary group is located;
inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple group corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
The above method, preferably, obtaining the binary group in the interactive statement includes:
inputting the interactive sentences into a pre-trained sequence labeling model to obtain the binary group output by the sequence labeling model;
the sequence labeling model is obtained by training at least two second statement samples with entity word labels and trigger word labels.
Preferably, the method obtains at least one character relational descriptor corresponding to a context sentence of the interactive sentence in which the binary group is located, and is implemented by any one or more of the following ways:
obtaining at least one character relation descriptor in a sentence index corresponding to the binary group in the interactive text;
obtaining at least one character relation descriptor which is closest to the binary group interval in the interactive text;
obtaining at least one character relation descriptor in interactive sentences adjacent to the interactive sentences in front of and behind the interactive sentences in which the binary groups are located in the interactive text;
and obtaining at least one character relation descriptor in an interactive sentence before the interactive sentence where the binary group is located in the interactive text.
The above method, preferably, further comprises:
obtaining attribute characteristics of entity words in the binary group and character subject descriptors of the binary group in a syntax tree;
inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model, wherein the method comprises the following steps:
and inputting the two-tuple and at least one character relation descriptor corresponding to the two-tuple, the attribute characteristics and the task subject descriptor into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model.
The above method, preferably, further comprises:
and aggregating the triples according to the target person relationship descriptors in the triples, so that the triples with the same target person relationship descriptors are in the same triple set.
In the above method, preferably, the triplet further has a confidence value corresponding to the target person relationship descriptor;
wherein the method further comprises:
summing the confidence values corresponding to the triples in the triple set to obtain a score corresponding to the target person relationship descriptor;
and obtaining a target triple set corresponding to the score meeting a threshold condition, wherein the target triple set represents user portrait information of a user corresponding to the target character relation descriptor.
The above method, preferably, further comprises:
and arranging the triples in the triple set according to the time attributes corresponding to the triples.
A text processing apparatus, the apparatus comprising:
the text obtaining unit is used for obtaining an interactive text, and the interactive text comprises a plurality of interactive sentences;
the binary group obtaining unit is used for obtaining a binary group in the interactive statement, and the binary group comprises an entity word and a trigger word;
a character relation obtaining unit, configured to obtain at least one character relation descriptor corresponding to a context sentence of the interactive sentence where the binary group is located;
a target relation obtaining unit, configured to input at least the two-tuple and at least one corresponding person relation descriptor thereof into a multi-classification model trained in advance, so as to obtain a target person relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple group corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
The above apparatus, preferably, further comprises:
the portrait obtaining unit is used for aggregating the triples according to the target person relationship descriptors in the triples, so that the triples with the same target person relationship descriptors are in the same triple set; wherein, the triple also has a confidence value corresponding to the target person relationship descriptor; summing the confidence values corresponding to the triples in the triple set to obtain a score corresponding to the target person relationship descriptor; and obtaining a target triple set corresponding to the score meeting a threshold condition, wherein the target triple set represents user portrait information of a user corresponding to the target character relation descriptor.
An electronic device, comprising:
a memory for storing an application program and data generated by the application program running;
a processor for executing the application to implement: obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining a binary group in the interactive statement, wherein the binary group comprises an entity word and a trigger word; obtaining at least one corresponding character relation descriptor in a context sentence of the interactive sentence where the binary group is located; inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple of the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
From the above technical solutions, in the text processing method, the text processing device and the electronic device disclosed in the present application, after obtaining an interactive text comprising a plurality of interactive sentences, first the bigrams in the interactive sentences, such as solid words and trigger words, then, the character relation descriptors in the context sentence of the interactive sentence where the binary group is located are counted, and then the character relation descriptors and the binary group can be used as the input of a multi-classification model trained in advance, further obtain a target character relationship descriptor corresponding to the binary group output by the multi-classification model, the target character relationship descriptor at this time can form a triple of the interactive sentence together with the entity word and the trigger word in the binary group, thereby realizing triple extraction, the multi-classification model is obtained by training a sentence sample with a binary label and a character relation descriptor label in a context sentence. Therefore, in the case that the person relationship descriptors are hidden, the person relationship descriptors existing in the context sentence of the sentence where the binary group is located are learned and classified by using the multi-classification model, and the target person relationship descriptors corresponding to the binary group are obtained, so that the situation that the triple extraction cannot be realized or the triple extraction is wrong when the person relationship descriptors are hidden in the interactive sentence where the binary group is located is avoided, and the triple extraction accuracy is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart of a text processing method according to an embodiment of the present application;
fig. 2 and fig. 3 are another flow charts of a text processing method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a text processing apparatus according to a second embodiment of the present application;
fig. 5 is another schematic structural diagram of a text processing apparatus 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 a process of extracting triples from a communication text in the insurance field according to an embodiment of the present application.
Detailed Description
Taking the application of the technical solution in the present application in the insurance field as an example, the triple extraction of the interactive statements generated by the insurance advisor and the client about the pre-sale and post-sale consultation is exemplified in the present application:
firstly, the consultant and the client establish contact in an online mode, then learn more personal information and family information of the client through deep communication, then carry out personalized family insurance buying scheme design for the client, and finally the client selects a product meeting the mind for insurance application.
The communication between the counselor and the client is recorded in many ways, such as telephone communication, on-line consultation, etc. While the visit may remain in intermittent contact with the customer for perhaps one to two weeks. To facilitate follow-up of the client, the consultant will typically make a communication summary after the communication is completed. However, the recording habit of the consultant is different from person to person, and the recording is inconvenient in time and place, so that the manual call summary mode has great limitation. Therefore, the purely manual communication record totaling mode is time-consuming and labor-consuming, has no uniform standardized format, is not easy to have complete overall cognition on customers, and is also not convenient for companies to master the customer profile in the marketing process.
Based on this, the inventor of the present application finds, through research, that the communication summary, the expression form and the writing format recorded by the consultant manually are relatively random, the recording quality is not high, and some communication contents are not summarized. In addition, some consultants have the disadvantages of time consumption, labor consumption, low efficiency and easy omission of recording. Because the consultant has different recording habits and individual thinking modes, the call summary has no uniform standardized format, so that the company is not easy to master the client profile in the marketing process. Therefore, at present, a triple extraction model can be adopted to extract a triple composed of an entity word, a trigger word and a character relation descriptor from the text content recorded by the advisor, and the triple is used as the communication summary content to represent the user portrait of the user corresponding to the character relation descriptor.
However, in the conventional triple extraction model, direct extraction of triples can be realized for articles or paragraphs and the like in which a person relationship descriptor is explicitly expressed in text contents, but in the case where a person relationship is implicit in a text or is not expressed, the conventional triple extraction model cannot extract a case where a person relationship descriptor or a gray object has an extraction error.
Through further research, the inventor of the application provides a triple obtaining scheme based on joint labeling and cross-context. In this scenario, a call summary may first be generated based on federated callout and cross-context referral by an automated, structured analysis of the user's personal and family information in the consultant's and client's communication records. Certainly, the communication knots can be further connected in series according to the communication record time axis, and comprehensive reasoning is carried out to form a more perfect user portrait of the user.
Specifically, the text processing method in the technical solution of the present application may include the following processing procedures:
firstly, obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining a binary group in the interactive statement, wherein the binary group comprises an entity word and a trigger word; then, at least one corresponding character relation descriptor in the context sentence of the interactive sentence where the binary group is located is obtained; then at least inputting the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple group corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
Therefore, in the case that the person relationship descriptors are hidden, the person relationship descriptors existing in the context sentence of the sentence where the binary group is located are learned and classified by using the multi-classification model, and the target person relationship descriptors corresponding to the binary group are obtained, so that the situation that the triple extraction cannot be realized or the triple extraction is wrong when the person relationship descriptors are hidden in the interactive sentence where the binary group is located is avoided, and the triple extraction accuracy is improved.
In summary, for the communication records between the consultant and the client in the insurance field, in the technical scheme of the application, on one hand, the automatic generation of the full-volume call summary can be realized for all the communication records based on the joint labeling and the cross-context reference, and on the other hand, the communication records are connected in series by the time axis, and the comprehensive reasoning is performed according to the call summary set, so that the accuracy of user portrait extraction is improved.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a flowchart of an implementation of a text processing method provided in an embodiment of the present application is shown, where the method may be applied 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 the triples in the sentence, such as the solid words, the trigger words and the character relation descriptors, and improving the extraction accuracy.
Specifically, the method in this embodiment may include the following steps:
step 101: and obtaining the interactive text.
Wherein, a plurality of interactive sentences can be contained in the interactive text. The interactive sentences in the interactive text may be sentences obtained by recognizing handwritten contents manually recorded by one or more users in the speech interaction process between the users through texts, or the interactive sentences may be sentences recognized by processing audio contents recorded in the speech interaction process between the users through audio, or the interactive sentences may be sentences obtained by processing electronic contents manually recorded by one or more users in the speech interaction process between the users, and so on.
Taking an interactive scenario for pre-sale consultation in the insurance field as an example, the interactive text obtained in the embodiment includes: "you are good, what can help you", "you are good, i want to ask about what the children's insurance is", "good", please provide the current physical condition of the child from birth "," the child is 2 years old "," how well the body "," I is difficult to produce when the child is born at that time, and then jaundice "etc.
Step 102: a duplet in the interactive statement is obtained.
The binary group comprises entity words and trigger words in the sentence.
Specifically, in this embodiment, a binary group extraction may be performed on each interactive statement in the interactive text by using an extraction algorithm or a model, so as to obtain a binary group formed by the entity word and the trigger word in the interactive statement. 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 "girl", or obtain a binary group consisting of "age" and "2 years old", and so on.
It should be noted that, in this embodiment, it is not limited that each sentence in the interactive text can extract the binary group, and only part of the interactive sentences may obtain the binary group. In this embodiment, it is not limited that only one tuple can be extracted from one interactive statement, 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 in which the binary group is located.
The context statement of the interactive statement in which the binary group is located may be understood as one or more interactive statements that are adjacent to the interactive statement in which the binary group is located, in all interactive statements of the interactive text. Taking the two-tuple "age" and "2 years" as an example, the interactive sentence is: "child is 2 years old", the context sentence of the interactive sentence includes 1 to M interactive sentences above, or the context sentence of the interactive sentence includes 1 to N interactive sentences below, or the context sentence of the interactive sentence includes 1 to M interactive sentences above and 1 to N interactive sentences 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 a context sentence of an interactive sentence in which the binary group is located, so as to recognize one or more corresponding person relationship descriptors in the context sentence of the interactive sentence in which the binary group is located, for example, in the context sentence of the interactive sentence in which the binary group is "aged" and "2 years", person relationship descriptors such as "child" and "me" are recognized.
Step 104: at least inputting the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model.
Based on the fact, the entity words in the binary group and the target character relation descriptor corresponding to the trigger word and the binary group form a triple 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 binary labels, the first sentence sample as the training sample of the multi-classification model at least has a character relation descriptor label corresponding to the binary label in the context sentence of the first sentence sample, and P is the number of types of character relation descriptors needing to be classified in the multi-classification model, such as 8 types of character relation descriptors of oneself, wife, husband, son, daughter, father, mother and others. That is to say, the sentence sample in the training sample of the multi-classification model not only has the binary label, but also has the character relation descriptor label, and the character relation descriptor label may be specifically one character relation descriptor that is manually selected and labeled as in the 8 character relation descriptors in the foregoing text and the at least one character relation descriptor corresponding to the context sentence of the sentence sample in which the binary label is located.
Specifically, the multi-classification model may be constructed based on various machine learning algorithms such as a neural network, and the multi-classification model includes multiple model parameters, and the multi-classification model can learn or train input data based on the model parameters, so as to output a corresponding output result.
Based on the above, the training process of the initially constructed multi-classification model is as follows:
selecting a current first sentence sample, and at least counting at least one character relational descriptor corresponding to the binary label in the current first sentence sample in the context sentence of the current first sentence sample, for example, the binary label in the current first sentence sample may have 5 character relational descriptors of oneself, wife, husband, son and daughter in the context sentence, and in addition, the attribute characteristics of the entity word in the binary label and the character subject descriptor of the binary label in the syntax tree, etc. can be obtained, and the characteristic data of the character relational descriptor, the attribute characteristics of the entity word, the character subject descriptor, etc. can be used as the input data of the multi-classification model together with the binary label, thereby enriching the types of the input data of the multi-classification model;
then, the binary labels and the character relation descriptors corresponding to the binary labels and other additionally obtained characteristic data are used as input of the multi-classification model, and then an output result of the multi-classification model is obtained, wherein the output result comprises the character relation descriptors corresponding to the binary labels;
comparing the character relationship descriptor in the output result with the character relationship descriptor tag corresponding to the binary group tag to obtain a comparison result, wherein the comparison result represents the similarity between the character relationship descriptor in the output result and the character relationship descriptor tag corresponding to the binary group tag, for example, the comparison result, namely the value of a loss function, is obtained by using the loss function of the multi-classification model;
adjusting model parameters in the multi-classification model according to the comparison result, for example, adjusting neuron parameters of a neural network in the multi-classification model when the difference between the person relationship descriptor in the comparison result representation output result and the person relationship descriptor tag corresponding to the binary group tag is large;
and then, reselecting a new first statement sample as the current first statement sample, and returning to the execution step: and counting at least one character relationship 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 finally obtained comparison result represents that the similarity between the character relationship descriptor in the output result and the character relationship descriptor label corresponding to the binary group label meets the training condition, such as the value of the loss function tends to be unchanged or minimum, and the like, and finishing the training of the multi-classification model at the moment.
In a specific implementation, at least one person relationship descriptor corresponding to a binary label in a current first sentence sample in a context sentence of the current first sentence sample may include any one or more of the following:
at least one character relation descriptor in a sentence index corresponding to the context sentence corresponding to the sentence sample where the binary label is located;
at least one figure relation descriptor which is closest to the interval of the binary labels in the context sentences corresponding to the sentence samples of the binary labels, such as the figure relation descriptors which are closest to the binary labels in the preceding and following sentences;
at least one character relationship descriptor in the context sentence corresponding to the sentence sample in which the binary label is located and in the sentence samples adjacent to the sentence sample in which the binary label is located, such as character relationship descriptors contained in 3 preceding and/or 3 following adjacent sentence samples;
at least one of the character relation descriptors in the sentence sample before the sentence sample in which the binary tag in the context sentence corresponds to the sentence sample in which the binary tag is located, for example, the character relation descriptors contained in the previous 4 adjacent sentence samples, and the like.
Based on this, the trained multi-classification model can at least analyze and learn the two-tuple in the interactive sentence and one or more character relation descriptors corresponding to the two-tuple, and further extract the target character relation descriptor corresponding to the two-tuple in the interactive sentence, so that the target character relation descriptor and the entity words and the trigger words in the two-tuple form a triple.
As can be seen from the foregoing technical solutions, in a text processing method according to an embodiment of the present application, after an interactive text including a plurality of interactive sentences is obtained, first, a binary group in the interactive sentences, such as solid words and trigger words, is obtained, then, the character relation descriptors in the context sentence of the interactive sentence where the binary group is located are counted, and then the character relation descriptors and the binary group can be used as the input of a multi-classification model trained in advance, further obtain a target character relationship descriptor corresponding to the binary group output by the multi-classification model, the target character relationship descriptor at this time can form a triple of the interactive sentence together with the entity word and the trigger word in the binary group, thereby realizing triple extraction, the multi-classification model is obtained by training a sentence sample with a binary label and a character relation descriptor label in a context sentence. Therefore, in the embodiment, in the case that the person relationship descriptors may be hidden, the multi-classification model can be used to learn and classify the person relationship descriptors existing in the context sentence of the sentence where the binary group is located, so as to obtain the target person relationship descriptors corresponding to the binary group, thereby avoiding the situation that the triple extraction cannot be realized or the triple extraction is wrong when the person relationship descriptors are hidden in the interactive sentence where the binary group is located, and thus improving the accuracy of the triple extraction.
In one implementation, the step 102, when obtaining the duplet in the interactive statement, may be implemented by:
and inputting the interactive sentences into a pre-trained sequence labeling model to obtain the binary group output by the sequence labeling model.
The sequence labeling model may be a model obtained by training at least two second sentence samples having an entity word label and a trigger word label. The entity word label and the trigger word label form a corresponding binary group label. 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 pre-selected and the multiple classification models may be trained by using a plurality of first sentence samples therein, and another second sentence sample may be pre-selected and the sequence annotation model 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, a plurality of first sentence samples in the first sentence sample set are used as second sentence samples, the sequence annotation model is trained, and then the multi-classification model is trained by using the first sentence samples with the binary labels in combination with the character relation descriptor labels (including the character relation descriptors in the context sentence of the sentence in which the binary label is located) in the context sentence of the sentence in which the binary label is located.
Specifically, the sequence labeling model in this embodiment may be a bidirectional LSTM + CRF sequence labeling model based on a self-attention mechanism, and is trained by using a sentence sample having an entity word label and a trigger word label (which may also have an entity relationship label, of course), until a value of a loss function of the sequence labeling model tends to be minimum or unchanged, thereby completing model training.
It should be noted that, in the sequence labeling model in this embodiment, entity categories corresponding to entity words in the binary group, such as entity categories of age or gender, may also be extracted.
In an implementation manner, when at least one corresponding person relationship descriptor in a context sentence of an interactive sentence where the binary group is located is obtained, step 103 is implemented in any one or any multiple of the following manners:
obtaining at least one character relation descriptor in a sentence index corresponding to the binary group in the interactive text;
obtaining at least one character relation descriptor which is closest to the binary group interval in the interactive text;
obtaining at least one character relation descriptor in interactive sentences adjacent to the interactive sentences in front of and behind the interactive sentences in which the binary groups are located in the interactive text;
and obtaining at least one character relation descriptor in an interactive sentence before the interactive sentence where the binary group is located in the interactive text.
The character relation descriptors and the binary group are enriched into the input data of the multi-classification model, so that the multi-classification model can output the confidence degree of the character relation descriptors corresponding to the binary group, which are accurate, for learning and classifying the binary group and the character relation descriptors, and can obtain the target character relation descriptors with the highest confidence degree.
Furthermore, in this embodiment, the input data of the multi-classification model may be further enriched, for example, the attribute features of the entity words in the binary group and the person subject descriptors of the binary group in the syntax tree are obtained, and these attribute features and person subject descriptors are input into the multi-classification model together with the binary group and the corresponding at least one person relationship descriptor, so as to obtain the target person relationship descriptors corresponding to the binary group output by the multi-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: and aggregating the triples according to the target person relationship descriptors in the triples, so that the triples with the same target person relationship descriptors are in the same triple set.
For example, triplets with the same target person relationship descriptor, such as "child" or "mom," are grouped together so that the triplets with the same target person relationship descriptor are in the same set of triplets. Taking an interaction scene between an advisor and a client in the insurance field as an example, in this embodiment, after the triples having the same target person relationship descriptors in the interaction text are aggregated into a triple set, information of the character granularity can be obtained, that is, the triple set aggregated by the person relationship descriptors is used to generate a summary of the communication text, where the summary is composed of the triple sets corresponding to each target person relationship descriptor.
It should be noted that, before the triples are aggregated, in this embodiment, the triples may be arranged according to the respective corresponding time attributes, and then the triples are connected in series according to the 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 triple set, and correspondingly, the triples in the triple set are connected in series according to the time sequence;
or after the triples are aggregated in this embodiment, the triples in each triple set are arranged according to the time attribute corresponding to the triples, so that the triples in the triple set are connected in series according to the time sequence.
Based on this, the triple may further have a confidence value corresponding to the target person relationship descriptor, and the confidence value and the entity word, the trigger word and the target person relationship descriptor in the triple form an idea group. Further, after step 105, the following steps may be further included in this embodiment, as shown in fig. 3:
step 106: and summing the confidence values corresponding to the triples in the triple set to obtain a score corresponding to the target person relationship descriptor.
For example, the confidence values corresponding to the triples included in each of the triple sets are summed, so that each triple set has a score corresponding to its corresponding target person relationship descriptor, such as "child" or "mom".
Step 107: and obtaining a target triple set corresponding to the score meeting a threshold condition, wherein the target triple set represents user portrait information of a user corresponding to the target character relation descriptor.
Therefore, in this embodiment, the target triple set corresponding to the score that meets the threshold condition, for example, the score that is greater than or equal to the preset threshold is regarded as the user image information that can accurately represent the user corresponding to the target person relationship descriptor, or the target triple set corresponding to the score that is greater than or equal to the preset threshold is regarded as the summary content with higher reliability of the user image information that represents the user corresponding to the target person relationship descriptor, while the other triple sets with the score that is less than the threshold cannot accurately represent the user image information that represents the user corresponding to the target person relationship descriptor, or the triple set corresponding to the score that is less than the preset threshold is regarded as the credible user image information that represents the user corresponding to the target person relationship descriptor The summary content of the lower degree.
Referring to fig. 4, a schematic structural diagram of a text processing apparatus provided in the second embodiment of the present application is shown, where the text processing apparatus 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 the triples in the sentence, such as the solid words, the trigger words and the character relation descriptors, and improving the 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 statements;
a binary group obtaining unit 402, configured to obtain a binary group in the interactive statement, where the binary group includes an entity word and a trigger word;
a character relation obtaining unit 403, configured to obtain at least one character relation descriptor corresponding to a context sentence of an interactive sentence where the binary group is located;
a target relationship obtaining unit 404, configured to input at least the two-tuple and at least one corresponding person relationship descriptor into a multi-classification model trained in advance, so as to obtain a target person relationship descriptor output by the multi-classification model and corresponding to the two-tuple; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple group corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
As can be seen from the foregoing technical solutions, 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 a binary group in the interactive sentences, such as solid words and trigger words, then, the character relation descriptors in the context sentence of the interactive sentence where the binary group is located are counted, and then the character relation descriptors and the binary group can be used as the input of a multi-classification model trained in advance, further obtain a target character relationship descriptor corresponding to the binary group output by the multi-classification model, the target character relationship descriptor at this time can form a triple of the interactive sentence together with the entity word and the trigger word in the binary group, thereby realizing triple extraction, the multi-classification model is obtained by training a sentence sample with a binary label and a character relation descriptor label in a context sentence. Therefore, in the embodiment, in the case that the person relationship descriptors may be hidden, the multi-classification model can be used to learn and classify the person relationship descriptors existing in the context sentence of the sentence where the binary group is located, so as to obtain the target person relationship descriptors corresponding to the binary group, thereby avoiding the situation that the triple extraction cannot be realized or the triple extraction is wrong when the person relationship descriptors are hidden in the interactive sentence where the binary group is located, and thus improving the accuracy of the triple extraction.
Based on the above implementation, the apparatus in this embodiment may further include the following units, as shown in fig. 5:
a sketch obtaining unit 405, configured to aggregate the triples according to the target person relationship descriptors therein, so that the triples having the same target person relationship descriptors are in the same triple set; wherein, the triple also has a confidence value corresponding to the target person relationship descriptor; summing the confidence values corresponding to the triples in the triple set to obtain a score corresponding to the target person relationship descriptor; and obtaining a target triple set corresponding to the score meeting a threshold condition, wherein the target triple set represents user portrait information of a user corresponding to the target character relation descriptor.
It should be noted that, for the specific implementation of each unit in the present embodiment, reference may be made to the corresponding content in the foregoing, and details are not described here.
Referring to fig. 6, a schematic structural diagram of an electronic device according to a third embodiment of the present disclosure is shown, where the electronic device may be a computer or a server capable of performing data processing. The technical scheme in the embodiment is mainly used for extracting the triples in the sentence, such as the solid words, the trigger words and the character relation descriptors, and improving the extraction accuracy.
Specifically, the electrons in this embodiment may include the following structure:
a memory 601 for storing an application program and data generated by the application program;
a processor 602 configured to execute the application to implement: obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining a binary group in the interactive statement, wherein the binary group comprises an entity word and a trigger word; obtaining at least one corresponding character relation descriptor in a context sentence of the interactive sentence where the binary group is located; inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple of the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
As can be seen from the foregoing technical solutions, in an electronic device provided in the third embodiment of the present application, after an interactive text including a plurality of interactive sentences is obtained, first, a binary group in the interactive sentences, such as an entity word and a trigger word, then, the character relation descriptors in the context sentence of the interactive sentence where the binary group is located are counted, and then the character relation descriptors and the binary group can be used as the input of a multi-classification model trained in advance, further obtain a target character relationship descriptor corresponding to the binary group output by the multi-classification model, the target character relationship descriptor at this time can form a triple of the interactive sentence together with the entity word and the trigger word in the binary group, thereby realizing triple extraction, the multi-classification model is obtained by training a sentence sample with a binary label and a character relation descriptor label in a context sentence. Therefore, in the embodiment, in the case that the person relationship descriptors are hidden, the multi-classification model is used to classify the person relationship descriptors existing in the context sentence of the sentence where the binary group is located, so as to obtain the target person relationship descriptors corresponding to the binary group, thereby avoiding the situation that the person relationship descriptors are hidden in the interactive sentence where the binary group is located, so that the triple extraction cannot be realized or the triple extraction is incorrect, and thus improving the accuracy of the triple extraction.
It should be noted that, the specific implementation of the processor in the present embodiment may refer to the corresponding content in the foregoing, and is not described in detail here.
Taking the application of the technical solution in the present application in the insurance field as an example, the triple extraction of the interactive statements generated by the insurance advisor and the client about the pre-sale and post-sale consultation is exemplified in the present application:
first, communication log data (interactive data of voice or text) between the counselor and the client is preprocessed to obtain communication log text (interactive text) with characters (human relations).
And then, performing joint extraction of sentence-granularity information trigger words, entities and entity categories on interactive sentences in the interactive text based on a bidirectional LSTM + CRF sequence labeling model of a self-attention mechanism to obtain a binary set result (at least comprising the trigger words and the entity words).
And then acquiring relevant characteristics of each binary group in the context, such as multiple person relation descriptors and the like, inputting the characteristics into a multi-classification model to predict a reference relation (person relation descriptor) corresponding to the binary group, and perfecting the binary group into a triple containing role information.
And finally, fusing the extraction results of the sentence-level user information aiming at the interactive texts corresponding to the communication records to generate a communication summary of the communication texts, namely, gathering corresponding triples with the same reference relation in the communication texts as the communication summary.
And, the triplets are connected in series according to the communication records of the consultant and the client from the beginning by the time shaft, and the communication records after the series connection are subjected to comprehensive reasoning to obtain the final user portrait information.
As can be seen, in the present application, when extracting customized information from a communication record between a counselor and a client: firstly, carrying out full automatic generation of a call summary on all communication records of a consultant and a client based on joint annotation and cross-context reference technology; and secondly, connecting the communication record time axes in series, and performing comprehensive reasoning according to the call summary set to improve the accuracy of user portrait extraction.
Therefore, by the scheme provided by the application, the automatic full coverage of the conversation summary of the communication records of the consultant and the client can be realized, and the manpower and time cost of the consultant are saved. Meanwhile, the scheme unifies the format standard of the call summary, and can comprehensively obtain the more accurate user portrait of the client through comprehensive inference according to the time axis, thereby providing help and guidance for a company to master the client profile in the marketing process.
As shown in the flowchart shown in fig. 7, the processing of the communication record between the counselor and the client in the present application may specifically include the following processes:
1. and preprocessing the data to acquire a communication record text with the role.
In the application, a communication record text of the consultant and the client can be obtained from the database (if the communication record is a telephone record, the voice data of the telephone needs to be identified first to convert the voice into the text), and if the role of the communication record text in the database is unknown, the role identification needs to be carried out according to the consultant opening term. Based on the above, a communication record text with the character information in the text form can be obtained. For convenience, the communication record text referred to below refers to a communication record text in text form and accompanied by character information.
2. And extracting information trigger words, entity words and entity categories in sentences in the text.
In order to automatically generate practical and detailed call knots and establish user basic information to be extracted by a service party, such as information such as consultation of people, sex, age, occupation, health condition, social security condition, family condition, income condition, budget and the like, the extraction of the user information basic elements is converted into a sequence labeling problem. For example, a sequence labeling model is constructed in advance, three important information including entity identification, entity category and trigger word in a sentence sample are extracted and jointly labeled, and the information of the three is extracted only by training the sequence labeling model. Specific examples of the information trigger word, the entity word, and the entity category are shown in table 1 below.
TABLE 1 trigger words, entity classes
Information trigger word Entity Entity classes
Consult for who Daughter' s Relationships between people
Sex Woman Sex
Birthday 2018.02.02 Birthday
Age (age) Age 2 Age (age)
Budget 2 thousand Amount of money
Health care Pneumonia of lung Disease and disorder
Address Northland of Guangxi Liuzhou City Address
Specific examples of the information trigger word, the entity word, and the entity category in the tag in the sample are shown in table 2 below.
TABLE 2 tags
Figure BDA0002526413930000201
Figure BDA0002526413930000211
Wherein, the "BIESO" identification meanings in table 2 are respectively: b represents the beginning of the 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 others. For example, labels of "2", and "thousand" are B-Money-Budget and E-Money-Budget, respectively, indicating that "2" is the start of the entity word, "thousand" is the end of the entity word, the entity type is the amount, and the trigger is the "Budget".
Based on the above, the sample data with labels 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 types. And then, inputting the communication record text to be predicted into a trained sequence labeling model for sequence labeling to obtain a binary (2-tuple) set result such as (gender, woman), (age, 2 years), (family character relationship, daughter), (diseases, pneumonia) and the like.
The information trigger words mainly have two types of sources, one is directly obtained by labels asked for questions or actively mentioned by a user, and the other is indirectly obtained by labels according to entity categories.
It should be noted that, different from the task of creating a plurality of sequence labels based on a rule dictionary or respectively, in the present application, a model can be used to identify three elements of an information trigger word, an entity and an entity category simultaneously, and the accuracy and the recall rate are both better.
3. By cross-context referencing, the (information trigger, entity) duplet is supplemented with a persona relationship subject.
In the present application, information extraction based on communication records is different from information extraction of general chapters. General chapter information extraction the triple information of complete entities and relationships can be obtained by extracting the clause granularity, for example (china, capital, beijing). However, the subject or some reference in the communication record text is generally implicit in the communication record context and sometimes often omitted. If the consultation with multiple persons is interjected, the subject of the relationship between persons is difficult to determine by simple extraction. For example, in the case of a customer who is "i am a child who is difficult to make at that time and later has jaundice", the subject in the sentence is "i" but the subject should be "child" for the binary group of (disease, jaundice), and the subject is hidden and thus cannot be judged only by sentence level. Based on this, the binary group needs to be subjected to statistics of cross-context reference relationship in the application, so that accurate role information can be supplemented for the binary group extracted by joint marking, and a perfect and more valuable information extraction result can be formed.
Specifically, the person reference relationship task can be abstracted into a multi-classification problem in the application. There are 8 commonly used relationships of people: i, wife, husband, son, daughter, father, mother, and others. Firstly, sentence granularity index information is established for a communication record text, and then characteristic supplement is carried out on the binary group extracted in the step 2 (information trigger words and entity words). Additional features here may be as follows: the gender attribute, the age attribute, the gender of the consultant of the entity of the duplet in the sentence index of the text, the normalized character relationship existing in the sentence index, the nearest character reference relationship of the duplet, the character reference relationship of the duplet within 3 of the sentence window upwards, the character subject involved in the grammar tree involved in the duplet, the character relationship involved before the sentence index, etc.
For example, if a sentence is the 13 th sentence of the whole conversation, the "person reference relationship within the window of the duplet upward sentence of 3" is to find the person reference relationship existing in the 10 th sentence, the 11 th sentence and the 12 th sentence, and "i am, wife, husband, son, daughter, father, mother and others" see which of these person reference relationships exist in the upward backtracking window of the 13 th sentence (10 th sentence, 11 th sentence and 12 th sentence).
For another example, the syntax tree in natural language mainly extracts the principal and predicate object and the shape-fixed supplementary language. The human subject involved in the syntax tree involved in the binary group refers to: the subject of the current sentence is extracted, for example, the sentence "my too mother has hypertension", the subject is mom (mother), and "my too" is a fixed language of "mom", and does not belong to the relation of the grammatical tree extraction character.
For another example, if a sentence is the 13 th sentence of the whole dialog, the "relationship between persons involved before the sentence index" is the normalized relationship between persons appearing in the 1 st sentence to the 13 th sentence.
Based on this, in the present application, the binary group extracted in step 2 (information trigger, entity) is labeled with a role, and the supplementary features corresponding to the binary group are input to the multi-classification model together, so as to obtain the score of each person relationship subject corresponding to the binary group, wherein the person relationship subject with the highest score is regarded as the subject of the 2-tuple (target person relationship descriptor). And finally obtaining the triple (3-tuple) of the (character relation, information trigger word and entity word).
4. And fusing sentence-level user information extraction results.
And aggregating the triples (the character relationship, the information trigger word and the entity word) obtained in the step 3 according to the character relationship to obtain the information of the character role granularity, so as to generate a communication text call summary, namely a set of triples with the same character relationship.
5. The communication records are connected in series for comprehensive reasoning.
The triples obtained in step 3 may be connected in series according to a time axis corresponding to a communication record from the beginning of establishing contact between the advisor and the client, and then the triples are aggregated according to the method in step 4. The specific polymerization mode is as follows: and aggregating the quadruple (the character relationship, the information trigger word, the entity and the character relationship prediction score) according to the character relationship, summing the character relationship prediction scores of the quadruple in the triple set obtained by aggregation, and finally taking the triple set of which the aggregated quadruple score is greater than a certain threshold value as the user portrait information of the user corresponding to the character relationship.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
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 components and steps have been described above generally in terms of their functionality in order to clearly illustrate this 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 implementation. 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. A software module may reside 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 (10)

1. A method of text processing, the method comprising:
obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences;
obtaining a binary group in the interactive statement, wherein the binary group comprises an entity word and a trigger word;
obtaining at least one corresponding character relation descriptor in a context sentence of the interactive sentence where the binary group is located;
inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple group corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
2. The method of claim 1, wherein obtaining the duplet in the interactive statement comprises:
inputting the interactive sentences into a pre-trained sequence labeling model to obtain the binary group output by the sequence labeling model;
the sequence labeling model is obtained by training at least two second statement samples with entity word labels and trigger word labels.
3. The method according to claim 1, wherein obtaining at least one character relational descriptor corresponding to a context sentence of the interactive sentence in which the binary is located is achieved by any one or more of the following ways:
obtaining at least one character relation descriptor in a sentence index corresponding to the binary group in the interactive text;
obtaining at least one character relation descriptor which is closest to the binary group interval in the interactive text;
obtaining at least one character relation descriptor in interactive sentences adjacent to the interactive sentences in front of and behind the interactive sentences in which the binary groups are located in the interactive text;
and obtaining at least one character relation descriptor in an interactive sentence before the interactive sentence where the binary group is located in the interactive text.
4. The method according to claim 1 or 3, characterized in that the method further comprises:
obtaining attribute characteristics of entity words in the binary group and character subject descriptors of the binary group in a syntax tree;
inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model, wherein the method comprises the following steps:
and inputting the two-tuple and at least one character relation descriptor corresponding to the two-tuple, the attribute characteristics and the task subject descriptor into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model.
5. The method of claim 1, further comprising:
and aggregating the triples according to the target person relationship descriptors in the triples, so that the triples with the same target person relationship descriptors are in the same triple set.
6. The method of claim 5, wherein the triplet further has a confidence value corresponding to the target person relationship descriptor;
wherein the method further comprises:
summing the confidence values corresponding to the triples in the triple set to obtain a score corresponding to the target person relationship descriptor;
and obtaining a target triple set corresponding to the score meeting a threshold condition, wherein the target triple set represents user portrait information of a user corresponding to the target character relation descriptor.
7. The method of claim 5, further comprising:
and arranging the triples in the triple set according to the time attributes corresponding to the triples.
8. A text processing apparatus, characterized in that the apparatus comprises:
the text obtaining unit is used for obtaining an interactive text, and the interactive text comprises a plurality of interactive sentences;
the binary group obtaining unit is used for obtaining a binary group in the interactive statement, and the binary group comprises an entity word and a trigger word;
a character relation obtaining unit, configured to obtain at least one character relation descriptor corresponding to a context sentence of the interactive sentence where the binary group is located;
a target relation obtaining unit, configured to input at least the two-tuple and at least one corresponding person relation descriptor thereof into a multi-classification model trained in advance, so as to obtain a target person relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple group corresponding to the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
9. The apparatus of claim 8, further comprising:
the portrait obtaining unit is used for aggregating the triples according to the target person relationship descriptors in the triples, so that the triples with the same target person relationship descriptors are in the same triple set; wherein, the triple also has a confidence value corresponding to the target person relationship descriptor; summing the confidence values corresponding to the triples in the triple set to obtain a score corresponding to the target person relationship descriptor; and obtaining a target triple set corresponding to the score meeting a threshold condition, wherein the target triple set represents user portrait information of a user corresponding to the target character relation descriptor.
10. An electronic device, comprising:
a memory for storing an application program and data generated by the application program running;
a processor for executing the application to implement: obtaining an interactive text, wherein the interactive text comprises a plurality of interactive sentences; obtaining a binary group in the interactive statement, wherein the binary group comprises an entity word and a trigger word; obtaining at least one corresponding character relation descriptor in a context sentence of the interactive sentence where the binary group is located; inputting at least the two-tuple and at least one character relation descriptor corresponding to the two-tuple into a multi-classification model trained in advance to obtain a target character relation descriptor corresponding to the two-tuple output by the multi-classification model; the entity words and the trigger words in the binary group and the target character relation descriptors corresponding to the binary group form a triple of the interactive sentence;
the multi-classification model is obtained by training at least P first sentence samples with binary labels, the first sentence samples at least also have character relation descriptor labels corresponding to the binary labels in context sentences of the first sentence samples, and P is the number of the types of the character relation descriptors.
CN202010505583.9A 2020-06-05 2020-06-05 Text processing method and device and electronic equipment Active CN111651606B (en)

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 true CN111651606A (en) 2020-09-11
CN111651606B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112347767A (en) * 2021-01-07 2021-02-09 腾讯科技(深圳)有限公司 Text processing method, device and equipment
CN113505224A (en) * 2021-07-08 2021-10-15 万翼科技有限公司 Structured information extraction and model construction method, device and storage medium
WO2022262080A1 (en) * 2021-06-17 2022-12-22 腾讯云计算(北京)有限责任公司 Dialogue relationship processing method, computer and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190354544A1 (en) * 2011-02-22 2019-11-21 Refinitiv Us Organization Llc Machine learning-based relationship association and related discovery and search engines
US20200073933A1 (en) * 2018-08-29 2020-03-05 National University Of Defense Technology Multi-triplet extraction method based on entity-relation joint extraction model
CN111125367A (en) * 2019-12-26 2020-05-08 华南理工大学 Multi-character relation extraction method based on multi-level attention mechanism

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190354544A1 (en) * 2011-02-22 2019-11-21 Refinitiv Us Organization Llc Machine learning-based relationship association and related discovery and search engines
US20200073933A1 (en) * 2018-08-29 2020-03-05 National University Of Defense Technology Multi-triplet extraction method based on entity-relation joint extraction model
CN111125367A (en) * 2019-12-26 2020-05-08 华南理工大学 Multi-character relation extraction method based on multi-level attention mechanism

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
姚春华 等: "基于句法语义特征的实体关系抽取技术", 通信技术, vol. 51, no. 8, pages 1828 - 1835 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112347767A (en) * 2021-01-07 2021-02-09 腾讯科技(深圳)有限公司 Text processing method, device and equipment
WO2022262080A1 (en) * 2021-06-17 2022-12-22 腾讯云计算(北京)有限责任公司 Dialogue relationship processing method, computer and readable storage medium
CN113505224A (en) * 2021-07-08 2021-10-15 万翼科技有限公司 Structured information extraction and model construction method, device and storage medium
CN113505224B (en) * 2021-07-08 2023-01-10 万翼科技有限公司 Structured information extraction and model construction method, device and storage medium

Also Published As

Publication number Publication date
CN111651606B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
CN110096570B (en) Intention identification method and device applied to intelligent customer service robot
CN109783632B (en) Customer service information pushing method and device, computer equipment and storage medium
US11409964B2 (en) Method, apparatus, device and storage medium for evaluating quality of answer
WO2020147395A1 (en) Emotion-based text classification method and device, and computer apparatus
CN113094578B (en) Deep learning-based content recommendation method, device, equipment and storage medium
WO2021051598A1 (en) Text sentiment analysis model training method, apparatus and device, and readable storage medium
CN109726745B (en) Target-based emotion classification method integrating description knowledge
KR20200127020A (en) Computer-readable storage medium storing method, apparatus and instructions for matching semantic text data with tags
US11386354B2 (en) Information processing apparatus, information processing method, and program
WO2018184518A1 (en) Microblog data processing method and device, computer device and storage medium
CN111651606B (en) Text processing method and device and electronic equipment
CN110825867B (en) Similar text recommendation method and device, electronic equipment and storage medium
CN113569023A (en) Chinese medicine question-answering system and method based on knowledge graph
CN109582788A (en) Comment spam training, recognition methods, device, equipment and readable storage medium storing program for executing
CN116361472B (en) Method for analyzing public opinion big data of social network comment hot event
CN113761377A (en) Attention mechanism multi-feature fusion-based false information detection method and device, electronic equipment and storage medium
CN113111152A (en) Depression detection method based on knowledge distillation and emotion integration model
Ruposh et al. A computational approach of recognizing emotion from Bengali texts
Jui et al. A machine learning-based segmentation approach for measuring similarity between sign languages
CN114722810A (en) Real estate customer portrait method and system based on information extraction and multi-attribute decision
CN113782123A (en) Online medical patient satisfaction measuring method based on network data
WO2023207566A1 (en) Voice room quality assessment method, apparatus, and device, medium, and product
CN111460107A (en) Response method and response system
CN114064873A (en) Method and device for building FAQ knowledge base in insurance field and electronic equipment
CN115292492A (en) Method, device and equipment for training intention classification model and storage 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