CN112861509B - Role analysis method and system based on multi-head attention mechanism - Google Patents

Role analysis method and system based on multi-head attention mechanism Download PDF

Info

Publication number
CN112861509B
CN112861509B CN202110180395.8A CN202110180395A CN112861509B CN 112861509 B CN112861509 B CN 112861509B CN 202110180395 A CN202110180395 A CN 202110180395A CN 112861509 B CN112861509 B CN 112861509B
Authority
CN
China
Prior art keywords
vector matrix
layer
text
vector
sentence
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
Application number
CN202110180395.8A
Other languages
Chinese (zh)
Other versions
CN112861509A (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.)
Qingniuzhisheng Technology Co ltd
Original Assignee
Qingniuzhisheng 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 Qingniuzhisheng Technology Co ltd filed Critical Qingniuzhisheng Technology Co ltd
Priority to CN202110180395.8A priority Critical patent/CN112861509B/en
Publication of CN112861509A publication Critical patent/CN112861509A/en
Application granted granted Critical
Publication of CN112861509B publication Critical patent/CN112861509B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/205Parsing
    • G06F40/216Parsing using statistical methods
    • 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
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/22Procedures used during a speech recognition process, e.g. man-machine dialogue
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • 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)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (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)
  • Probability & Statistics with Applications (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to a role analysis method and a role analysis system based on a multi-head attention mechanism, wherein the method comprises the steps of converting a first dialogue record into a first text, further generating a first vector matrix corresponding to the first text, further inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, and further judging the size relation of A, B in the probability distribution; further, if A is larger than B, marking the sentence corresponding to the sentence vector as the content spoken by the providing service side; if B is larger than A, marking the sentence corresponding to the sentence vector as the content spoken by the server. The method utilizes the super strong learning ability of the multi-head attention mechanism on the remote relationship, and can effectively improve the accuracy of character analysis.

Description

Role analysis method and system based on multi-head attention mechanism
Technical Field
The invention relates to the technical field of dialogue analysis, in particular to a role analysis method and a role analysis system based on a multi-head attention mechanism.
Background
The gradual development of the customer information service industry enables the voice interactive customer service mode to have wider availability and usability; in the goal of further improving the quality of service, analysis of voice call content is a key ring. In order to accurately know whether the operation of the providing service party is normal or not and the appeal of the served party, it is necessary to distinguish between the conversation content expressed by the providing service party and the conversation content expressed by the served party. ASR (automatic speech recognition) also provides the ability to analyze characters, but tends to be less effective.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a role analysis method based on a multi-head attention mechanism and a role analysis system based on the multi-head attention mechanism aiming at the defects of the prior art.
The technical scheme adopted for solving the technical problems is as follows:
in one aspect, a role analysis method based on a multi-head attention mechanism is provided, wherein the method comprises the following steps:
converting a first dialogue record into a first text, wherein the first dialogue record is a record of contents spoken by a to-be-divided providing service party and contents spoken by a to-be-serviced party;
generating a first vector matrix corresponding to the first text, wherein the total number of sentence vectors contained in the first vector matrix is the same as the total number of sentences contained in the first text, and the sentence vectors contained in the first vector matrix are in one-to-one correspondence with the sentences contained in the first text;
inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, wherein the probability distribution is [ A, B ], A represents probability that sentences corresponding to the sentence vectors are the contents of the service provider, and B represents probability that sentences corresponding to the sentence vectors are the contents of the service provider;
judging the size relation of A, B in the probability distribution;
if A is larger than B, marking sentences corresponding to the sentence vectors as the contents spoken by the providing service side; if B is larger than A, marking the sentence corresponding to the sentence vector as the content spoken by the server.
On the other hand, a role analysis system based on a multi-head attention mechanism is provided, and a role analysis method based on the multi-head attention mechanism is provided, wherein the role analysis system comprises:
the conversion unit is used for converting the first dialogue record into a first text, wherein the first dialogue record is a record of the content spoken by the service provider and the content spoken by the service provider to be divided;
the generating unit is used for generating a first vector matrix corresponding to the first text, wherein the total number of sentence vectors contained in the first vector matrix is the same as the total number of sentences contained in the first text, and the sentence vectors contained in the first vector matrix are in one-to-one correspondence with the sentences contained in the first text;
the probability distribution analysis unit is used for inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, wherein the probability distribution is [ A, B ], A represents probability that sentences corresponding to the sentence vectors are the contents of the service provider, and B represents probability that sentences corresponding to the sentence vectors are the contents of the service provider;
a judging unit for judging the size relation of A, B in the probability distribution;
the marking unit is also used for marking the sentence corresponding to the sentence vector as the content spoken by the service provider when A is larger than B, and marking the sentence corresponding to the sentence vector as the content spoken by the service provider when B is larger than A.
The invention has the beneficial effects that: converting the first dialogue record into a first text, further generating a first vector matrix corresponding to the first text, further inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, and further judging the size relation of A, B in the probability distribution; further, if A is larger than B, marking the sentence corresponding to the sentence vector as the content spoken by the providing service side; if B is larger than A, marking the sentence corresponding to the sentence vector as the content spoken by the server. The method utilizes the super strong learning ability of the multi-head attention mechanism on the remote relationship, and can effectively improve the accuracy of character analysis.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described with reference to the accompanying drawings and embodiments, in which the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained by those skilled in the art without inventive effort:
FIG. 1 is a flow chart of a method according to one embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating the operation of a multi-head attention layer according to a first embodiment of the present invention;
fig. 3 is a diagram of a system according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the following description will be made in detail with reference to the technical solutions in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present invention, based on the embodiments of the present invention.
Example 1
The embodiment of the invention provides a role analysis method based on a multi-head attention mechanism, which is shown in fig. 1 to 2 and comprises the following steps:
s1: the first dialogue record is converted into a first text, wherein the first dialogue record is a record of the contents spoken by the service party and the contents spoken by the service party to be divided and provided.
S2: and generating a first vector matrix corresponding to the first text, wherein the total number of sentence vectors contained in the first vector matrix is the same as the total number of sentences contained in the first text, and the sentence vectors contained in the first vector matrix are in one-to-one correspondence with the sentences contained in the first text.
S3: and inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, wherein the probability distribution is [ A, B ], A represents the probability that sentences corresponding to the sentence vectors are the contents of the service provider, and B represents the probability that sentences corresponding to the sentence vectors are the contents of the service provider.
S4: the magnitude relation of A, B in the probability distribution is judged.
S5: if A is larger than B, marking sentences corresponding to the sentence vectors as the contents spoken by the providing service side; if B is larger than A, marking the sentence corresponding to the sentence vector as the content spoken by the server.
Further, before converting the first dialogue record into the first text,
select N 1 Recording the second dialogue;
will N 1 Converting the second dialogue record into text to obtain N 1 N corresponding to the second dialogue record 2 A second text;
sign N 2 Providing sentences which are spoken by the service side and sentences which are spoken by the service side in the second text;
generation and N by BERT model 2 Part IIText corresponding N 3 A second vector matrix of groups, wherein the second vector matrix corresponds to N in the second text 4 The second vector matrix comprises N5 sentence vectors corresponding to the N4 sentences;
average value operation is carried out on each sentence vector of the second vector matrix to obtain a vector N 3 N corresponding to the group second vector matrix 6 A third vector matrix;
the third vector matrix and the marking result corresponding to the second text are respectively input data and output data used for training the probability distribution analysis model;
the probability distribution analysis model comprises the following components in sequence:
an input layer for inputting the first vector matrix and the third vector matrix;
the multi-head attention layer comprises a first linear transformation layer and a second linear transformation layer, wherein the first linear transformation layer and the second linear transformation layer are respectively used for performing linear transformation on a first vector matrix output by an input layer to obtain a fourth vector matrix with higher dimensionality, and performing linear transformation on a fifth vector matrix obtained by splicing a plurality of fourth vector matrices to obtain a sixth vector matrix, and the dimensionality of the fourth vector matrix is N 1 *N 2 The number of split heads is N 1 Each head hiding layer has a size of N 2 The sixth vector matrix has dimensions N 2 The method comprises the steps of carrying out a first treatment on the surface of the The multi-head attention layer is used for inputting a sixth vector matrix into the normalization layer;
a normalization layer for normalizing the sixth vector matrix output by the multi-head attention layer;
the first full connection layer has 256 inputs and 256 outputs;
a Dropout layer;
the second full connection layer has an input of 256 and an output of 2.
Furthermore, the loss function of the probability distribution analysis model adopts cross entropy and adopts a gradient descent method for training.
Further, a BERT model is employed to generate a first vector matrix.
Furthermore, in the normalization layer, a LayerNormalization mode is adopted for normalization;
in the Dropout layer, the loss rate is 50%;
in the first full connection layer, the activation function adopts relu;
in the second fully-connected layer, the activation function uses softmax.
In the present embodiment, N 1 -N 6 Are all positive integers, N 1 Can be 100, N 4 May be 10; and obtaining a vector matrix through a BERT model (base version), if one sentence has 12 words, obtaining the matrix size of the matrix with the size of 10 x 12 x 768, and then averaging the vectors of the 12 words of each sentence to obtain the vector representation of the 10 sentences, wherein the obtained matrix size is 10 x 768, and the obtained matrix is used for subsequent training.
In this embodiment, the probability distribution analysis model is preferably based mainly on LSTM, and the Multi-Head Attention layer is based on Multi-Head Attention mechanism in a transducer architecture.
In the present embodiment, N 1 Is 8, N 2 256, for K, Q, V in the multi-head attention layer, splitting K into 8K and Q into 8Q and V into 8V, respectively performing an atttention calculation on each pair of K, Q and V to obtain atttention C, splicing the 8C to obtain C (10×2048), converting the C into 10×256 through the second linear conversion layer, and inputting the C into the normalization layer.
In this embodiment, the output of the second full connection layer is 2, corresponding to the candidate range of the role analysis.
The method provided by the embodiment specifically comprises the steps of converting a first dialogue record into a first text, further generating a first vector matrix corresponding to the first text, further inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, and further judging the size relation of A, B in the probability distribution; further, if A is larger than B, marking the sentence corresponding to the sentence vector as the content spoken by the providing service side; if B is larger than A, marking the sentence corresponding to the sentence vector as the content spoken by the server. The method utilizes the super strong learning ability of the multi-head attention mechanism on the remote relationship, and can effectively improve the accuracy of character analysis.
Example two
The embodiment of the invention provides a role analysis system based on a multi-head attention mechanism, as shown in fig. 3, the role analysis system comprises:
a conversion unit 10, configured to convert a first dialogue recording into a first text, where the first dialogue recording is a recording of contents spoken by a to-be-divided providing service party and contents spoken by a to-be-serviced party;
a generating unit 11, configured to generate a first vector matrix corresponding to the first text, where a total number of sentence vectors included in the first vector matrix is the same as a total number of sentences included in the first text, and the sentence vectors included in the first vector matrix are in one-to-one correspondence with the sentences included in the first text;
the probability distribution analysis unit 12 is configured to input the first vector matrix into a pre-trained probability distribution analysis model, so as to obtain probability distribution of sentence vectors contained in the first vector matrix, where the probability distribution is [ a, B ], where a represents probability that sentences corresponding to the sentence vectors are the content spoken by the service provider, and B represents probability that sentences corresponding to the sentence vectors are the content spoken by the service provider;
a judging unit 13 for judging the magnitude relation of A, B in the probability distribution;
the marking unit 14 is further configured to mark the sentence corresponding to the sentence vector as the content spoken by the provider when a is greater than B, and mark the sentence corresponding to the sentence vector as the content spoken by the provider when B is greater than a.
Further, the role analysis system further includes:
a selecting unit 15 for selecting N 1 Recording the second dialogue;
a conversion unit for converting N 1 Converting the second dialogue record into text to obtain N 1 N corresponding to the second dialogue record 2 A second text;
a marking unit for marking N by user 2 Providing sentences which are spoken by the service side and sentences which are spoken by the service side in the second text;
a generation unit for generating the N and N through BERT model 2 N corresponding to the second text 3 Group second vectorA matrix, wherein the second vector matrix corresponds to N in the second text 4 Each sentence, the second vector matrix contains N and 4 n corresponding to each sentence 5 A sentence vector; and is also used for carrying out average value operation on each sentence vector of the second vector matrix to obtain a vector N 3 N corresponding to the group second vector matrix 6 A third vector matrix;
the third vector matrix and the marking result corresponding to the second text are respectively input data and output data used for training the probability distribution analysis model;
the probability distribution analysis unit comprises the following components:
an input layer for inputting the first vector matrix and the third vector matrix;
the multi-head attention layer comprises a first linear transformation layer and a second linear transformation layer, wherein the first linear transformation layer and the second linear transformation layer are respectively used for performing linear transformation on a first vector matrix output by an input layer to obtain a fourth vector matrix with higher dimensionality, and performing linear transformation on a fifth vector matrix obtained by splicing a plurality of fourth vector matrices to obtain a sixth vector matrix, and the dimensionality of the fourth vector matrix is N 1 *N 2 The number of split heads is N 1 Each head hiding layer has a size of N 2 The sixth vector matrix has dimensions N 2 The method comprises the steps of carrying out a first treatment on the surface of the The multi-head attention layer is used for inputting a sixth vector matrix into the normalization layer;
a normalization layer for normalizing the sixth vector matrix output by the multi-head attention layer;
the first full connection layer has 256 inputs and 256 outputs;
a Dropout layer;
the second full connection layer has an input of 256 and an output of 2.
Further, the loss function of the probability distribution analysis unit 12 is trained by adopting a cross entropy and adopting a gradient descent method.
Further, a BERT model is employed to generate a first vector matrix.
Furthermore, in the normalization layer, a LayerNormalization mode is adopted for normalization;
in the Dropout layer, the loss rate is 50%;
in the first full connection layer, the activation function adopts relu;
in the second fully-connected layer, the activation function uses softmax.
The system provided by the embodiment utilizes the super strong learning ability of the multi-head attention mechanism on the remote relationship, and can effectively improve the accuracy of character analysis.
It will be understood that modifications and variations will be apparent to those skilled in the art from the foregoing description, and it is intended that all such modifications and variations be included within the scope of the following claims.

Claims (8)

1. A role analysis method based on a multi-head attention mechanism is characterized by comprising the following steps:
converting a first dialogue record into a first text, wherein the first dialogue record is a record of contents spoken by a to-be-divided providing service party and contents spoken by a to-be-serviced party;
generating a first vector matrix corresponding to the first text, wherein the total number of sentence vectors contained in the first vector matrix is the same as the total number of sentences contained in the first text, and the sentence vectors contained in the first vector matrix are in one-to-one correspondence with the sentences contained in the first text;
inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, wherein the probability distribution is [ A, B ], A represents probability that sentences corresponding to the sentence vectors are the contents of the service provider, and B represents probability that sentences corresponding to the sentence vectors are the contents of the service provider;
judging the size relation of A, B in the probability distribution;
if A is larger than B, marking sentences corresponding to the sentence vectors as the contents spoken by the providing service side; if B is larger than A, marking sentences corresponding to the sentence vectors as the contents spoken by the server;
before the step of converting the first dialogue recording into the first text, the character analysis method further includes:
select N 1 Recording the second dialogue;
will N 1 Converting the second dialogue record into text to obtain N 1 N corresponding to the second dialogue record 2 A second text;
sign N 2 Providing sentences which are spoken by the service side and sentences which are spoken by the service side in the second text;
generation and N by BERT model 2 N corresponding to the second text 3 A second vector matrix of groups, wherein the second vector matrix corresponds to N in the second text 4 Each sentence, the second vector matrix contains N and 4 n corresponding to each sentence 5 A sentence vector;
average value operation is carried out on each sentence vector of the second vector matrix to obtain a vector N 3 N corresponding to the group second vector matrix 6 A third vector matrix;
the third vector matrix and the marking result corresponding to the second text are respectively input data and output data used for training the probability distribution analysis model;
the probability distribution analysis model comprises the following components in sequence:
an input layer for inputting the first vector matrix and the third vector matrix;
the multi-head attention layer comprises a first linear transformation layer and a second linear transformation layer, wherein the first linear transformation layer and the second linear transformation layer are respectively used for performing linear transformation on a first vector matrix output by an input layer to obtain a fourth vector matrix with higher dimensionality, and performing linear transformation on a fifth vector matrix obtained by splicing a plurality of fourth vector matrices to obtain a sixth vector matrix, and the dimensionality of the fourth vector matrix is N 1 *N 2 The number of split heads is N 1 Each head hiding layer has a size of N 2 The sixth vector matrix has dimensions N 2 The method comprises the steps of carrying out a first treatment on the surface of the The multi-head attention layer is used for inputting a sixth vector matrix into the normalization layer;
a normalization layer for normalizing the sixth vector matrix output by the multi-head attention layer;
the first full connection layer has 256 inputs and 256 outputs;
a Dropout layer;
the second full connection layer has an input of 256 and an output of 2.
2. The multi-head attention mechanism based character analysis method according to claim 1, wherein the loss function of the probability distribution analysis model is trained by adopting a cross entropy and adopting a gradient descent method.
3. The multi-headed character analysis method according to claim 1, wherein the first vector matrix is generated using a BERT model.
4. The multi-head attention mechanism based character analysis method of claim 1, wherein,
in the normalization layer, a Layernormative mode is adopted for normalization;
in the Dropout layer, the loss rate is 50%;
in the first full connection layer, the activation function adopts relu;
in the second fully-connected layer, the activation function uses softmax.
5. A multi-head attention mechanism-based character analysis system based on the multi-head attention mechanism-based character analysis method according to any one of claims 1 to 4, comprising:
the conversion unit is used for converting the first dialogue record into a first text, wherein the first dialogue record is a record of the content spoken by the service provider and the content spoken by the service provider to be divided;
the generating unit is used for generating a first vector matrix corresponding to the first text, wherein the total number of sentence vectors contained in the first vector matrix is the same as the total number of sentences contained in the first text, and the sentence vectors contained in the first vector matrix are in one-to-one correspondence with the sentences contained in the first text;
the probability distribution analysis unit is used for inputting the first vector matrix into a pre-trained probability distribution analysis model to obtain probability distribution of sentence vectors contained in the first vector matrix, wherein the probability distribution is [ A, B ], A represents probability that sentences corresponding to the sentence vectors are the contents of the service provider, and B represents probability that sentences corresponding to the sentence vectors are the contents of the service provider;
a judging unit for judging the size relation of A, B in the probability distribution;
the marking unit is also used for marking sentences corresponding to the sentence vectors as contents spoken by the service provider when A is larger than B, and marking sentences corresponding to the sentence vectors as contents spoken by the service provider when B is larger than A;
a selection unit for selecting N 1 Recording the second dialogue;
the conversion unit is also used for converting N 1 Converting the second dialogue record into text to obtain N 1 N corresponding to the second dialogue record 2 A second text;
the marking unit is also used for marking N by a user 2 Providing sentences which are spoken by the service side and sentences which are spoken by the service side in the second text;
the generating unit is also used for generating the N and N through the BERT model 2 N corresponding to the second text 3 A second vector matrix of groups, wherein the second vector matrix corresponds to N in the second text 4 Each sentence, the second vector matrix contains N and 4 n corresponding to each sentence 5 A sentence vector; and is also used for carrying out average value operation on each sentence vector of the second vector matrix to obtain a vector N 3 N corresponding to the group second vector matrix 6 A third vector matrix;
the third vector matrix and the marking result corresponding to the second text are respectively input data and output data used for training the probability distribution analysis model;
the probability distribution analysis unit comprises the following components:
an input layer for inputting the first vector matrix and the third vector matrix;
the multi-head attention layer comprises a first linear transformation layer and a second linear transformation layer, wherein the first linear transformation layer and the second linear transformation layer are respectively used for performing linear transformation on a first vector matrix output by an input layer to obtain a fourth vector matrix with higher dimensionality, and performing linear transformation on a fifth vector matrix obtained by splicing a plurality of fourth vector matrices to obtain a sixth vector matrix, and the dimensionality of the fourth vector matrix is N 1 *N 2 The number of split heads is N 1 Each head hiding layer has a size of N 2 The sixth vector matrix has dimensions N 2 The method comprises the steps of carrying out a first treatment on the surface of the The multi-head attention layer is used for inputting a sixth vector matrix into the normalization layer;
a normalization layer for normalizing the sixth vector matrix output by the multi-head attention layer;
the first full connection layer has 256 inputs and 256 outputs;
a Dropout layer;
the second full connection layer has an input of 256 and an output of 2.
6. The multi-headed character analysis system according to claim 5, wherein the loss function of the probability distribution analysis unit is trained by a gradient descent method using cross entropy.
7. The multi-headed character analysis system according to claim 5, wherein the first vector matrix is generated using a BERT model.
8. The multi-headed character analysis system according to claim 5, wherein,
in the normalization layer, a Layernormative mode is adopted for normalization;
in the Dropout layer, the loss rate is 50%;
in the first full connection layer, the activation function adopts relu;
in the second fully-connected layer, the activation function uses softmax.
CN202110180395.8A 2021-02-08 2021-02-08 Role analysis method and system based on multi-head attention mechanism Active CN112861509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110180395.8A CN112861509B (en) 2021-02-08 2021-02-08 Role analysis method and system based on multi-head attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110180395.8A CN112861509B (en) 2021-02-08 2021-02-08 Role analysis method and system based on multi-head attention mechanism

Publications (2)

Publication Number Publication Date
CN112861509A CN112861509A (en) 2021-05-28
CN112861509B true CN112861509B (en) 2023-05-12

Family

ID=75989486

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110180395.8A Active CN112861509B (en) 2021-02-08 2021-02-08 Role analysis method and system based on multi-head attention mechanism

Country Status (1)

Country Link
CN (1) CN112861509B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131879A (en) * 2019-06-25 2020-12-25 普天信息技术有限公司 Relationship extraction system, method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106683661B (en) * 2015-11-05 2021-02-05 阿里巴巴集团控股有限公司 Role separation method and device based on voice
US9842106B2 (en) * 2015-12-04 2017-12-12 Mitsubishi Electric Research Laboratories, Inc Method and system for role dependent context sensitive spoken and textual language understanding with neural networks
CN107766565A (en) * 2017-11-06 2018-03-06 广州杰赛科技股份有限公司 Conversational character differentiating method and system
CN108074576B (en) * 2017-12-14 2022-04-08 讯飞智元信息科技有限公司 Speaker role separation method and system under interrogation scene
US11062706B2 (en) * 2019-04-29 2021-07-13 Microsoft Technology Licensing, Llc System and method for speaker role determination and scrubbing identifying information
CN112270169B (en) * 2020-10-14 2023-07-25 北京百度网讯科技有限公司 Method and device for predicting dialogue roles, electronic equipment and storage medium
CN112270167B (en) * 2020-10-14 2022-02-08 北京百度网讯科技有限公司 Role labeling method and device, electronic equipment and storage medium
CN112182231B (en) * 2020-12-01 2021-03-09 佰聆数据股份有限公司 Text processing method, system and storage medium based on sentence vector pre-training model

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131879A (en) * 2019-06-25 2020-12-25 普天信息技术有限公司 Relationship extraction system, method and device

Also Published As

Publication number Publication date
CN112861509A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN111246027B (en) Voice communication system and method for realizing man-machine cooperation
US9753914B2 (en) Natural expression processing method, processing and response method, device, and system
CN111477216B (en) Training method and system for voice and meaning understanding model of conversation robot
CN101266792B (en) Speech recognition system and method for speech recognition
CN113205817B (en) Speech semantic recognition method, system, device and medium
CN110767213A (en) Rhythm prediction method and device
CN110704618B (en) Method and device for determining standard problem corresponding to dialogue data
JP2024502946A (en) Punctuation and capitalization of speech recognition transcripts
CN114818649A (en) Service consultation processing method and device based on intelligent voice interaction technology
EP4352630A1 (en) Reducing biases of generative language models
CN112053681B (en) Telephone customer service quality scoring method and system for ASR and NLU combined training
CN111666385A (en) Customer service question-answering system based on deep learning and implementation method
CN112861509B (en) Role analysis method and system based on multi-head attention mechanism
CN112002306B (en) Speech class recognition method and device, electronic equipment and readable storage medium
CN115240712A (en) Multi-mode-based emotion classification method, device, equipment and storage medium
CN114708848A (en) Method and device for acquiring size of audio and video file
CN112542154A (en) Text conversion method and device, computer readable storage medium and electronic equipment
CN113806506B (en) General knowledge reasoning-oriented generation type man-machine conversation reply generation method
CN113362803B (en) ARM side offline speech synthesis method, ARM side offline speech synthesis device and storage medium
WO2021250784A1 (en) Dictionary generation system, training data generation system, speech recognition system, dictionary generation method, and computer readable medium
WO2021166129A1 (en) Speech recognition device, control method, and program
CN116168684A (en) Training text prosody prediction model, and method and device for predicting text prosody
CN117952468A (en) Objection identification and objection response scoring method and equipment
CN115934906A (en) Distillation-combined multi-model complaint early warning method and system
CN113889149A (en) Speech emotion recognition method and device

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