CN111143514B - Method and apparatus for generating information - Google Patents

Method and apparatus for generating information Download PDF

Info

Publication number
CN111143514B
CN111143514B CN201911373939.1A CN201911373939A CN111143514B CN 111143514 B CN111143514 B CN 111143514B CN 201911373939 A CN201911373939 A CN 201911373939A CN 111143514 B CN111143514 B CN 111143514B
Authority
CN
China
Prior art keywords
sample
sample slot
slot
text
intention
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
CN201911373939.1A
Other languages
Chinese (zh)
Other versions
CN111143514A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201911373939.1A priority Critical patent/CN111143514B/en
Publication of CN111143514A publication Critical patent/CN111143514A/en
Application granted granted Critical
Publication of CN111143514B publication Critical patent/CN111143514B/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/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • 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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the application discloses a method and a device for generating information. One embodiment of the method comprises: acquiring a sample slot position marking text set corresponding to a sample intention; counting the occurrence condition of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention; a triplet is generated based on the sample intent, the core sample slot, and the non-core sample slot. The embodiment extracts the triple features based on limited samples, and reduces the workload of feature extraction.

Description

Method and apparatus for generating information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for generating information.
Background
During human-computer dialogue interaction, the machine needs to understand the semantics of the user dialogue. Currently, intent and slot recognition can translate user conversations into semantic information. And classification and sequence marking based on the deep neural network can realize intention and slot identification of the conversation. In general, in order to improve the recognition effect of the intentions and the slot positions, in addition to providing a certain number of intention and slot position labeling samples, characteristics are extracted from the intention and slot position labeling samples and used as training data to train the model.
At present, the commonly used feature extraction methods mainly include the following two methods: firstly, adding part-of-speech information such as verbs, nouns and adjectives as characteristics; secondly, adding entity information such as movie names, person names, place names and the like as characteristics. However, both of the above methods require a large amount of data accumulation to effectively recognize the part of speech or the entity information of the word.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating information.
In a first aspect, an embodiment of the present application provides a method for generating information, including: acquiring a sample slot position marking text set corresponding to a sample intention; counting the occurrence condition of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to a sample intention; a triplet is generated based on the sample intent, the core sample slot, and the non-core sample slot.
In some embodiments, counting occurrences of each sample slot in the sample slot annotation text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intent, includes: generating a sample slot position set corresponding to the sample intention based on the sample slot position labeling text set; generating a sample slot position subset group corresponding to the sample slot position set; for the sample slot position subsets in the sample slot position subset group, counting the frequency of the sample slot positions in the sample slot position subsets; and determining the sample slot position with the frequency greater than a preset frequency threshold value in the sample slot position subset as a core sample slot position.
In some embodiments, counting the frequency of sample slots in the subset of sample slots comprises: and counting the frequency of the sample slot position subset appearing in the sample slot position labeling text set as the frequency of the sample slot position in the sample slot position subset.
In some embodiments, counting occurrences of each sample slot in the sample slot annotation text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intent, includes: the sample slot that only appears in the set of sample slots to which the sample is intended is determined to be the core sample slot.
In some embodiments, counting the occurrence of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to a sample intention, further includes: and determining sample slot positions except the core sample slot position in the sample slot position set as non-core sample slot positions.
In some embodiments, the method further comprises: and for a sample slot position labeling text in the sample slot position labeling text set, taking the sample text and the triple corresponding to the sample slot position labeling text as input, taking the sample intention and the sample slot position labeling text as output, and training the deep neural network to obtain an intention and slot position identification model.
In some embodiments, the method further comprises: receiving a voice to be recognized input by a user; converting the voice to be recognized into a text to be recognized; and inputting the text to be recognized into the intention and slot position recognition model for classification and sequence marking to obtain the intention and slot position marking text corresponding to the text to be recognized.
In a second aspect, an embodiment of the present application provides an apparatus for generating information, including: the acquisition unit is configured to acquire a sample slot position marking text set corresponding to the sample intention; the statistical unit is configured to count the occurrence condition of each sample slot in the sample slot labeling text set and determine a core sample slot and a non-core sample slot corresponding to the sample intention; a generating unit configured to generate a triplet based on the sample intent, the core sample slot, and the non-core sample slot.
In some embodiments, the statistical unit comprises: the first generation subunit is configured to generate a sample slot position set corresponding to the sample intention based on the sample slot position labeling text set; a second generating subunit configured to generate a sample slot position subset group corresponding to the sample slot position set; a counting subunit configured to count, for a sample slot subset in the sample slot subset group, frequencies of sample slots in the sample slot subset; a first determining subunit configured to determine, as a core sample slot, a sample slot of the subset of sample slots whose frequency is greater than a preset frequency threshold.
In some embodiments, the statistics subunit is further configured to: and counting the frequency of the sample slot position subset appearing in the sample slot position labeling text set as the frequency of the sample slot position in the sample slot position subset.
In some embodiments, the statistics unit comprises: a second determining subunit configured to determine, as a core sample slot, only a sample slot that appears in a set of sample slots to which the sample is intended.
In some embodiments, the statistics unit further comprises: a third determining subunit configured to determine sample slots of the sample slot set other than the core sample slot as non-core sample slots.
In some embodiments, the apparatus further comprises: and the training unit is configured to mark a text for the sample slot in the sample slot marking text set, take the sample text and the triple corresponding to the sample slot marking text as input, take the sample intention and the sample slot marking text as output, train the deep neural network and obtain an intention and slot recognition model.
In some embodiments, the apparatus further comprises: a receiving unit configured to receive a voice to be recognized input by a user; a conversion unit configured to convert a speech to be recognized into a text to be recognized; and the identification unit is configured to input the text to be identified into the intention and slot position identification model for classification and sequence marking, so as to obtain the intention and slot position marking text corresponding to the text to be identified.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the method and the device for generating the information, firstly, a sample slot position marking text set corresponding to a sample intention is obtained; then counting the occurrence condition of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention; and finally generating the triples based on the sample intention, the core sample slot positions and the non-core sample slot positions. A large amount of data do not need to be accumulated additionally, the features can be extracted only by using the intention and the slot position marking samples, and the workload of feature extraction is reduced. In addition, the sample extraction features are marked on the basis of the intents and the slots, so that the extracted triple features are strongly related to the intents and the slots, and the relevance of the extraction features to the intents and the slots is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture to which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for generating information according to the present application;
FIG. 3 is a flow diagram of yet another embodiment of a method for generating information according to the present application;
FIG. 4 is a flow diagram of another embodiment of a method for generating information according to the present application;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for generating information according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for generating information or the apparatus for generating information of the present application may be applied.
As shown in fig. 1, a database 101, a network 102, and a server 103 may be included in the system architecture 100. Network 102 is the medium used to provide communication links between database 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The database 101 may store a large number of sample intents and corresponding sample slot annotation text sets.
The server 103 may provide various services. For example, the server 103 may analyze and process data such as a sample slot annotation text set corresponding to a sample intention acquired from the database 101, and generate a processing result (for example, a triple).
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the method for generating information provided in the embodiment of the present application is generally performed by the server 103, and accordingly, the apparatus for generating information is generally disposed in the server 103.
It should be understood that the number of databases, networks, and servers in fig. 1 are merely illustrative. There may be any number of databases, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for generating information in accordance with the present application is shown. The method for generating information comprises the following steps:
step 201, obtaining a sample slot position labeling text set corresponding to a sample intention.
In this embodiment, an execution subject (e.g., the server 103 shown in fig. 1) of the method for generating information may obtain a large number of sample intents and a sample slot annotation text set corresponding to each sample intention. The sample slot annotation text set corresponding to each sample intention may include a plurality of sample slot annotation texts. The sample intention may be an intention of the sample text, and the corresponding sample slot labeling text may be a slot-labeled text obtained by performing slot labeling on the sample text.
Taking the sample intention of the playing MUSIC (MUSIC _ pal) as an example, the corresponding sample slot position marking text set may include the following 3 sample slot position marking texts:
1. i listen to the third generation of [ music _ name ] of [ want _ key ] song [ music _ term ] tensor [ music _ size ].
2. Play [ wait _ key ] music [ music _ term ].
3. Come [ wait _ key ] jazz [ music _ tag ] music [ music _ term ].
Wherein, the content in the [ ] "is the marked slot position.
Step 202, counting the occurrence of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention.
In this embodiment, for each sample slot, the execution subject may count occurrence of each sample slot in the sample slot annotation text set corresponding to the execution subject to determine a core sample slot and a non-core sample slot corresponding to a sample intention.
Generally, based on the sample slot annotation text set, the execution subject may generate a sample slot set corresponding to the sample intention. Specifically, the sample slot position in the sample slot position labeling text set is subjected to duplication elimination processing, and a sample slot position set can be obtained. For example, the set of sample slots to which the sample intent of playing MUSIC (MUSIC _ pay) corresponds may include five sample slots, wan _ key, MUSIC _ term, MUSIC _ singer, MUSIC _ name, and MUSIC _ tag. The core sample slot may be a sample slot in which a sample slot corresponding to one sample intention has a high probability of labeling a text, or a sample slot in which the core sample slot has a high probability of labeling a text may correspond to the sample intention. The non-core sample slot may be a sample slot of the set of sample slots other than the core sample slot. For example, since the sample slots wan _ key and MUSIC _ term appear in all sample slot annotation text corresponding to the sample intention of playing MUSIC (MUSIC _ pay), wan _ key and MUSIC _ term are core sample slots, and MUSIC _ singer, MUSIC _ name, and MUSIC _ tag are non-core sample slots.
In some optional implementations of this embodiment, the core sample slot corresponding to the sample intent may be determined by:
firstly, a sample slot position set corresponding to a sample intention is generated based on a sample slot position labeling text set.
For example, the set of sample slots to which the sample intent of playing MUSIC (MUSIC _ pay) corresponds may be (wait _ key, MUSIC _ term, MUSIC _ singer, MUSIC _ name, MUSIC _ tag).
And then generating a sample slot position subset group corresponding to the sample slot position set.
For example, the sample slot subset group corresponding to the sample slot set (wait _ key, music _ term, music _ range, music _ name, music _ tag) may include the following 31 sample slot subsets: (wait _ key, music _ term, music _ range, music _ name, music _ tag), (wait _ key, music _ term, music _ range, music _ name), (wait _ key, music _ term, music _ name, music _ tag), (wait _ key, music _ range, music _ name, music _ tag), (music _ term, music _ range, music _ name, music _ tag), (wan _ key, music _ term, music _ range), (wan _ key, music _ term, music _ name), (wan _ key, music _ range, music _ tag), (wan _ key, music _ name, music _ tag), (music _ term, music _ range, music _ name, music _ term, music _ name, music _ tag), (music _ range, music _ name, music _ tag), (water _ key, music _ term), (water _ key, music _ index), (water _ key, music _ name), (water _ key, music _ tag), (music _ term, music _ singer), (music _ term, music _ name), (music _ term, music _ tag), (music _ singer, music _ name), (music _ name, music _ tag), (water _ key), (music _ term), (music _ singer), (music _ name), (music _ tag).
Then, for a sample slot subset in the sample slot subset group, the frequency of the sample slots in the sample slot subset is counted.
In general, the execution subject may count the frequency of occurrence of the sample slot position subset in the sample slot position annotation text set as the frequency of the sample slot position in the sample slot position subset. The frequency of the sample slot position subsets including one sample slot position in the sample slot position labeling text set is the frequency of the sample slot position, and the frequency of the sample slot position subsets including a plurality of sample slot positions in the sample slot position labeling text set is the frequency of the sample slot position combination.
And finally, determining the sample slot position with the frequency greater than a preset frequency threshold value in the sample slot position subset as a core sample slot position.
In general, if the frequency of occurrence of a sample slot position subset including one sample slot position in the sample slot position annotation text set is that the frequency of occurrence of the sample slot position is greater than a preset frequency threshold, the sample slot position is a core sample slot position. If the frequency of the sample slot position subset comprising the plurality of sample slot positions appearing in the sample slot position labeling text set is greater than a preset frequency threshold, all the sample slot positions in the sample slot position subset are core sample slot positions.
In addition, only sample slots that appear in the set of sample slots to which the sample is intended may also be determined to be core sample slots. And a sample slot that appears in a plurality of sample slot sets to which the plurality of samples are intended cannot be determined as a core sample slot. For example, the sample text "do you like jazz MUSIC" corresponding to the sample intention of CHAT (CHAT) also appears at the sample slot MUSIC _ tag, so the sample slot MUSIC _ tag cannot be used as the core sample slot corresponding to the sample intention of play MUSIC (MUSIC _ pay).
In some optional implementations of this embodiment, the execution body may determine, as the non-core sample slot, a sample slot in the sample slot set except for the core sample slot.
Step 203, generating a triplet based on the sample intent, the core sample slot, and the non-core sample slot.
In this embodiment, the execution subject may generate the triplet based on the sample intent, the core sample slot, and the non-core sample slot. For example, the sample intent MUSIC _ poly, the core sample slots wait _ key and MUSIC _ term, and the non-core sample slots MUSIC _ singer, MUSIC _ name and MUSIC _ tag may constitute a triplet (MUSIC _ poly, wait _ key/MUSIC _ term, MUSIC _ singer/MUSIC _ name/MUSIC _ tag).
The method for generating the information comprises the steps of firstly obtaining a sample slot position marking text set corresponding to a sample intention; then counting the occurrence condition of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention; and finally generating the triples based on the sample intention, the core sample slot positions and the non-core sample slot positions. A large amount of data do not need to be accumulated additionally, the features can be extracted only by using the intention and the slot position labeling samples, and the workload of feature extraction is reduced. In addition, the sample extraction features are marked on the basis of the intents and the slots, so that the extracted triple features are strongly related to the intents and the slots, and the relevance of the extraction features to the intents and the slots is improved.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a method for generating information in accordance with the present application is illustrated. The method for generating information comprises the following steps:
step 301, obtaining a sample slot position labeling text set corresponding to the sample intention.
Step 302, counting the occurrence of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention.
Step 303, generating a triplet based on the sample intent, the core sample slot, and the non-core sample slot.
In this embodiment, the specific operations of steps 301 to 303 are already described in detail in steps 201 to 203 in the embodiment shown in fig. 2, and are not described again here.
And 304, regarding a sample slot position labeling text in the sample slot position labeling text set, taking the sample text and the triple corresponding to the sample slot position labeling text as input, taking the sample intention and the sample slot position labeling text as output, and training a deep neural network to obtain an intention and slot position identification model.
In this embodiment, for a sample slot annotation text in a sample slot annotation text set, an execution subject (for example, the server 103 shown in fig. 1) of the method for generating information may take a sample text and a triplet corresponding to the sample slot annotation text as inputs, take a sample intention and the sample slot annotation text as outputs, train a deep neural network, and obtain an intention and slot identification model. Wherein, the deep neural network may be a bidirectional LSTM (Long Short-Term Memory network). In the model training stage, not only the intention and slot position marking samples are used, but also the extracted triple features based on the intention and slot position marking samples are used, the extracted triple features are strongly related to the intention and the slot position, and the recognition effect of the trained model on the intention and the slot position is improved.
As can be seen from fig. 3, the flow 300 of the method for generating information in the present embodiment adds a model training step compared to the embodiment corresponding to fig. 2. Therefore, in the scheme described in this embodiment, not only the intention and slot position labeling samples are used in the model training stage, but also the extracted triple features based on the intention and slot position labeling samples are used, and the extracted triple features are strongly related to the intention and the slot position, so that the recognition effect of the trained model on the intention and the slot position is improved.
With further reference to FIG. 4, a flow 400 of another embodiment of a method for generating information according to the present application is shown. The method for generating information comprises the following steps:
step 401, obtaining a sample slot position labeling text set corresponding to a sample intention.
Step 402, counting the occurrence of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention.
Step 403, generating a triplet based on the sample intent, the core sample slot and the non-core sample slot.
Step 404, regarding a sample slot position labeling text in the sample slot position labeling text set, taking the sample text and the triple corresponding to the sample slot position labeling text as input, taking the sample intention and the sample slot position labeling text as output, and training the deep neural network to obtain an intention and slot position identification model.
In this embodiment, the specific operations of steps 401 to 404 have been described in detail in steps 301 to 304 in the embodiment shown in fig. 3, and are not described again here.
Step 405, receiving a speech to be recognized input by a user.
In the present embodiment, an execution subject (e.g., the server 103 shown in fig. 1) of the method for generating information may receive a voice to be recognized input by a user. The voice to be recognized can be the voice input by the user in the process of man-machine interaction.
Step 406, converting the speech to be recognized into a text to be recognized.
In this embodiment, the execution subject may convert the speech to be recognized into the text to be recognized. Specifically, the execution main body may perform speech recognition on the speech to be recognized to obtain a corresponding text to be recognized.
Step 407, inputting the text to be recognized into the intention and slot position recognition model for classification and sequence labeling, so as to obtain an intention and slot position labeling text corresponding to the text to be recognized.
In this embodiment, the executing body may input the text to be recognized to the intention and slot recognition model for classification and sequence labeling, so as to obtain an intention and slot labeled text corresponding to the text to be recognized.
Usually, a possible intent is triggered only when a core slot is present in the text to be recognized. The combination of the core slot and the non-core slot that triggers the intent is the possible slot. For example, for the text to be recognized "play zhangjie jazz MUSIC", the intention MUSIC _ pay may be triggered by the triplet (MUSIC _ pay, wait _ key/MUSIC _ term, MUSIC _ singer/MUSIC _ name/MUSIC _ tag), and the jazz [ MUSIC _ tag ] MUSIC [ MUSIC _ term ] whose slot is labeled text play [ wait _ key ] zhangjie [ MUSIC _ singer ].
As can be seen from fig. 4, the flow 400 of the method for generating information in the present embodiment adds a model prediction step compared to the embodiment corresponding to fig. 3. Therefore, according to the scheme described in the embodiment, the text to be recognized is directly input to the intention and slot recognition model for classification and sequence labeling, and the intention and slot labeling text corresponding to the text to be recognized can be obtained. And under the condition that the recognition effect of the intention and slot position recognition model is improved, the intention and slot position accuracy of the recognized text to be recognized is also improved.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for generating information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for generating information of the present embodiment may include: an acquisition unit 501, a statistical unit 502, and a generation unit 503. The obtaining unit 501 is configured to obtain a sample slot annotation text set corresponding to a sample intention; a counting unit 502 configured to count occurrence of each sample slot in the sample slot labeling text set, and determine a core sample slot and a non-core sample slot corresponding to a sample intention; a generating unit 503 configured to generate a triplet based on the sample intent, the core sample slot, and the non-core sample slot.
In the present embodiment, in the apparatus 500 for generating information: the specific processing of the obtaining unit 501, the statistical unit 502, and the generating unit 503 and the technical effects thereof can refer to the related descriptions of steps 201-203 in the corresponding embodiment of fig. 2, which are not repeated herein.
In some optional implementations of this embodiment, the statistics unit 502 includes: a first generating subunit (not shown in the figure), configured to generate a sample slot position set corresponding to the sample intention based on the sample slot position labeling text set; a second generating subunit (not shown in the figure) configured to generate a sample slot position subset group corresponding to the sample slot position set; a statistics subunit (not shown in the figure) configured to, for a sample slot subset in the sample slot subset group, count frequencies of sample slots in the sample slot subset; a first determining subunit (not shown in the figure) configured to determine, as a core sample slot, a sample slot of the sample slot subset having a frequency greater than a preset frequency threshold.
In some optional implementations of this embodiment, the statistics subunit is further configured to: and counting the frequency of the sample slot position subset appearing in the sample slot position labeling text set as the frequency of the sample slot position in the sample slot position subset.
In some optional implementations of this embodiment, the statistics unit 502 includes: a second determining subunit (not shown in the figure) configured to determine, as the core sample slot, a sample slot that only appears in the sample slot set to which the sample is intended to correspond.
In some optional implementations of this embodiment, the statistics unit 502 further includes: a third determining subunit (not shown in the figure) configured to determine sample slots other than the core sample slot in the sample slot set as non-core sample slots.
In some optional implementations of the present embodiment, the apparatus 500 for generating information further includes: and the training unit (not shown in the figure) is configured to label a text for a sample slot in the sample slot labeling text set, take the sample text and the triple corresponding to the sample slot labeling text as inputs, take the sample intention and the sample slot labeling text as outputs, and train the deep neural network to obtain an intention and slot recognition model.
In some optional implementations of the present embodiment, the apparatus 500 for generating information further includes: a receiving unit (not shown in the figure) configured to receive a voice to be recognized input by a user; a conversion unit (not shown in the figure) configured to convert the speech to be recognized into a text to be recognized; and the recognition unit (not shown in the figure) is configured to input the text to be recognized into the intention and slot recognition model for classification and sequence marking, so as to obtain the intention and slot marking text corresponding to the text to be recognized.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use in implementing an electronic device (e.g., server 103 shown in FIG. 1) of an embodiment of the present application is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or electronic device. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a statistical unit, and a generation unit. The names of these units do not constitute a limitation to the unit itself in this case, and for example, the obtaining unit may also be described as "a unit in which the sample slot corresponding to the sample intention is marked with the text set".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a sample slot position marking text set corresponding to a sample intention; counting the occurrence condition of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention; a triplet is generated based on the sample intent, the core sample slot, and the non-core sample slot.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (16)

1. A method for generating information, comprising:
acquiring a sample slot position marking text set corresponding to a sample intention;
counting the occurrence condition of each sample slot in the sample slot labeling text set, and determining a core sample slot and a non-core sample slot corresponding to the sample intention, wherein the core sample slot is a sample slot which can exist when a sample slot labeling text corresponding to the sample intention is larger than a preset probability threshold, or the sample slot which has the core sample slot is a sample slot except the core sample slot in the sample slot set and can correspond to the sample intention when the sample slot labeling text which has the core sample slot is larger than the preset probability threshold;
generating a triplet based on the sample intent, the core sample slot, and the non-core sample slot.
2. The method of claim 1, wherein the counting occurrences of each sample slot in the sample slot annotation text set, and determining a core sample slot and a non-core sample slot to which the sample intent corresponds, comprises:
generating a sample slot position set corresponding to the sample intention based on the sample slot position labeling text set;
generating a sample slot position subset group corresponding to the sample slot position set;
for the sample slot position subsets in the sample slot position subset group, counting the frequency of the sample slot positions in the sample slot position subsets;
and determining the sample slot position with the frequency greater than a preset frequency threshold value in the sample slot position subset as a core sample slot position.
3. The method of claim 2, wherein the counting the frequency of sample slots in the subset of sample slots comprises:
and counting the frequency of the sample slot position subset appearing in the sample slot position marking text set, and taking the frequency as the frequency of the sample slot position in the sample slot position subset.
4. The method of claim 1, wherein the counting occurrences of each sample slot in the sample slot annotation text set, and determining a core sample slot and a non-core sample slot to which the sample intent corresponds, comprises:
determining a sample slot that only appears in a set of sample slots to which the sample is intended to correspond as a core sample slot.
5. The method of claim 2 or 4, wherein the counting occurrences of each sample slot in the sample slot annotation text set, determining a core sample slot and a non-core sample slot to which the sample is intended, further comprises:
and determining sample slot positions except the core sample slot position in the sample slot position set as non-core sample slot positions.
6. The method of claim 1, wherein the method further comprises:
and for the sample slot position labeling text in the sample slot position labeling text set, taking the sample text and the triplet corresponding to the sample slot position labeling text as input, taking the sample intention and the sample slot position labeling text as output, and training a deep neural network to obtain an intention and slot position identification model.
7. The method of claim 6, wherein the method further comprises:
receiving a voice to be recognized input by a user;
converting the speech to be recognized into a text to be recognized;
and inputting the text to be recognized into the intention and slot position recognition model for classification and sequence marking to obtain an intention and slot position marking text corresponding to the text to be recognized.
8. An apparatus for generating information, comprising:
the acquisition unit is configured to acquire a sample slot position marking text set corresponding to the sample intention;
a counting unit configured to count occurrence of each sample slot in the sample slot labeling text set, and determine a core sample slot and a non-core sample slot corresponding to the sample intention, where the core sample slot is a sample slot in which a sample slot labeling text corresponding to one sample intention is greater than a preset probability threshold and may exist, or the sample slot in which the sample slot labeling text corresponding to the core sample slot exists is greater than the preset probability threshold and may correspond to the sample intention, and the non-core sample slot is a sample slot in the sample slot set except the core sample slot;
a generating unit configured to generate a triplet based on the sample intent, the core sample slot, and the non-core sample slot.
9. The apparatus of claim 8, wherein the statistics unit comprises:
the first generation subunit is configured to generate a sample slot position set corresponding to the sample intention based on the sample slot position labeling text set;
a second generating subunit configured to generate a sample slot subset group corresponding to the sample slot set;
a counting subunit configured to count, for a sample slot subset of the sample slot subset group, a frequency of a sample slot in the sample slot subset;
a first determining subunit configured to determine, as a core sample slot, a sample slot of the subset of sample slots having a frequency greater than a preset frequency threshold.
10. The apparatus of claim 9, wherein the statistics subunit is further configured to:
and counting the frequency of the sample slot position subset appearing in the sample slot position labeling text set as the frequency of the sample slot position in the sample slot position subset.
11. The apparatus of claim 8, wherein the statistics unit comprises:
a second determining subunit configured to determine, as a core sample slot, a sample slot that only appears in a set of sample slots to which the sample is intended to correspond.
12. The apparatus according to claim 9 or 11, wherein the statistical unit further comprises:
a third determining subunit configured to determine sample slots of the set of sample slots other than the core sample slot as non-core sample slots.
13. The apparatus of claim 8, wherein the apparatus further comprises:
and the training unit is configured to mark a text for the sample slot in the sample slot marking text set, take the sample text and the triple corresponding to the sample slot marking text as input, take the sample intention and the sample slot marking text as output, train the deep neural network, and obtain an intention and slot recognition model.
14. The apparatus of claim 13, wherein the apparatus further comprises:
a receiving unit configured to receive a voice to be recognized input by a user;
a conversion unit configured to convert the speech to be recognized into a text to be recognized;
and the recognition unit is configured to input the text to be recognized into the intention and slot recognition model for classification and sequence marking, so as to obtain the intention and slot marking text corresponding to the text to be recognized.
15. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
16. A computer-readable medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201911373939.1A 2019-12-27 2019-12-27 Method and apparatus for generating information Active CN111143514B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911373939.1A CN111143514B (en) 2019-12-27 2019-12-27 Method and apparatus for generating information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911373939.1A CN111143514B (en) 2019-12-27 2019-12-27 Method and apparatus for generating information

Publications (2)

Publication Number Publication Date
CN111143514A CN111143514A (en) 2020-05-12
CN111143514B true CN111143514B (en) 2023-03-21

Family

ID=70520790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911373939.1A Active CN111143514B (en) 2019-12-27 2019-12-27 Method and apparatus for generating information

Country Status (1)

Country Link
CN (1) CN111143514B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108630190A (en) * 2018-05-18 2018-10-09 百度在线网络技术(北京)有限公司 Method and apparatus for generating phonetic synthesis model
CN110046254A (en) * 2019-04-18 2019-07-23 百度在线网络技术(北京)有限公司 Method and apparatus for generating model

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721295B1 (en) * 2000-08-25 2004-04-13 Texas Instruments Incorporated Triple data system for high data rate communication systems
US10019759B2 (en) * 2016-06-21 2018-07-10 Erland Wittkotter Real-time probability determination based on technical indicators in a financial instrument environment
CN109101545A (en) * 2018-06-29 2018-12-28 北京百度网讯科技有限公司 Natural language processing method, apparatus, equipment and medium based on human-computer interaction
CN109241524B (en) * 2018-08-13 2022-12-20 腾讯科技(深圳)有限公司 Semantic analysis method and device, computer-readable storage medium and electronic equipment
CN109508459B (en) * 2018-11-06 2022-11-29 杭州费尔斯通科技有限公司 Method for extracting theme and key information from news
CN110245221B (en) * 2019-05-13 2023-05-23 华为技术有限公司 Method and computer device for training dialogue state tracking classifier

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108630190A (en) * 2018-05-18 2018-10-09 百度在线网络技术(北京)有限公司 Method and apparatus for generating phonetic synthesis model
CN110046254A (en) * 2019-04-18 2019-07-23 百度在线网络技术(北京)有限公司 Method and apparatus for generating model

Also Published As

Publication number Publication date
CN111143514A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN109002510B (en) Dialogue processing method, device, equipment and medium
CN110046254B (en) Method and apparatus for generating a model
CN109522552B (en) Normalization method and device of medical information, medium and electronic equipment
CN111159220B (en) Method and apparatus for outputting structured query statement
CN110209812B (en) Text classification method and device
CN109241286B (en) Method and device for generating text
CN110069698B (en) Information pushing method and device
CN110019742B (en) Method and device for processing information
CN107844587B (en) Method and apparatus for updating multimedia playlist
CN111859968A (en) Text structuring method, text structuring device and terminal equipment
CN109582954A (en) Method and apparatus for output information
CN109410986A (en) Emotion recognition method and device and storage medium
CN111783424B (en) Text sentence dividing method and device
CN111314388A (en) Method and apparatus for detecting SQL injection
CN111401034B (en) Semantic analysis method, semantic analysis device and terminal for text
CN112001167B (en) Punctuation mark adding method, system, equipment and medium
CN110675865B (en) Method and apparatus for training hybrid language recognition models
CN110705308B (en) Voice information domain identification method and device, storage medium and electronic equipment
CN111143514B (en) Method and apparatus for generating information
CN114970470B (en) Method and device for processing file information, electronic equipment and computer readable medium
CN116010606A (en) Training method and device for text auditing model and text auditing method and device
CN116072147A (en) Music detection model training method and device, electronic equipment and storage medium
CN112100364A (en) Text semantic understanding method and model training method, device, equipment and medium
CN113434695A (en) Financial event extraction method and device, electronic equipment and storage medium
CN113609309A (en) Knowledge graph construction method and device, storage medium and electronic equipment

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