WO2021135603A1 - Intention recognition method, server and storage medium - Google Patents

Intention recognition method, server and storage medium Download PDF

Info

Publication number
WO2021135603A1
WO2021135603A1 PCT/CN2020/125213 CN2020125213W WO2021135603A1 WO 2021135603 A1 WO2021135603 A1 WO 2021135603A1 CN 2020125213 W CN2020125213 W CN 2020125213W WO 2021135603 A1 WO2021135603 A1 WO 2021135603A1
Authority
WO
WIPO (PCT)
Prior art keywords
original sentence
sentence information
named entity
shared named
shared
Prior art date
Application number
PCT/CN2020/125213
Other languages
French (fr)
Chinese (zh)
Inventor
杨瑞东
张晴
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021135603A1 publication Critical patent/WO2021135603A1/en

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

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to an intention recognition method, server and storage medium.
  • man-machine dialogue technology With the rapid development of artificial intelligence technology, the application of man-machine dialogue technology in daily life is becoming more and more extensive.
  • the most important thing in man-machine dialogue technology is the recognition of user intent, that is, the recognition of the intent expressed by the voice data input by the user.
  • Existing intent recognition methods usually first convert the voice data input by the user into corresponding original sentence information, and then input the original sentence information into the trained intent recognition model to obtain the user's intent category.
  • the intent category determined directly through the intent recognition model is not It must be the real intention that the user wants to express. It can be seen that when the existing intention recognition method only includes the original sentence information of the shared named entity in the process of recognizing the first round of human-machine dialogue, there is a problem that the error rate of the intention recognition is high and the accuracy of the intention recognition is low.
  • the embodiments of the present application provide an intention recognition method, server, and storage medium, which can reduce the error rate of intention recognition and improve the accuracy of intention recognition.
  • an intention recognition method including:
  • the analysis result indicates that the original sentence information only contains a shared named entity, detecting whether the target dialogue round corresponding to the original sentence information is the first round of dialogue;
  • the target dialogue round is the first round of dialogue, output the intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine the target intent category selected by the user in the intent category.
  • the inputting the original sentence information into a preset shared named entity analysis engine to obtain an analysis result output by the shared named entity analysis engine includes:
  • each of the shared named entities it is analyzed whether the original sentence information only includes the shared named entity, and the analysis result is obtained.
  • the end position of one of the candidate shared named entities is the end position of the original sentence information, it is determined that only the shared named entity is included in the original sentence information.
  • the method further includes:
  • the shared naming with the starting position being the position after the ending position of any one of the candidate shared named entities is executed in a loop
  • the shared named entity whose starting position is the first position of the original sentence information is determined as the first target shared named entity, and the value of the flag corresponding to the end position of the first target shared named entity is updated to the first target shared named entity.
  • the value of the flag bit corresponding to the previous position of the start position of the second target shared named entity is the second preset value, set the value of the flag bit corresponding to the end position of the second target shared named entity The value is updated to the second preset value;
  • the original sentence information After traversing all the shared named entities, if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the first preset value, it is determined that the original sentence information does not only include the shared name entity.
  • the method further includes:
  • the target dialogue round is not the first round of dialogue, acquiring historical original sentence information of the user in the historical dialogue round before the target dialogue round;
  • the target intention category corresponding to the original sentence information is determined.
  • an embodiment of the present application provides a server, including:
  • the first obtaining unit is used to obtain the original sentence information of the user
  • the second obtaining unit is configured to input the original sentence information into a preset shared named entity analysis engine to obtain the analysis result output by the shared named entity analysis engine;
  • the first detecting unit is configured to detect whether the target dialogue round corresponding to the original sentence information is the first round of dialogue if the analysis result indicates that the original sentence information contains only shared named entities;
  • the first determining unit is configured to, if the target dialogue round is the first round of dialogue, output an intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine that the user selects among the intent categories The target intent category.
  • an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor executes the computer program when the computer program is executed.
  • the intention recognition method as described in the first aspect above.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the intention recognition as described in the first aspect is realized. method.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on a server, causes the server to execute the intention recognition method described in any one of the above-mentioned first aspects.
  • the original sentence information is not directly input into the traditional intent recognition model to determine the intention category expressed by the user, but the The original sentence information is input into the preset shared named entity analysis engine, and the shared named entity analysis engine is used to analyze whether the original sentence information contains only the shared named entity, and the original sentence information contains only the shared named entity, and the original sentence information
  • the corresponding target dialogue round is the first round of dialogue
  • the user can select the expressed target intent category from the intent categories.
  • the category is obtained through further confirmation by the user, so it can reduce the error rate of intent recognition and improve the accuracy of intent recognition.
  • FIG. 1 is a schematic structural diagram of a human-machine dialogue system to which an intention recognition method provided by an embodiment of the present application is applicable;
  • FIG. 2 is a schematic flowchart of an intention recognition method provided by an embodiment of the present application.
  • FIG. 3 is a specific schematic flowchart of S22 in an intention recognition method provided by an embodiment of the present application.
  • FIG. 4 is a specific schematic flowchart of S224 in an intention recognition method provided by an embodiment of the present application.
  • FIG. 5 is a specific schematic flowchart of S224 in an intention recognition method provided by another embodiment of the present application.
  • FIG. 6 is a schematic flowchart of an intention recognition method provided by another embodiment of the present application.
  • FIG. 7 is a structural block diagram of a server provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a server provided by another embodiment of the present application.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • FIG. 1 is a schematic architecture diagram of a human-machine dialogue system to which an intention recognition method provided by an embodiment of the present application is applicable.
  • the man-machine dialogue system 100 provided in this embodiment includes a man-machine dialogue terminal 110 and a man-machine dialogue server 120.
  • the human-machine dialogue terminal 110 includes, but is not limited to, mobile phones, tablet computers, smart TVs, wearable devices, in-vehicle devices, augmented reality (AR)/virtual reality (VR) devices, notebook computers, and ultra mobile devices.
  • AR augmented reality
  • VR virtual reality
  • UMPC ultra-mobile personal computers
  • PDAs personal digital assistants
  • the embodiment of the application does not impose any restriction on the specific type of the human-machine dialogue terminal 110.
  • the man-machine dialogue terminal 110 in the man-machine dialogue system 100 can establish a wireless communication connection or a wired communication connection with the man-machine dialogue server 120, thereby realizing Wireless communication or wired communication between the man-machine dialogue terminal 110 and the man-machine dialogue server 120.
  • the man-machine dialogue terminal 110 may collect voice data from the user through its voice collection module.
  • the man-machine dialogue terminal 110 may convert the voice data from the user into corresponding original sentence information, and then send the original sentence information to the man-machine dialogue server 120 through wireless communication or wired communication; or, the man-machine dialogue terminal 110 may directly
  • the voice data from the user is sent to the man-machine dialogue server 120 through wireless communication or wired communication, and the man-machine dialogue server 120 converts the voice data from the user into corresponding original sentence information.
  • the human-machine dialogue server 120 recognizes the target intention category of the original sentence information, and feeds back the target intention category to the human-machine dialogue terminal 110 through wireless communication or wired communication.
  • FIG. 2 is a schematic flowchart of an intention recognition method provided by an embodiment of the present application.
  • the execution subject of the process is a server, and the server may specifically be a man-machine dialogue in a man-machine dialogue system. server.
  • an intention recognition method provided by this embodiment includes S21 to S24, which are described in detail as follows:
  • the user's original sentence information refers to text information obtained by translating the voice data from the user in the process of man-machine dialogue.
  • the man-machine dialogue terminal in the man-machine dialogue system can collect the user's voice data through its voice collection module.
  • the human-machine dialogue terminal can perform voice-to-text processing on the collected user’s voice data to obtain the original sentence information corresponding to the user’s voice data, and combine it with the user’s voice
  • the original sentence information corresponding to the data is sent to the man-machine dialogue server in the man-machine dialogue system, and the man-machine dialogue server receives the user's original sentence information sent by the man-machine dialogue terminal.
  • the human-machine dialogue terminal can directly send the collected voice data of the user to the human-machine dialogue server, and the human-machine dialogue server performs audio-to-text processing on the user’s voice data. Obtain the original sentence information corresponding to the user's voice data.
  • the human-machine dialogue terminal or the man-machine dialogue server may convert the voice data from the user into corresponding original sentence information based on Automatic Speech Recognition (ASR) technology.
  • ASR Automatic Speech Recognition
  • the preset shared named entity analysis engine is pre-configured with an analysis algorithm for analyzing whether the sentence information contains only shared named entities, that is, the preset shared named entity analysis engine can analyze whether the sentence information contains only shared named entities. Contains shared named entities.
  • a named entity refers to an object identified by a name, and it can be an object represented by any noun.
  • named entities can be divided into different categories such as person names, place names, organization names, and song names.
  • Each named entity category usually includes multiple named entities of the same category, for example, "place names" under the named entity category It can include multiple named entities belonging to place names, such as Beijing, Shanghai, and Guangzhou.
  • Shared named entities refer to named entities that can be included in at least two types of intents and shared by at least two types of intents. Exemplarily, because taxi intention and navigation intention usually need to know the origin and/or destination, and the origin and destination belong to the named entity of "place name", that is, the named entity of "place name” is usually included in In the taxi intent and navigation intent, therefore, the named entity of the “place name” category is a shared named entity.
  • the man-machine dialogue server inputs the user's original sentence information into the preset shared named entity analysis engine to analyze the original sentence information through the shared named entity analysis engine Whether to include only shared named entities in the file, and then get the analysis results output by the shared named entity analysis engine.
  • the shared named entity analysis engine can analyze whether the original sentence information contains only shared named entities through S221 to S224 as shown in FIG. 3, as detailed below:
  • the man-machine dialogue server analyzes whether the original sentence contains only the shared named entity through the shared named entity analysis engine, it needs to first identify the named entity contained in the original sentence information.
  • the human-machine dialogue server can perform a named entity recognition (NER) operation on the original sentence information based on a preset named entity recognition tool.
  • NER named entity recognition
  • the preset named entity recognition tool can identify all the named entities contained in the original sentence information, and can obtain the information of each named entity. It is understandable that the named entity contained in the original sentence information may be one or at least two, which is specifically determined according to the actual situation, and there is no limitation here.
  • the information of the named entity may include, but is not limited to, the category of the named entity to which the named entity belongs and the start position and end position of the named entity in the original sentence information.
  • the start position refers to the position of the first character in the named entity in the original sentence information
  • the end position refers to the position of the last character in the named entity in the original sentence information
  • the characters in the named entity are in the original sentence information.
  • the position of the character can be identified by the order of the character in the original sentence information. Exemplarily, assuming that the original sentence information is "Take a taxi to Beijing Botanical Garden", the order of the characters from left to right in the original sentence information in the original sentence information can be 0, 1, 2, 3, 4, 5.
  • the position of each character from left to right in the original sentence information can be identified by 0, 1, 2, 3, 4, 5, 6, and 7, respectively. If the preset named entity recognition tool is used to perform named entity recognition on the original sentence information of "Take a taxi to Beijing Botanical Garden", it can be recognized that the original sentence information contains "Beijing", “Botanical Garden” and "Beijing Botanical Garden”.
  • S222 Identify the shared named entity in the named entity according to the preset list of shared named entity categories, and determine the shared named entity category to which the shared named entity belongs.
  • the human-machine dialogue server can identify the shared named entity among the named entities according to a preset list of shared named entity categories.
  • the preset shared named entity category list is used to store pre-configured shared named entity categories and intent categories corresponding to each shared named entity category.
  • the preset shared named entity category list may be obtained according to a preset named entity category configuration file.
  • the human-machine dialogue system can be configured with corresponding intent categories according to the functions that can be realized by the human-machine dialogue system, where different functions correspond to different intent categories.
  • the human-machine dialogue system can realize functions such as navigation or taxiing
  • the user may express the intention of taxiing or navigating to the human-machine dialogue system when communicating with the human-machine dialogue system. Therefore, it can be a human-machine dialogue system. Configure taxi intent or navigation intent, etc.
  • the man-machine dialogue server can store the named entity category configured for each intent category in the preset named entity category configuration file, that is, the named entity category configuration file is used to store the pre-defined
  • the named entity category configured for each intent category for example, please refer to Table 1.
  • Table 1 shows part of the content stored in the named entity category configuration file, where named entity category 2 is configured in both the intent A and the intent. In B, therefore, named entity category 2 is a shared named entity category.
  • the man-machine dialogue server After the man-machine dialogue server obtains the pre-configured named entity category configuration file, it can perform the shared named entity detection on the named entity category configuration file, that is, check whether there is at least one named entity category configured in at least two of the named entity category configuration files.
  • the intent category if it is detected that at least one named entity category is configured in at least two intent categories, it is determined that the at least one named entity category is a shared named entity category.
  • named entity category 2 in Table 1 is configured at the same time In Intent A and Intent B, therefore, named entity category 2 in Table 1 is a shared named entity category.
  • the human-machine dialogue server can associate each detected shared named entity category with its corresponding at least two intent categories and store them in a preset shared named entity category list, that is, the shared named entity category list is used to store each shared named entity category
  • the intent category corresponding to it Exemplarily, please refer to Table 2.
  • Table 2 shows part of the content stored in the shared named entity category list, where the intention categories corresponding to the shared named entity category 2 include intention A and intention B.
  • the man-machine dialogue server can store a preset list of shared named entity categories in its memory.
  • the man-machine dialogue server when it recognizes the shared named entity in the named entity contained in the original sentence information, it can obtain a preset list of shared named entity categories from its memory, and then according to the preset shared named entity category
  • the shared named entity category contained in the list identifies the shared named entity among the named entities contained in the original sentence information, and determines the shared named entity category to which each shared named entity belongs. Specifically, if the first named entity contained in the original sentence information belongs to the first shared named entity category in the list of shared named entity categories, the first named entity is identified as a shared named entity, and the shared named entity to which the shared named entity belongs is determined
  • the named entity category is the first shared named entity category.
  • S223 Determine the start position and the end position of the shared named entity in the original sentence information.
  • S224 According to the start position and the end position of each of the shared named entities, analyze whether the original sentence information only includes the shared named entity, and obtain the analysis result.
  • the man-machine dialogue server determines the start position and end position of each shared named entity contained in the original sentence information in the original sentence information, it can be based on the start position of each shared named entity in the original sentence information. Start position and end position to detect whether only shared named entities are included in the original sentence information.
  • S224 may be specifically implemented through S2241 to S2244 as shown in FIG. 4, which are described in detail as follows:
  • the man-machine dialogue server when the man-machine dialogue server detects whether the original sentence information contains only the shared named entity based on the start position and end position of each shared named entity in the original sentence information, it can first detect the content contained in the original sentence information. Whether there is a shared named entity whose starting position is the first position of the original sentence information in the shared named entity.
  • the first position of the original sentence information refers to the position of the first character in the original sentence information
  • the end position of the original sentence information refers to the position of the last character in the original sentence information.
  • the first position of the original sentence information "Taking a taxi to Beijing Botanical Garden” is the position where the first character " ⁇ " is located, that is, the identification of the first position of the original sentence information "Taking a taxi to Beijing Botanical Garden” is 0;
  • the original sentence information The last position of "Taking a taxi to Beijing Botanical Garden” is the position where the last character "door” is located, that is, the identification of the last position of the original sentence information "Taking a taxi to Beijing Botanical Garden” is 7.
  • the man-machine dialogue server detects that there is a shared named entity whose starting position is the first position of the original sentence information in the shared named entity contained in the original sentence information, it determines all the shared named entities whose starting position is the first position of the original sentence information It is a candidate shared named entity, and detects whether the end position of each candidate shared named entity is the end position of the original sentence information.
  • the original sentence information is "Beijing Botanical Garden”
  • the shared named entities "Beijing” and “Beijing Botanical Garden” contained in the original sentence information are the first positions of the original sentence information
  • the The shared named entities "Beijing" and "Beijing Botanical Garden” are both identified as candidate shared named entities.
  • the man-machine dialogue server separately detects whether the end positions of "Beijing” and "Beijing Botanical Garden” in the original sentence information are the last positions of the original sentence information.
  • the end position of "Beijing” in the original sentence information is not the end position of the original sentence information
  • the end position of "Beijing Botanic Garden” in the original sentence information is the end position of the original sentence information.
  • S2242 if the man-machine dialogue server detects that the end position of a candidate shared named entity is the end position of the original sentence information, S2242 is executed; if the man-machine dialogue server detects that the end position of all candidate shared named entities is not At the end of the original sentence information, S2243 ⁇ 2244 are executed.
  • S2242 and S2243 to S2244 are parallel steps, that is, when the man-machine dialogue server executes S2242, S2243 to S2244 are not executed; that is, when the man-machine dialogue server executes S2243 to S2244, S2242 is not executed.
  • the man-machine dialogue server detects that the end position of a candidate shared named entity in the original sentence information is the end position of the original sentence information, because the candidate shared named entity is at the start position in the original sentence information It is the first position of the original sentence information, so it means that all the characters in the original sentence information constitute the candidate shared named entity, which means that the original sentence information only contains the shared named entity and does not contain other information.
  • the man-machine dialogue The server determines that only shared named entities are included in the original sentence information.
  • the human-machine dialogue server when the human-machine dialogue server detects that the end positions of all candidate shared named entities are not the end positions of the original sentence information, it indicates that none of the candidate shared named entities starts from the first position of the original sentence information to the original sentence. The end position of the information ends.
  • the man-machine dialogue server detects whether there is a shared named entity located after the candidate shared named entity and adjacent to the candidate shared named entity in the original sentence information. That is, it is detected whether there is a shared named entity whose starting position is a position after the ending position of any candidate shared named entity in the original sentence information.
  • the man-machine dialogue server detects that there is at least one shared named entity whose starting position is the end position of any candidate shared named entity in the original sentence information, it will determine the at least one shared named entity as a new candidate shared entity Named entities.
  • the human-machine dialogue server detects whether the end position of each new candidate shared named entity is the end position of the original sentence information.
  • the human-machine dialogue server detects that the end position of at least one candidate shared named entity among the new candidate shared named entities is the end position of the original sentence information, it means that the original sentence information is only composed of the new candidate shared named entity and The candidate shared named entity that is adjacent to the new candidate shared named entity and is located before the new candidate shared named entity is composed of the candidate shared named entity, which means that the original sentence information only contains the shared named entity.
  • the original sentence information is "Botanic Garden Zoo”
  • the start position of the shared named entity "Zoo" is a position after the end position of the candidate shared named entity "Botanical Garden”
  • the shared named entity "Zoo” will be shared. It is determined as a new candidate shared named entity.
  • the end position of the new candidate shared named entity "zoo" is the end position of the original sentence information, it is determined that the original sentence information "Botanical Garden Zoo” only contains the shared named entity.
  • the human-machine dialogue server detects that the ending position of all new candidate shared named entities is not the end position of the original sentence information, it will continue to loop to detect whether there is a starting position in the original sentence information that is the end position of any candidate shared named entity If there is a shared named entity in the latter position, the shared named entity whose starting position is the ending position of any candidate shared named entity is determined as a new candidate shared named entity, and each new candidate is detected Whether the end position of the shared named entity is the last position of the original sentence information, until all the shared named entities in the original sentence information are traversed, if after traversing all the shared named entities in the original sentence information, there is no candidate for sharing The end position of the named entity is the end position of the original sentence information, and the man-machine dialogue server executes S2244.
  • the man-machine dialogue server After the man-machine dialogue server has traversed all the shared named entities in the original sentence information, if it detects that the end position of none of the candidate shared named entities is the end position of the original sentence information, it means that the original sentence information except In addition to the shared named entity, it also contains other information. At this time, the man-machine dialogue server determines that the original sentence information does not only include the shared named entity.
  • the shared named entity "Beijing” can be determined as a candidate shared named entity according to S2241
  • the shared named entity "Botanical Garden” can be determined as a new candidate shared named entity according to S2243
  • the end position of the new shared named entity "Botanic garden” is not the end position of the original sentence information "How to get to Beijing Botanical Garden", because at this time all the shared named entities in the original sentence information "How to get to Beijing Botanical Garden" have been traversed
  • the end position of none of the candidate shared named entities is the end position of the original sentence information "How to get to Beijing Botanical Garden", therefore, it is determined that the end position of original sentence information "How to get to Beijing Botanical Garden” does not only include the shared named entity.
  • the human-machine dialogue server detects that there is no shared named entity whose starting position is the end position of any candidate shared named entity in the original sentence information, it indicates that the original sentence information There is no shared named entity adjacent to each candidate shared named entity, which means that there are other information between at least two shared named entities in the original sentence information.
  • the man-machine dialogue server determines that the original sentence information does not only contain shared Named entities. Exemplarily, suppose the original sentence information is "how to get from the botanical garden to the zoo", since the last position of the end position of the candidate shared named entity "botanic garden" is the position of "to”, and the start of the shared named entity "zoo" The location is the location of "Long”.
  • S224 can also be specifically implemented through S2245 to S2240 as shown in FIG. 5, which is described in detail as follows:
  • S2245 Define a flag bit array with the same length as the length of the original sentence information, and set the value of each flag bit in the flag bit array to a first preset value.
  • the human-machine dialogue server when it detects whether the original sentence information contains only shared named entities, it can first define a flag bit array with the same length as the length of the original sentence information, where each flag in the flag bit array The bits respectively correspond to the positions of the characters in the original sentence information.
  • a flag bit array with a length of 5 can be defined.
  • the first flag bit in the flag bit array is the same as the first character "North” in the original sentence information "Beijing Botanical Garden”. ”Corresponds to the position, and the second flag bit in the flag bit array corresponds to the position of the second character “ ⁇ ” in the original sentence information “Beijing Botanical Garden”.
  • the man-machine dialogue server can first set the value of each flag bit in the flag bit array to the first preset value.
  • the first preset value may be any value in the Boolean logic value.
  • the first preset value may be 0 in the Boolean logic value or 1 in the Boolean logic value.
  • this embodiment will also involve a second preset value.
  • the second preset value can also be any value of Boolean logic values, but the second preset value is different from the first preset value. When the first preset value is 0, the second preset value is 1, and when the first preset value is 1, the second preset value is 0.
  • the human-machine dialogue server also detects whether the original sentence information contains a shared named entity whose starting position is the first position of the original sentence information. If the man-machine dialogue server detects that the original sentence information contains at least one shared named entity whose starting position is the first position of the original sentence information, S2246 to S2240 are executed.
  • S2246 Determine the shared named entity whose start position is the first position of the original sentence information as the first target shared named entity, and update the value of the flag bit corresponding to the end position of the first target shared named entity Is the second preset value.
  • the man-machine dialogue server detects that the original sentence information contains at least one shared named entity whose starting position is the first position of the original sentence information, it will share all starting positions as the first position of the original sentence information.
  • the named entity is determined to be the first target shared named entity, and the values of the flag bits corresponding to the end positions of all the first target shared named entities are updated to the second preset value.
  • the named entities "Beijing” and "Beijing Botanic Garden” is determined as the first target shared named entity, and the value of the flag corresponding to the end position of "Beijing” (ie the position of " ⁇ ") is updated to the second preset value, and the value of "Beijing Botanic Garden” The value of the flag bit corresponding to the end position (that is, the position of the "door”) is updated to the second preset value.
  • S2247 Determine the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity, and detect that each of the second target shared named entities corresponds to the previous position of the starting position Whether the value of the flag bit is the second preset value.
  • the human-machine dialogue server also determines the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity.
  • the shared named entity "Botanical Garden” is determined Share a named entity for the second target.
  • the man-machine dialogue server After determining the second target shared named entity, the man-machine dialogue server detects whether the value of the flag bit corresponding to the previous position of the starting position of each second target shared named entity is the second preset value. If the human-machine dialogue server detects that the value of the flag corresponding to the first position of the second target shared named entity is the second preset value, it indicates that the second target shared named entity is before the start position of the shared named entity.
  • a position is the end position of a first target shared named entity, which means that the second target shared named entity is adjacent to a first target shared named entity in the original sentence information.
  • the value of the flag bit corresponding to the end position of the target shared named entity is updated to the second preset value.
  • the man-machine dialogue server After the man-machine dialogue server has traversed all the second target shared named entities, it detects whether the updated value of the flag bit corresponding to the end position of the original sentence information is the second preset value. If the man-machine dialogue server detects that the flag bit corresponding to the end position of the original sentence information is updated to the second preset value, execute S2249; if the man-machine dialogue server detects the flag bit corresponding to the end position of the original sentence information After the updated value is the first preset value, S2240 is executed.
  • the human-machine dialogue server detects that the value of the flag corresponding to the previous position of the start position of a second target shared named entity is the first preset value, it indicates that the second target The shared named entity is not adjacent to any first target shared named entity in the original sentence information. At this time, the man-machine dialogue server does not update the value of the flag bit corresponding to the end position of the second target shared named entity.
  • the human-machine dialogue server After the human-machine dialogue server has traversed all shared named entities, if it detects that the updated value of the flag bit corresponding to the end position of the original sentence information is the second preset value, it indicates that the original sentence information From the first position to the end of the original sentence information, is composed of at least one shared named entity that is adjacent to the end, that is, the original sentence information does not contain other information except the shared named entity. At this time, the man-machine dialogue server It is determined that only shared named entities are included in the original sentence information.
  • the human-machine dialogue server After the human-machine dialogue server has traversed all the shared named entities, if it detects that the updated value of the flag bit corresponding to the end position of the original sentence information is the first preset value, it indicates that the original sentence information From the first position of the original sentence to the end of the original sentence information, it is not composed of at least one shared named entity that is adjacent to the end. That is, in addition to the shared named entity, the original sentence information also contains other information. At this time, the man-machine dialogue The server determines that the original sentence information does not include only shared named entities.
  • S224 may further include the following steps:
  • the human-machine dialogue server when the human-machine dialogue server detects that there is no shared named entity whose starting position is the first position of the original sentence information in the shared named entity contained in the original sentence information, it indicates that the first character in the original sentence information is not Included in the shared named entity means that the original sentence information also contains other information besides the shared named entity. At this time, the man-machine dialogue server determines that the original sentence information does not only include the shared named entity.
  • each human-machine dialogue terminal converts the voice data from the user during each round of human-machine dialogue into corresponding original sentence information, it also records the corresponding original sentence information in each round of human-machine dialogue.
  • Dialogue rounds among them, the dialogue round includes the first round of dialogue and non-first round of dialogue, that is, all other rounds of dialogue except the first round of dialogue are non-first round of dialogues.
  • the man-machine dialogue server when the analysis result output by the shared named entity analysis engine indicates that the original sentence information only contains the shared named entity, the man-machine dialogue server further detects whether the target dialogue round corresponding to the original sentence information is the first round of dialogue. If the human-machine dialogue server detects that the target dialogue round corresponding to the original sentence information is the first round of dialogue, S24 is performed.
  • S24 If the target dialogue round is the first round of dialogue, output the intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine the target intent category selected by the user in the intent category.
  • the man-machine dialogue server when the man-machine dialogue server detects that the original sentence information contains only shared named entities, and the target dialogue round corresponding to the original sentence information is the first round of dialogue, it can be based on each shared named entity contained in the original sentence information
  • the category of shared named entity to which it belongs, the intent category corresponding to the category of shared named entity to which each shared named entity belongs is obtained from the list of shared named entity categories.
  • the human-machine dialogue server obtains the intent categories corresponding to the shared named entity category to which each shared named entity contained in the original sentence information belongs, it outputs these intent categories so that the user can select the target they want to express from these intent categories Intent category.
  • the man-machine dialogue server may send the intent category corresponding to the shared named entity category to which each shared named entity contained in the original sentence information belongs to the man-machine dialogue terminal, and the man-machine dialogue terminal may generate and output corresponding intent categories based on these intent categories.
  • the man-machine dialogue terminal sends the target intent category selected by the user in these intent categories to the man-machine dialogue server, and the man-machine dialogue server obtains the user The target intent category selected among these intent categories.
  • the human-machine dialogue server after the human-machine dialogue server determines the target intent category, it can further obtain the slot information corresponding to the original sentence information, and then according to the target intent category, the original sentence information, and the slot information corresponding to the original sentence information , To determine clear user instructions.
  • the slot information refers to the necessary information type to which the shared named entity contained in the original sentence information belongs under the target intention category. Exemplarily, suppose that the target intention category is "hailing a taxi", and the intention category "hailing a taxi" usually needs to include two types of necessary information: "departure” and "destination”.
  • the dialogue server determines a clear user instruction that may be "Take a taxi to Beijing Botanical Garden".
  • the human-machine dialogue terminal in the human-machine dialogue system can obtain the necessary information type of the shared named entity contained in the original sentence information under the target intention category by asking the user. Then the slot information corresponding to the original sentence information is obtained, and the man-machine dialogue terminal can send the slot information corresponding to the original sentence information to the man-machine dialogue server.
  • the man-machine dialogue terminal in the man-machine dialogue system can collect the original sentence
  • the voice data corresponds to the information
  • the geographic location information of its current location is obtained, and the geographic location information of its current location is sent to the man-machine dialogue server.
  • the man-machine dialogue server can be based on the current location of the man-machine dialogue terminal
  • the geographic location information and the geographic location information corresponding to the shared named entity contained in the original sentence information are used to determine the slot information corresponding to the original sentence information.
  • the slot information corresponding to the original sentence information is determined as the starting place;
  • the slot information corresponding to the original sentence information is determined as the destination.
  • the geographic location information of the current location of the human-machine dialogue terminal matches the geographic location information corresponding to the shared named entity contained in the original sentence information.
  • the current geographic location of the human-machine dialogue terminal matches the original sentence.
  • the location deviation between the geographic locations corresponding to the shared named entities contained in the information is within a preset range; the geographic location information of the current location of the human-machine dialogue terminal is different from the geographic location information corresponding to the shared named entities contained in the original sentence information.
  • the matching specifically refers to that the position deviation between the current geographic location of the human-machine dialogue terminal and the geographic location corresponding to the shared named entity included in the original sentence information is not within a preset range.
  • the intention recognition method does not directly input the original sentence information of the user into the traditional intention recognition model to determine the intention category expressed by the user after obtaining the original sentence information of the user.
  • the target dialogue round corresponding to the original sentence information is the first round of dialogue, by outputting the intent category corresponding to the shared named entity category to which the shared named entity belongs, the user can select the expressed target intention from the intent category Category, since the target intention category is obtained through further confirmation by the user, it can reduce the error rate of intention recognition and improve the accuracy of intention recognition.
  • FIG. 6 is a schematic flowchart of an intention recognition method according to another embodiment of the present application.
  • an intention recognition method provided in this embodiment may further include S25 to S26 after S23, which is described in detail as follows:
  • S26 Determine the target intention category corresponding to the original sentence information according to the historical original sentence information.
  • the man-machine dialogue server detects that the original sentence information contains only the shared named entity, and the target dialogue round corresponding to the original sentence information is not the first round of dialogue.
  • the historical original sentence information of the user in the historical dialogue round before the target dialogue round is obtained, and the target intention category expressed by the original sentence information is determined based on the historical original sentence information.
  • the human-machine dialogue server after the human-machine dialogue server determines the target intent category, it can further obtain the slot information corresponding to the original sentence information, and then according to the target intent category, the original sentence information, and the slot information corresponding to the original sentence information , To determine clear user instructions. It should be noted that, in this embodiment, the man-machine dialogue server determines the specific way of definite user instructions according to the target intent category, original sentence information, and slot information corresponding to the original sentence information. You can refer to the relevant description in S24 here. No longer.
  • the original sentence information in the first round of human-machine dialogue is "I want to take a taxi”
  • the original sentence information in the second round of human-computer dialogue is "Beijing Botanical Garden”.
  • the slot information of the original sentence information "Beijing Botanical Garden” obtained by asking the user is "destination”
  • the clear user instruction is "Take a taxi to Beijing Botanical Garden”.
  • the intention recognition method when the original sentence information only contains the shared named entity, but the target dialogue round corresponding to the original sentence information is not the first round of dialogue, because the target dialogue round is before
  • the historical original sentence information in the historical dialogue round may contain necessary information that can express the user’s intentions, such as the target intention category expressed by the original sentence information. Therefore, directly pass the historical dialogue round before the target round
  • the historical original sentence information determines the target intention category expressed by the original sentence information, without the need to determine the user's target intention category through the user intention recognition model, thereby improving the efficiency of user intention recognition.
  • the human-machine dialogue server detects that the original sentence information does not only include the shared named entity, it can perform the following steps:
  • the original sentence information does not only include a shared named entity
  • the original sentence information is input into a preset intention recognition model to obtain the target intention category expressed by the original sentence information.
  • the man-machine dialogue server can directly input the original sentence information into the preset In the intention recognition model, the target intention category expressed by the original sentence information is obtained.
  • the user intent recognition model in this embodiment may be an intent recognition model based on neural networks, or an intent recognition model based on statistics, or may also be an intent recognition model of other types, which may be based on actual conditions. Demand settings.
  • the user intention recognition model receives the feature vector corresponding to the original sentence information at the input terminal, it can output the target intention category expressed by the original sentence information.
  • the human-machine dialogue server can obtain the slot information corresponding to the target intent category based on the necessary information that the target intent category needs to include, and based on The target intent category and the slot information corresponding to the target intent category are given clear user instructions.
  • the intent recognition method uses the user intent recognition model to determine the target intent class expressed by the original sentence information when the original sentence information does not only include a shared named entity, thereby improving The accuracy of user intent recognition.
  • FIG. 7 shows a structural block diagram of a server provided by an embodiment of the present application.
  • the server may specifically be a human-machine dialogue server in a human-machine dialogue system.
  • the server includes Each unit is used to execute each step in the foregoing embodiment.
  • the server 70 includes a first acquiring unit 71, a second acquiring unit 72, a first detecting unit 73, and a first determining unit 74. among them:
  • the first obtaining unit 71 is used to obtain the user's original sentence information.
  • the second obtaining unit 72 is configured to input the original sentence information into a preset shared named entity analysis engine to obtain an analysis result output by the shared named entity analysis engine.
  • the first detection unit 73 is configured to detect whether the target dialogue round corresponding to the original sentence information is the first round of dialogue if the analysis result indicates that the original sentence information only includes a shared named entity.
  • the first determining unit 74 is configured to, if the target dialogue round is the first round of dialogue, output an intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine that the user selects among the intent categories The target intent category.
  • the second acquisition unit 72 specifically includes a named entity recognition unit, a shared named entity recognition unit, a location determination unit, and an analysis unit. among them:
  • the named entity recognition unit is used to recognize the named entity contained in the original sentence information.
  • the shared named entity identification unit is used to identify the shared named entity in the named entity according to a preset list of shared named entity categories, and determine the shared named entity category to which the shared named entity belongs
  • the position determining unit is used to determine the start position and the end position of the shared named entity in the original sentence information.
  • the analysis unit is used to analyze whether the original sentence information contains only the shared named entity according to the start position and the end position of each of the shared named entities, and obtain the analysis result.
  • the analysis unit specifically includes: a second determination unit and a first determination unit. among them:
  • the second determining unit is configured to determine the shared named entity whose starting position is the first position of the original sentence information as a candidate shared named entity.
  • the first determining unit is configured to determine that the original sentence information only includes the shared named entity if the end position of one of the candidate shared named entities is the end position of the original sentence information.
  • the analysis unit specifically further includes: a third determination unit and a second determination unit. among them:
  • the third determining unit is configured to, if the end positions of all the candidate shared named entities are not the end positions of the original sentence information, perform the loop execution to set the start position to the end position of any one of the candidate shared named entities.
  • the second determining unit is used to determine that the end position of all the new candidate shared named entities is not the end position of the original sentence information after traversing all the shared named entities. Contains only shared named entities.
  • the analysis unit specifically includes: a first definition unit, a first update unit, a first detection unit, a second update unit, a third determination unit, and a fourth determination unit. among them:
  • the first definition unit is used to define a flag bit array with the same length as the length of the original sentence information, and set the value of each flag bit in the flag bit array to a first preset value.
  • the first update unit is configured to determine the shared named entity whose starting position is the first position of the original sentence information as the first target shared named entity, and mark the end position of the first target shared named entity corresponding to the mark The value of the bit is updated to the second preset value.
  • the first detection unit is configured to determine the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity, and detect the start position of each of the second target shared named entities Whether the value of the flag bit corresponding to the previous position is the second preset value.
  • the second update unit is configured to, if the value of the flag bit corresponding to the previous position of the start position of the second target shared named entity is the second preset value, set the end of the second target shared named entity The value of the flag bit corresponding to the position is updated to the second preset value.
  • the third determining unit is configured to determine the original sentence information if the value of the flag bit corresponding to the end position of the original sentence information is the second preset value after traversing all the shared named entities Contains only shared named entities.
  • the fourth determining unit is configured to determine the original sentence information if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the first preset value after traversing all the shared named entities Does not only contain shared named entities.
  • the analysis unit further includes a fifth determination unit.
  • the fifth determining unit is used for determining that the original sentence information does not only include the shared named entity if there is no shared named entity whose starting position is the first position of the original sentence information in the shared named entity.
  • the server 70 further includes: a third acquiring unit and a fourth determining unit. among them:
  • the third obtaining unit is configured to obtain historical original sentence information of the user in the historical dialogue round before the target dialogue if the target dialogue round is not the first round of dialogue.
  • the fourth determining unit is configured to determine the target intention category corresponding to the original sentence information according to the historical original sentence information.
  • the server provided by the embodiment of the present application does not directly input the original sentence information into the traditional intention recognition model to determine the intention category expressed by the user.
  • the original sentence information is input into the preset shared named entity analysis engine, and the shared named entity analysis engine is used to analyze whether the original sentence information contains only shared named entities, and the original sentence information contains only shared named entities, and
  • the target dialogue round corresponding to the original sentence information is the first round of dialogue, by outputting the intent category corresponding to the shared named entity category to which the shared named entity belongs, so that the user can select the expressed target intent category from the intent categories, Since the target intention category is obtained through further confirmation by the user, the error rate of intention recognition can be reduced, and the accuracy of intention recognition can be improved.
  • FIG. 8 is a schematic structural diagram of a server provided by another embodiment of the present application.
  • the server 800 of this embodiment includes: at least one processor 80 (only one is shown in FIG. 8), a processor, a memory 81, and a memory 81 stored in the memory 81 and available in the at least one processor.
  • a computer program 82 running on the processor 80 when the processor 80 executes the computer program 82, implements the steps in any of the above-mentioned intention recognition method embodiments.
  • the server 800 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the server may include, but is not limited to, a processor 80 and a memory 81.
  • FIG. 8 is only an example of the server 800, and does not constitute a limitation on the server 800. It may include more or less components than shown, or a combination of certain components, or different components, such as It can also include input and output devices, network access devices, and so on.
  • the so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), and the processor 80 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 81 may be an internal storage unit of the server 800, such as a hard disk or a memory of the server 800. In other embodiments, the memory 81 may also be an external storage device of the server 800, for example, a plug-in hard disk equipped on the server 800, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital). Digital, SD) card, flash card, etc. Further, the storage 81 may also include both an internal storage unit of the server 800 and an external storage device.
  • the memory 81 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.
  • the embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned intention recognition method can be realized.
  • the embodiment of the present application provides a computer program product.
  • the computer program product runs on a mobile terminal, the steps in the above-mentioned intention recognition method can be realized when the mobile terminal is executed.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer program can be stored in a computer-readable storage medium.
  • the computer program can be stored in a computer-readable storage medium.
  • the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may include at least: any entity or device capable of carrying computer program code to the server, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM read-only memory
  • RAM random access memory
  • electrical carrier signals telecommunications signals
  • software distribution media Such as U disk, mobile hard disk, floppy disk or CD-ROM, etc.
  • computer-readable media cannot be electrical carrier signals and telecommunication signals.
  • the disclosed apparatus/network equipment and method may be implemented in other ways.
  • the device/network device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units.
  • components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be separately on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

Landscapes

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

Abstract

An intention recognition method, a server and a storage medium, wherein the intention recognition method comprises: acquiring original sentence information of a user (S21); inputting the original sentence information into a preset shared named entity analysis engine to obtain an analysis result outputted by the shared named entity analysis engine (S22); if the analysis result indicates that only shared named entities are comprised in the original sentence information, then detecting whether a target round of dialogue corresponding to the original sentence information is a first round of dialogue (S23); and if the target round of dialogue is the first round of dialogue, then outputting intention categories corresponding to shared named entity categories to which the shared named entities belong, and determining a target intention category selected by the user from among the intention categories (S24). The intention recognition method is able to reduce the error rate of intention recognition and improve the accuracy of intention recognition.

Description

意图识别方法、服务器及存储介质Intention recognition method, server and storage medium
本申请要求于2019年12月31日提交国家知识产权局、申请号为201911417222.2、申请名称为“意图识别方法、服务器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on December 31, 2019, the application number is 201911417222.2, and the application name is "Intent Recognition Method, Server and Storage Medium", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本申请涉及人工智能技术领域,尤其涉及一种意图识别方法、服务器及存储介质。This application relates to the field of artificial intelligence technology, and in particular to an intention recognition method, server and storage medium.
背景技术Background technique
随着人工智能技术的快速发展,人机对话技术在日常生活中的应用也越来越广泛,人机对话技术中最关键的是用户意图的识别,即识别用户输入的语音数据所表达的意图。现有的意图识别方法通常先将用户输入的语音数据转换为相应的原始语句信息,再将原始语句信息输入至训练好的意图识别模型中,即获得用户的意图类别。然而,当首轮人机对话过程中的原始语句信息中仅包含共享命名实体时,由于共享命名实体通常被应用在至少两类用户意图中,因此,直接通过意图识别模型确定出的意图类别不一定是用户想要表达的真正意图。可见,现有的意图识别方法在识别首轮人机对话过程中仅包含共享命名实体的原始语句信息时,存在意图识别错误率较高,意图识别准确性较低的问题。With the rapid development of artificial intelligence technology, the application of man-machine dialogue technology in daily life is becoming more and more extensive. The most important thing in man-machine dialogue technology is the recognition of user intent, that is, the recognition of the intent expressed by the voice data input by the user. . Existing intent recognition methods usually first convert the voice data input by the user into corresponding original sentence information, and then input the original sentence information into the trained intent recognition model to obtain the user's intent category. However, when the original sentence information in the first round of human-machine dialogue contains only shared named entities, since shared named entities are usually applied to at least two types of user intent, the intent category determined directly through the intent recognition model is not It must be the real intention that the user wants to express. It can be seen that when the existing intention recognition method only includes the original sentence information of the shared named entity in the process of recognizing the first round of human-machine dialogue, there is a problem that the error rate of the intention recognition is high and the accuracy of the intention recognition is low.
发明内容Summary of the invention
本申请实施例提供了一种意图识别方法、服务器及存储介质,能够降低意图识别的错误率,提高意图识别的准确性。The embodiments of the present application provide an intention recognition method, server, and storage medium, which can reduce the error rate of intention recognition and improve the accuracy of intention recognition.
第一方面,本申请实施例提供了一种意图识别方法,包括:In the first aspect, an embodiment of the present application provides an intention recognition method, including:
获取用户的原始语句信息;Get the user's original sentence information;
将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果;Inputting the original sentence information into a preset shared named entity analysis engine to obtain an analysis result output by the shared named entity analysis engine;
若所述分析结果指示所述原始语句信息中仅包含共享命名实体,则检测所述原始语句信息对应的目标对话轮次是否是首轮对话;If the analysis result indicates that the original sentence information only contains a shared named entity, detecting whether the target dialogue round corresponding to the original sentence information is the first round of dialogue;
若所述目标对话轮次是首轮对话,则输出与所述共享命名实体所属的共享命名实体类别对应的意图类别,并确定所述用户在所述意图类别中选择的目标意图类别。If the target dialogue round is the first round of dialogue, output the intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine the target intent category selected by the user in the intent category.
在第一方面的一种可能的实现方式中,所述将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果,包括:In a possible implementation of the first aspect, the inputting the original sentence information into a preset shared named entity analysis engine to obtain an analysis result output by the shared named entity analysis engine includes:
识别所述原始语句信息中包含的命名实体;Identifying named entities included in the original sentence information;
根据预设的共享命名实体类别列表,识别所述命名实体中的共享命名实体,并确定所述共享命名实体所属的共享命名实体类别;Identify the shared named entity among the named entities according to a preset list of shared named entity categories, and determine the shared named entity category to which the shared named entity belongs;
确定所述共享命名实体在所述原始语句信息中的起始位置和结束位置;Determining the start position and the end position of the shared named entity in the original sentence information;
根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果。According to the starting position and the ending position of each of the shared named entities, it is analyzed whether the original sentence information only includes the shared named entity, and the analysis result is obtained.
在第一方面的一种可能的实现方式中,所述根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果,包括:In a possible implementation of the first aspect, according to the start position and the end position of each of the shared named entities, analyze whether the original sentence information includes only the shared named entity, and obtain the The analysis results include:
将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为候选共享命名实体;Determining the shared named entity whose starting position is the first position of the original sentence information as a candidate shared named entity;
若有一个所述候选共享命名实体的结束位置为所述原始语句信息的末位置,则判定所述原始语句信息中仅包含共享命名实体。If the end position of one of the candidate shared named entities is the end position of the original sentence information, it is determined that only the shared named entity is included in the original sentence information.
在第一方面的一种可能的实现方式中,在将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为候选共享命名实体之后,还包括:In a possible implementation of the first aspect, after the shared named entity whose starting position is the first position of the original sentence information is determined as a candidate shared named entity, the method further includes:
若所有所述候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则循环执行将起始位置为任一所述候选共享命名实体的结束位置的后一位置的所述共享命名实体确定为新的候选共享命名实体,并检测所述新的候选共享命名实体的结束位置是否为所述原始语句信息的末位置的步骤;If the ending positions of all the candidate shared named entities are not the end positions of the original sentence information, the shared naming with the starting position being the position after the ending position of any one of the candidate shared named entities is executed in a loop The step of determining whether the entity is a new candidate shared named entity, and detecting whether the end position of the new candidate shared named entity is the end position of the original sentence information;
在遍历完所有所述共享命名实体后,若所有所述新的候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则判定所述原始语句信息中不是仅包含共享命名实体。After traversing all the shared named entities, if the end positions of all the new candidate shared named entities are not the end positions of the original sentence information, it is determined that the original sentence information does not only include the shared named entity.
在第一方面的一种可能的实现方式中,所述根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果,包括:In a possible implementation of the first aspect, according to the start position and the end position of each of the shared named entities, analyze whether the original sentence information includes only the shared named entity, and obtain the The analysis results include:
定义一长度与所述原始语句信息的长度相同的标志位数组,并将所述标志位数组中的各个标志位的值置为第一预设值;Defining a flag bit array with the same length as the length of the original sentence information, and setting the value of each flag bit in the flag bit array to a first preset value;
将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为第一目标共享命名实体,并将所述第一目标共享命名实体的结束位置对应的标志位的值更新为第二预设值;The shared named entity whose starting position is the first position of the original sentence information is determined as the first target shared named entity, and the value of the flag corresponding to the end position of the first target shared named entity is updated to the first target shared named entity. Two preset values;
将起始位置不是所述原始语句信息的首位置的所述共享命名实体确定为第二目标共享命名实体,并检测各个所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值是否为所述第二预设值;Determine the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity, and detect the mark corresponding to the previous position of the starting position of each second target shared named entity Whether the value of the bit is the second preset value;
若所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值为所述第二预设值,则将所述第二目标共享命名实体的结束位置对应的标志位的值更新为所述第二预设值;If the value of the flag bit corresponding to the previous position of the start position of the second target shared named entity is the second preset value, set the value of the flag bit corresponding to the end position of the second target shared named entity The value is updated to the second preset value;
在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第二预设值,则判定所述原始语句信息中仅包含共享命名实体;After traversing all the shared named entities, if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the second preset value, it is determined that the original sentence information only contains the shared named entity ;
在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第一预设值,则判定所述原始语句信息中不是仅包含共享命名实体。After traversing all the shared named entities, if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the first preset value, it is determined that the original sentence information does not only include the shared name entity.
在第一方面的一种可能的实现方式中,所述根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果,还包括:In a possible implementation of the first aspect, according to the start position and the end position of each of the shared named entities, analyze whether the original sentence information includes only the shared named entity, and obtain the The analysis results include:
若所述共享命名实体中不存在起始位置为所述原始语句信息的首位置的共享命名实体,则判定所述原始语句信息中不是仅包含共享命名实体。If there is no shared named entity whose starting position is the first position of the original sentence information in the shared named entity, it is determined that the original sentence information does not only include the shared named entity.
在第一方面的一种可能的实现方式中,在检测所述原始语句信息对应的目标对话轮次是否是首轮对话之后,还包括:In a possible implementation of the first aspect, after detecting whether the target dialogue round corresponding to the original sentence information is the first round of dialogue, the method further includes:
若所述目标对话轮次不是首轮对话,则获取所述目标对话轮次之前的历史对话轮次中所述用户的历史原始语句信息;If the target dialogue round is not the first round of dialogue, acquiring historical original sentence information of the user in the historical dialogue round before the target dialogue round;
根据所述历史原始语句信息,确定所述原始语句信息对应的目标意图类别。According to the historical original sentence information, the target intention category corresponding to the original sentence information is determined.
第二方面,本申请实施例提供了一种服务器,包括:In the second aspect, an embodiment of the present application provides a server, including:
第一获取单元,用于获取用户的原始语句信息;The first obtaining unit is used to obtain the original sentence information of the user;
第二获取单元,用于将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果;The second obtaining unit is configured to input the original sentence information into a preset shared named entity analysis engine to obtain the analysis result output by the shared named entity analysis engine;
第一检测单元,用于若所述分析结果指示所述原始语句信息中仅包含共享命名实体,则检测所述原始语句信息对应的目标对话轮次是否是首轮对话;The first detecting unit is configured to detect whether the target dialogue round corresponding to the original sentence information is the first round of dialogue if the analysis result indicates that the original sentence information contains only shared named entities;
第一确定单元,用于若所述目标对话轮次是首轮对话,则输出与所述共享命名实体所属的共享命名实体类别对应的意图类别,并确定所述用户在所述意图类别中选择的目标意图类别。The first determining unit is configured to, if the target dialogue round is the first round of dialogue, output an intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine that the user selects among the intent categories The target intent category.
第三方面,本申请实施例提供了一种服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的意图识别方法。In a third aspect, an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The processor executes the computer program when the computer program is executed. The intention recognition method as described in the first aspect above.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的意图识别方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the intention recognition as described in the first aspect is realized. method.
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在服务器上运行时,使得服务器执行上述第一方面中任一项所述的意图识别方法。In a fifth aspect, the embodiments of the present application provide a computer program product, which when the computer program product runs on a server, causes the server to execute the intention recognition method described in any one of the above-mentioned first aspects.
本申请实施例与现有技术相比存在的有益效果是:Compared with the prior art, the embodiments of this application have the following beneficial effects:
本申请实施例提供的一种意图识别方法,在获取到用户的原始语句信息后,不是直接将该原始语句信息输入至传统的意图识别模型中来确定用户所表达的意图类别,而是将该原始语句信息输入至预设的共享命名实体分析引擎中,通过该共享命名实体分析引擎来分析原始语句信息中是否仅包含共享命名实体,在原始语句信息中仅包含共享命名实体,且原始语句信息对应的目标对话轮次是首轮对话时,通过输出与共享命名实体所属的共享命名实体类别对应的意图类别,使用户能够从所述意图类别中选择其所表达的目标意图类别,由于目标意图类别是通过用户的进一步确认得到的,因此能够降低意图识别的错误率,提高意图识别的准确性。In an intention recognition method provided by an embodiment of the present application, after obtaining the original sentence information of the user, the original sentence information is not directly input into the traditional intent recognition model to determine the intention category expressed by the user, but the The original sentence information is input into the preset shared named entity analysis engine, and the shared named entity analysis engine is used to analyze whether the original sentence information contains only the shared named entity, and the original sentence information contains only the shared named entity, and the original sentence information When the corresponding target dialogue round is the first round of dialogue, by outputting the intent category corresponding to the shared named entity category to which the shared named entity belongs, the user can select the expressed target intent category from the intent categories. The category is obtained through further confirmation by the user, so it can reduce the error rate of intent recognition and improve the accuracy of intent recognition.
附图说明Description of the drawings
图1是本申请实施例提供的一种意图识别方法所适用的人机对话系统的示意性架构图;FIG. 1 is a schematic structural diagram of a human-machine dialogue system to which an intention recognition method provided by an embodiment of the present application is applicable;
图2是本申请实施例提供的一种意图识别方法的示意性流程图;FIG. 2 is a schematic flowchart of an intention recognition method provided by an embodiment of the present application;
图3是本申请实施例提供的一种意图识别方法中S22的具体示意性流程图;FIG. 3 is a specific schematic flowchart of S22 in an intention recognition method provided by an embodiment of the present application;
图4是本申请实施例提供的一种意图识别方法中S224的具体示意性流程图;FIG. 4 is a specific schematic flowchart of S224 in an intention recognition method provided by an embodiment of the present application;
图5是本申请另一实施例提供的一种意图识别方法中S224的具体示意性流程图;FIG. 5 is a specific schematic flowchart of S224 in an intention recognition method provided by another embodiment of the present application;
图6是本申请又一实施例提供的一种意图识别方法的示意性流程图;FIG. 6 is a schematic flowchart of an intention recognition method provided by another embodiment of the present application;
图7是本申请实施例提供的一种服务器的结构框图;FIG. 7 is a structural block diagram of a server provided by an embodiment of the present application;
图8是本申请另一实施例提供的一种服务器的结构示意图。FIG. 8 is a schematic structural diagram of a server provided by another embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the existence of the described features, wholes, steps, operations, elements and/or components, but does not exclude one or more other The existence or addition of features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification and appended claims of this application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释 为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the description of this application and the appended claims, the term "if" can be construed as "when" or "once" or "in response to determination" or "in response to detecting ". Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" described in the specification of this application means that one or more embodiments of this application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the sentences "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless it is specifically emphasized otherwise. The terms "including", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
请参阅图1,图1是本申请实施例提供的一种意图识别方法所适用的人机对话系统的示意性架构图。如图1所示,本实施例提供的人机对话系统100包括人机对话终端110和人机对话服务器120。其中,人机对话终端110包括但不限于手机、平板电脑、智能电视、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等移动终端,本申请实施例不对人机对话终端110的具体类型作任何限制。Please refer to FIG. 1. FIG. 1 is a schematic architecture diagram of a human-machine dialogue system to which an intention recognition method provided by an embodiment of the present application is applicable. As shown in FIG. 1, the man-machine dialogue system 100 provided in this embodiment includes a man-machine dialogue terminal 110 and a man-machine dialogue server 120. Among them, the human-machine dialogue terminal 110 includes, but is not limited to, mobile phones, tablet computers, smart TVs, wearable devices, in-vehicle devices, augmented reality (AR)/virtual reality (VR) devices, notebook computers, and ultra mobile devices. For mobile terminals such as ultra-mobile personal computers (UMPC), netbooks, and personal digital assistants (PDAs), the embodiment of the application does not impose any restriction on the specific type of the human-machine dialogue terminal 110.
在本实施例中,当用户与人机对话系统100进行人机对话时,人机对话系统100中的人机对话终端110可以与人机对话服务器120建立无线通信连接或有线通信连接,进而实现人机对话终端110与人机对话服务器120之间的无线通信或有线通信。具体的,在进行人机对话时,人机对话终端110可以通过其语音采集模块采集来自用户的语音数据。人机对话终端110可以将来自用户的语音数据转换为相应的原始语句信息,再将原始语句信息通过无线通信方式或有线通信方式发送至人机对话服务器120;或者,人机对话终端110可以直接将来自用户的语音数据通过无线通信方式或有线通信方式发送至人机对话服务器120,人机对话服务器120将来自用户的语音数据转换为相应的原始语句信息。人机对话服务器120在得到用户的原始语句信息后,识别原始语句信息的目标意图类别,并将目标意图类别通过无线通信方式或有线通信方式反馈给人机对话终端110。In this embodiment, when a user conducts a man-machine dialogue with the man-machine dialogue system 100, the man-machine dialogue terminal 110 in the man-machine dialogue system 100 can establish a wireless communication connection or a wired communication connection with the man-machine dialogue server 120, thereby realizing Wireless communication or wired communication between the man-machine dialogue terminal 110 and the man-machine dialogue server 120. Specifically, during the man-machine dialogue, the man-machine dialogue terminal 110 may collect voice data from the user through its voice collection module. The man-machine dialogue terminal 110 may convert the voice data from the user into corresponding original sentence information, and then send the original sentence information to the man-machine dialogue server 120 through wireless communication or wired communication; or, the man-machine dialogue terminal 110 may directly The voice data from the user is sent to the man-machine dialogue server 120 through wireless communication or wired communication, and the man-machine dialogue server 120 converts the voice data from the user into corresponding original sentence information. After obtaining the user's original sentence information, the human-machine dialogue server 120 recognizes the target intention category of the original sentence information, and feeds back the target intention category to the human-machine dialogue terminal 110 through wireless communication or wired communication.
请参阅图2,图2是本申请实施例提供的一种意图识别方法的示意性流程图,本实施例中,流程的执行主体为服务器,服务器具体可以是人机对话系统中的人机对话服务器。如图2所示,本实施例提供的一种意图识别方法包括S21~S24,详述如下:Please refer to FIG. 2. FIG. 2 is a schematic flowchart of an intention recognition method provided by an embodiment of the present application. In this embodiment, the execution subject of the process is a server, and the server may specifically be a man-machine dialogue in a man-machine dialogue system. server. As shown in FIG. 2, an intention recognition method provided by this embodiment includes S21 to S24, which are described in detail as follows:
S21:获取用户的原始语句信息。S21: Obtain the original sentence information of the user.
在本实施例中,用户的原始语句信息指对人机对话过程中来自用户的语音数据进行音转文处理得到的文本信息。在具体应用中,为了准确识别出人机对话过程中用户想要表达的意图类别,通常需要进行至少一轮人机对话,而每轮人机对话都需要将来自用户的语音数据转换为相应的原始语句信息,并对该轮人机对话过程中的原始语句信息进行意图识别。In this embodiment, the user's original sentence information refers to text information obtained by translating the voice data from the user in the process of man-machine dialogue. In specific applications, in order to accurately identify the type of intent that the user wants to express in the process of man-machine dialogue, it is usually necessary to conduct at least one round of man-machine dialogue, and each round of man-machine dialogue needs to convert the voice data from the user into the corresponding Original sentence information, and intent recognition is performed on the original sentence information in the human-machine dialogue process.
在具体应用中,在进行人机对话时,人机对话系统中的人机对话终端可以通过其语音采集模块采集用户的语音数据。在本实施例一种可能的实现方式中,人机对话终端可以对采集到的用户的语音数据进行音转文处理,得到与用户的语音数据相对应的原始语句信息,并将与用户的语音数据相对应的原始语句信息发送至人机对话系统中的人机对话服务器,人机对话服务器接收人机 对话终端发送的用户的原始语句信息。在本实施例另一种可能的实现方式中,人机对话终端可以将采集到的用户的语音数据直接发送至人机对话服务器,由人机对话服务器对用户的语音数据进行音转文处理,得到与用户的语音数据相对应的原始语句信息。In specific applications, when conducting a human-machine dialogue, the man-machine dialogue terminal in the man-machine dialogue system can collect the user's voice data through its voice collection module. In a possible implementation of this embodiment, the human-machine dialogue terminal can perform voice-to-text processing on the collected user’s voice data to obtain the original sentence information corresponding to the user’s voice data, and combine it with the user’s voice The original sentence information corresponding to the data is sent to the man-machine dialogue server in the man-machine dialogue system, and the man-machine dialogue server receives the user's original sentence information sent by the man-machine dialogue terminal. In another possible implementation of this embodiment, the human-machine dialogue terminal can directly send the collected voice data of the user to the human-machine dialogue server, and the human-machine dialogue server performs audio-to-text processing on the user’s voice data. Obtain the original sentence information corresponding to the user's voice data.
作为示例而非限定,人机对话终端或人机对话服务器可以基于自动语音识别(Automatic Speech Recognition,ASR)技术将来自用户的语音数据转换为相应的原始语句信息。As an example and not a limitation, the human-machine dialogue terminal or the man-machine dialogue server may convert the voice data from the user into corresponding original sentence information based on Automatic Speech Recognition (ASR) technology.
S22:将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果。S22: Input the original sentence information into a preset shared named entity analysis engine, and obtain an analysis result output by the shared named entity analysis engine.
在本实施例中,预设的共享命名实体分析引擎中预先配置有用于分析语句信息中是否仅包含共享命名实体的分析算法,即预设的共享命名实体分析引擎能够分析出语句信息中是否仅包含共享命名实体。In this embodiment, the preset shared named entity analysis engine is pre-configured with an analysis algorithm for analyzing whether the sentence information contains only shared named entities, that is, the preset shared named entity analysis engine can analyze whether the sentence information contains only shared named entities. Contains shared named entities.
需要说明的是,命名实体指以名称为标识的对象,其可以是任一名词所表示的对象。通常,可以将命名实体分划为人名、地名、机构名以及歌曲名等不同类别,每一命名实体类别下通常会包括多个同类别的命名实体,例如,“地名”这一命名实体类别下可以包括北京、上海、广州等多个属于地名的命名实体。It should be noted that a named entity refers to an object identified by a name, and it can be an object represented by any noun. Generally, named entities can be divided into different categories such as person names, place names, organization names, and song names. Each named entity category usually includes multiple named entities of the same category, for example, "place names" under the named entity category It can include multiple named entities belonging to place names, such as Beijing, Shanghai, and Guangzhou.
共享命名实体指可以同时包含在至少两类意图中,被至少两类意图共享的命名实体。示例性的,由于打车意图和导航意图通常都需要获知出发地和/或目的地,而出发点和目的地属于“地名”类命名实体,即“地名”这一类别的命名实体通常会被包含在打车意图和导航意图中,因此,“地名”这一类别的命名实体是共享命名实体。Shared named entities refer to named entities that can be included in at least two types of intents and shared by at least two types of intents. Exemplarily, because taxi intention and navigation intention usually need to know the origin and/or destination, and the origin and destination belong to the named entity of "place name", that is, the named entity of "place name" is usually included in In the taxi intent and navigation intent, therefore, the named entity of the “place name” category is a shared named entity.
在本实施例中,人机对话服务器在获取到用户的原始语句信息后,将用户的原始语句信息输入至预设的共享命名实体分析引擎中,以通过共享命名实体分析引擎分析出原始语句信息中是否仅包含共享命名实体,进而得到共享命名实体分析引擎输出的分析结果。In this embodiment, after obtaining the user's original sentence information, the man-machine dialogue server inputs the user's original sentence information into the preset shared named entity analysis engine to analyze the original sentence information through the shared named entity analysis engine Whether to include only shared named entities in the file, and then get the analysis results output by the shared named entity analysis engine.
在本申请一具体实施例中,共享命名实体分析引擎可以通过如图3所示的S221~S224来分析原始语句信息中是否仅包含共享命名实体,详述如下:In a specific embodiment of the present application, the shared named entity analysis engine can analyze whether the original sentence information contains only shared named entities through S221 to S224 as shown in FIG. 3, as detailed below:
S221:识别所述原始语句信息中包含的命名实体。S221: Identify the named entity contained in the original sentence information.
在本实施例中,人机对话服务器在通过共享命名实体分析引擎分析原始语句中是否仅包含共享命名实体时,需要先识别出原始语句信息中包含的命名实体。In this embodiment, when the man-machine dialogue server analyzes whether the original sentence contains only the shared named entity through the shared named entity analysis engine, it needs to first identify the named entity contained in the original sentence information.
在本实施例一种可能的实现方式中,人机对话服务器可以基于预设的命名实体识别工具对原始语句信息进行命名实体识别(Named Entity Recognition,NER)操作。其中,预设的命名实体识别工具可以识别出原始语句信息中包含的所有命名实体,且能够得到各个命名实体的信息。可以理解的是,原始语句信息中包含的命名实体可以为一个,也可以为至少两个,具体根据实际情况确定,此处不做限制。In a possible implementation of this embodiment, the human-machine dialogue server can perform a named entity recognition (NER) operation on the original sentence information based on a preset named entity recognition tool. Among them, the preset named entity recognition tool can identify all the named entities contained in the original sentence information, and can obtain the information of each named entity. It is understandable that the named entity contained in the original sentence information may be one or at least two, which is specifically determined according to the actual situation, and there is no limitation here.
其中,命名实体的信息可以包括但不限于命名实体所属的命名实体类别以及命名实体在原始语句信息中的起始位置和结束位置。其中,起始位置指命名实体中的第一个字符在原始语句信息中的位置,结束位置指命名实体中的最后一个字符在原始语句信息中的位置,命名实体中的字符在原始语句信息中的位置可以通过该字符在原始语句信息中的次序来标识。示例性的,假设原始语句信息为“打车去北京植物园”,则原始语句信息中从左到右的各个字符在原始语句信息中的次序依次可以为0、1、2、3、4、5、6及7,因此,原始语句信息中从左到右的各个字符的位置可以分别通过0、1、2、3、4、5、6及7来标识。若采用预设的命名实体识别工具对“打车去北京植物园”这一原始语句信息进行命名实体识别操作,则可以识别出该原始语句信息中包含“北 京”、“植物园”及“北京植物园”这三个命名实体,且能够得到“北京”这一命名实体所属的命名实体类别为“地名”,其在原始语句信息的起始位置为3,结束位置为4;“植物园”这一命名实体所属的命名实体类别为“地名”,其在原始语句信息的起始位置为5,结束位置为7;“北京植物园”这一命名实体所属的命名实体类别为“地名”,其在原始语句信息的起始位置为3,结束位置为7。Among them, the information of the named entity may include, but is not limited to, the category of the named entity to which the named entity belongs and the start position and end position of the named entity in the original sentence information. Among them, the start position refers to the position of the first character in the named entity in the original sentence information, the end position refers to the position of the last character in the named entity in the original sentence information, and the characters in the named entity are in the original sentence information. The position of the character can be identified by the order of the character in the original sentence information. Exemplarily, assuming that the original sentence information is "Take a taxi to Beijing Botanical Garden", the order of the characters from left to right in the original sentence information in the original sentence information can be 0, 1, 2, 3, 4, 5. 6 and 7, therefore, the position of each character from left to right in the original sentence information can be identified by 0, 1, 2, 3, 4, 5, 6, and 7, respectively. If the preset named entity recognition tool is used to perform named entity recognition on the original sentence information of "Take a taxi to Beijing Botanical Garden", it can be recognized that the original sentence information contains "Beijing", "Botanical Garden" and "Beijing Botanical Garden". Three named entities, and the named entity category to which the named entity "Beijing" belongs is "place name", the starting position of the original sentence information is 3, and the ending position is 4; the named entity "Botanical Garden" belongs to The named entity category of "Beijing Botanical Garden" is "place name", which has a starting position of 5 and an ending position of 7 in the original sentence information; the named entity category of the named entity of "Beijing Botanical Garden" is "place name", which is in the original sentence information The start position is 3 and the end position is 7.
S222:根据预设的共享命名实体类别列表,识别所述命名实体中的共享命名实体,并确定所述共享命名实体所属的共享命名实体类别。S222: Identify the shared named entity in the named entity according to the preset list of shared named entity categories, and determine the shared named entity category to which the shared named entity belongs.
在识别出原始语句信息中包含的命名实体后,需要进一步识别这些命名实体中是否存在共享命名实体。在本实施例中,人机对话服务器可以根据预设的共享命名实体类别列表,来识别所述命名实体中的共享命名实体。其中,预设的共享命名实体类别列表用于存储预先配置的共享命名实体类别以及各个共享命名实体类别对应的意图类别。After identifying the named entities contained in the original sentence information, it is necessary to further identify whether there are shared named entities among these named entities. In this embodiment, the human-machine dialogue server can identify the shared named entity among the named entities according to a preset list of shared named entity categories. Among them, the preset shared named entity category list is used to store pre-configured shared named entity categories and intent categories corresponding to each shared named entity category.
在本实施例一种可能的实现方式中,预设的共享命名实体类别列表可以根据预设的命名实体类别配置文件得到。具体的,在识别原始语句信息中包含的共享命名实体之前,可以根据人机对话系统所能实现的功能为人机对话系统配置相应的意图类别,其中,不同的功能对应不同的意图类别。示例性的,假设人机对话系统可以实现导航或打车等功能,则用户在与人机对话系统进行对话时,可能会向人机对话系统表达打车或导航等意图,因此,可以为人机对话系统配置打车意图或导航意图等。由于每一类别的意图通常必须包括至少一种类别的命名实体,例如,打车意图和导航意图通常必须包括“地名”这一类别的命名实体,因此,可以根据各个意图类别所需包含的必要信息,为各个意图类别配置相应的命名实体类别,人机对话服务器可以将为每个意图类别配置的命名实体类别存储在预设的命名实体类别配置文件中,即命名实体类别配置文件用于存储预先为各个意图类别配置的命名实体类别,示例性的,请参阅表1,表1示出了命名实体类别配置文件中存储的部分内容,其中,由于命名实体类别2同时被配置在意图A和意图B中,因此,命名实体类别2为共享命名实体类别。In a possible implementation of this embodiment, the preset shared named entity category list may be obtained according to a preset named entity category configuration file. Specifically, before identifying the shared named entity contained in the original sentence information, the human-machine dialogue system can be configured with corresponding intent categories according to the functions that can be realized by the human-machine dialogue system, where different functions correspond to different intent categories. Exemplarily, assuming that the human-machine dialogue system can realize functions such as navigation or taxiing, the user may express the intention of taxiing or navigating to the human-machine dialogue system when communicating with the human-machine dialogue system. Therefore, it can be a human-machine dialogue system. Configure taxi intent or navigation intent, etc. Since the intent of each category must usually include at least one category of named entities, for example, taxi intent and navigation intent must generally include named entities in the category of "place name", so the necessary information can be included in each category of intent. , Configure the corresponding named entity category for each intent category, the man-machine dialogue server can store the named entity category configured for each intent category in the preset named entity category configuration file, that is, the named entity category configuration file is used to store the pre-defined The named entity category configured for each intent category, for example, please refer to Table 1. Table 1 shows part of the content stored in the named entity category configuration file, where named entity category 2 is configured in both the intent A and the intent. In B, therefore, named entity category 2 is a shared named entity category.
表1Table 1
Figure PCTCN2020125213-appb-000001
Figure PCTCN2020125213-appb-000001
人机对话服务器在得到预先配置的命名实体类别配置文件后,可以对命名实体类别配置文件进行共享命名实体检测,即检测命名实体类别配置文件中是否至少有一个命名实体类别被配置在至少两个意图类别中,若检测出至少有一个命名实体类别被配置在至少两个意图类别中,则确定该至少一个命名实体类别为共享命名实体类别,例如,表1中的命名实体类别2被同时配置在意图A和意图B中,因此,表1中的命名实体类别2为共享命名实体类别。人机对话服务器可以将检测出的每一共享命名实体类别与其对应的至少两个意图类别关联存储在预设的共享命名实体类别列表中,即共享命名实体类别列表用于存储各个共享命名实体类别与其相对应的意图类别。示例性的,请参阅表2,表2示出了共享命名实体类别列表中存储的部分内容,其中,共享命名实体类别2对应的意图类别包括意图A和意图B。在具体应用中,人机对话服务器可以将预设的共享命名实体类别列表存储在其存储器中。After the man-machine dialogue server obtains the pre-configured named entity category configuration file, it can perform the shared named entity detection on the named entity category configuration file, that is, check whether there is at least one named entity category configured in at least two of the named entity category configuration files. In the intent category, if it is detected that at least one named entity category is configured in at least two intent categories, it is determined that the at least one named entity category is a shared named entity category. For example, named entity category 2 in Table 1 is configured at the same time In Intent A and Intent B, therefore, named entity category 2 in Table 1 is a shared named entity category. The human-machine dialogue server can associate each detected shared named entity category with its corresponding at least two intent categories and store them in a preset shared named entity category list, that is, the shared named entity category list is used to store each shared named entity category The intent category corresponding to it. Exemplarily, please refer to Table 2. Table 2 shows part of the content stored in the shared named entity category list, where the intention categories corresponding to the shared named entity category 2 include intention A and intention B. In a specific application, the man-machine dialogue server can store a preset list of shared named entity categories in its memory.
表2Table 2
Figure PCTCN2020125213-appb-000002
Figure PCTCN2020125213-appb-000002
在本实施例中,人机对话服务器在识别原始语句信息包含的命名实体中的共享命名实体时,可以从其存储器中获取预设的共享命名实体类别列表,再根据预设的共享命名实体类别列表中包含的共享命名实体类别,识别原始语句信息包含的命名实体中的共享命名实体,并确定各个共享命名实体所属的共享命名实体类别。具体的,若原始语句信息中包含的第一命名实体属于共享命名实体类别列表中的第一共享命名实体类别,则将第一命名实体识别为共享命名实体,且确定该共享命名实体所属的共享命名实体类别为第一共享命名实体类别。需要说明的是,原始语句信息中包含的共享命名实体可以为一个,也可为至少两个。示例性的,假设原始语句信息为“打车去北京植物园”,该原始语句信息中包含的命名实体包括“北京”、“植物园”及“北京植物园”,假设共享命名实体类别列表中包含“地名”这一共享命名实体类别,由于“北京”、“植物园”及“北京植物园”均属于“地名”这一类别的命名实体,因此,人机对话服务器将“北京”、“植物园”及“北京植物园”这三个命名实体均识别为共享命名实体,且确定“北京”、“植物园”及“北京植物园”这三个共享命名实体所属的共享命名实体类别为“地名”。In this embodiment, when the man-machine dialogue server recognizes the shared named entity in the named entity contained in the original sentence information, it can obtain a preset list of shared named entity categories from its memory, and then according to the preset shared named entity category The shared named entity category contained in the list identifies the shared named entity among the named entities contained in the original sentence information, and determines the shared named entity category to which each shared named entity belongs. Specifically, if the first named entity contained in the original sentence information belongs to the first shared named entity category in the list of shared named entity categories, the first named entity is identified as a shared named entity, and the shared named entity to which the shared named entity belongs is determined The named entity category is the first shared named entity category. It should be noted that there may be one or at least two shared named entities included in the original sentence information. Exemplarily, suppose the original sentence information is "Take a taxi to Beijing Botanical Garden", the named entities contained in the original sentence information include "Beijing", "Botanical Garden" and "Beijing Botanical Garden", suppose that the list of shared named entity categories contains "place name" This shared named entity category, because "Beijing", "Botanical Garden" and "Beijing Botanical Garden" are named entities of the "place name" category, therefore, the human-computer dialogue server will be "Beijing", "Botanical Garden" and "Beijing Botanical Garden". "These three named entities are all identified as shared named entities, and the shared named entity category to which the three shared named entities "Beijing", "Botanical Garden" and "Beijing Botanical Garden" belong is "place name".
S223:确定所述共享命名实体在所述原始语句信息中的起始位置和结束位置。S223: Determine the start position and the end position of the shared named entity in the original sentence information.
由于在S221中,通过对原始语句信息进行命名实体识别操作后,已经获得原始语句信息中包含的各个命名实体在原始语句信息中的起始位置和结束位置,因此,本实施例在S222中确定出命名实体中的共享命名实体后,即可以直接得到各个共享命名实体在原始语句信息中的起始位置和结束位置。Since in S221, after the named entity recognition operation is performed on the original sentence information, the start position and end position of each named entity contained in the original sentence information in the original sentence information have been obtained, therefore, this embodiment determines in S222 After the shared named entities in the named entities are extracted, the start position and end position of each shared named entity in the original sentence information can be directly obtained.
S224:根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果。S224: According to the start position and the end position of each of the shared named entities, analyze whether the original sentence information only includes the shared named entity, and obtain the analysis result.
在本实施例中,人机对话服务器在确定出原始语句信息中包含的各个共享命名实体在原始语句信息中的起始位置和结束位置后,可以根据各个共享命名实体在原始语句信息中的起始位置和结束位置,来检测原始语句信息中是否仅包含共享命名实体。In this embodiment, after the man-machine dialogue server determines the start position and end position of each shared named entity contained in the original sentence information in the original sentence information, it can be based on the start position of each shared named entity in the original sentence information. Start position and end position to detect whether only shared named entities are included in the original sentence information.
在本申请一实施例中,S224具体可以通过如图4所示的S2241~S2244实现,详述如下:In an embodiment of the present application, S224 may be specifically implemented through S2241 to S2244 as shown in FIG. 4, which are described in detail as follows:
S2241:将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为候选共享命名实体。S2241: Determine the shared named entity whose starting position is the first position of the original sentence information as a candidate shared named entity.
在本实施例中,人机对话服务器在基于各个共享命名实体在原始语句信息中的起始位置和结束位置来检测原始语句信息中是否仅包含共享命名实体时,可以先检测原始语句信息包含的共享命名实体中是否存在起始位置为原始语句信息的首位置的共享命名实体。其中,原始语句信息的首位置指原始语句信息中的首个字符所在的位置,原始语句信息的末位置指原始语句信息中的最后一个字符所在的位置。示例性的,原始语句信息“打车去北京植物园”的首位置即为第一个字符“打”所在的位置,即原始语句信息“打车去北京植物园”的首位置的标识为0;原始语句信息“打车去北京植物园”的末位置即为最后一个字符“门”所在的位置,即原始语句信息“打车去北京植物园”的末位置的标识为7。In this embodiment, when the man-machine dialogue server detects whether the original sentence information contains only the shared named entity based on the start position and end position of each shared named entity in the original sentence information, it can first detect the content contained in the original sentence information. Whether there is a shared named entity whose starting position is the first position of the original sentence information in the shared named entity. The first position of the original sentence information refers to the position of the first character in the original sentence information, and the end position of the original sentence information refers to the position of the last character in the original sentence information. Exemplarily, the first position of the original sentence information "Taking a taxi to Beijing Botanical Garden" is the position where the first character "打" is located, that is, the identification of the first position of the original sentence information "Taking a taxi to Beijing Botanical Garden" is 0; the original sentence information The last position of "Taking a taxi to Beijing Botanical Garden" is the position where the last character "door" is located, that is, the identification of the last position of the original sentence information "Taking a taxi to Beijing Botanical Garden" is 7.
人机对话服务器在检测到原始语句信息包含的共享命名实体中存在起始位置为原始语句信息的首位置的共享命名实体时,将所有起始位置为原始语句信息的首位置的共享命名实体确定为候 选共享命名实体,并检测各个候选共享命名实体的结束位置是否为原始语句信息的末位置。示例性的,假设原始语句信息为“北京植物园”,由于其包含的共享命名实体“北京”和“北京植物园”在原始语句信息中的起始位置均为原始语句信息的首位置,因此,将共享命名实体“北京”和“北京植物园”均确定为候选共享命名实体。进一步的,人机对话服务器分别检测“北京”和“北京植物园”在原始语句信息中的结束位置是否为原始语句信息的末位置。在该示例中,“北京”在原始语句信息中的结束位置不是原始语句信息的末位置,而“北京植物园”在原始语句信息中的结束位置为原始语句信息的末位置。When the man-machine dialogue server detects that there is a shared named entity whose starting position is the first position of the original sentence information in the shared named entity contained in the original sentence information, it determines all the shared named entities whose starting position is the first position of the original sentence information It is a candidate shared named entity, and detects whether the end position of each candidate shared named entity is the end position of the original sentence information. Exemplarily, assuming that the original sentence information is "Beijing Botanical Garden", since the shared named entities "Beijing" and "Beijing Botanical Garden" contained in the original sentence information are the first positions of the original sentence information, the The shared named entities "Beijing" and "Beijing Botanical Garden" are both identified as candidate shared named entities. Further, the man-machine dialogue server separately detects whether the end positions of "Beijing" and "Beijing Botanical Garden" in the original sentence information are the last positions of the original sentence information. In this example, the end position of "Beijing" in the original sentence information is not the end position of the original sentence information, and the end position of "Beijing Botanic Garden" in the original sentence information is the end position of the original sentence information.
在本实施中,人机对话服务器若检测到有一个候选共享命名实体的结束位置为原始语句信息的末位置,则执行S2242;人机对话服务器若检测到所有候选共享命名实体的结束位置均不是原始语句信息的末位置,则执行S2243~2244。需要说明的是,本实施例中,S2242与S2243~S2244为并列的步骤,即人机对话服务器执行S2242时,不执行S2243~S2244;即人机对话服务器执行S2243~S2244时,不执行S2242。In this implementation, if the man-machine dialogue server detects that the end position of a candidate shared named entity is the end position of the original sentence information, S2242 is executed; if the man-machine dialogue server detects that the end position of all candidate shared named entities is not At the end of the original sentence information, S2243~2244 are executed. It should be noted that in this embodiment, S2242 and S2243 to S2244 are parallel steps, that is, when the man-machine dialogue server executes S2242, S2243 to S2244 are not executed; that is, when the man-machine dialogue server executes S2243 to S2244, S2242 is not executed.
S2242:若有一个所述候选共享命名实体的结束位置为所述原始语句信息的末位置,则判定所述原始语句信息中仅包含共享命名实体。S2242: If the end position of one of the candidate shared named entities is the end position of the original sentence information, it is determined that the original sentence information only includes the shared named entity.
在本实施中,人机对话服务器在检测到有一个候选共享命名实体在原始语句信息中的结束位置为原始语句信息的末位置时,由于该候选共享命名实体在原始语句信息中的起始位置为原始语句信息的首位置,因此说明原始语句信息中的所有字符构成了该候选共享命名实体,即说明原始语句信息中仅包含共享命名实体,而不包含其他的信息,此时,人机对话服务器判定原始语句信息中仅包含共享命名实体。示例性的,结合S2241中的示例,由于候选共享命名实体“北京植物园”在原始语句信息“北京植物园”中的结束位置为原始语句信息的末位置,因此判定原始语句信息“北京植物园”中仅包含共享命名实体。In this implementation, when the man-machine dialogue server detects that the end position of a candidate shared named entity in the original sentence information is the end position of the original sentence information, because the candidate shared named entity is at the start position in the original sentence information It is the first position of the original sentence information, so it means that all the characters in the original sentence information constitute the candidate shared named entity, which means that the original sentence information only contains the shared named entity and does not contain other information. At this time, the man-machine dialogue The server determines that only shared named entities are included in the original sentence information. Exemplarily, in combination with the example in S2241, since the end position of the candidate shared named entity "Beijing Botanical Garden" in the original sentence information "Beijing Botanical Garden" is the end position of the original sentence information, it is determined that only the original sentence information "Beijing Botanical Garden" Contains shared named entities.
S2243:若所有所述候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则循环执行将起始位置为任一所述候选共享命名实体的结束位置的后一位置的所述共享命名实体确定为新的候选共享命名实体,并检测所述新的候选共享命名实体的结束位置是否为所述原始语句信息的末位置的步骤。S2243: If the end positions of all the candidate shared named entities are not the end positions of the original sentence information, execute the cyclically executing the position that sets the start position to the end position of any one of the candidate shared named entities. The step of determining that the shared named entity is a new candidate shared named entity, and detecting whether the end position of the new candidate shared named entity is the end position of the original sentence information.
在本实施例中,人机对话服务器在检测到所有候选共享命名实体的结束位置均不是原始语句信息的末位置时,说明没有一个候选共享命名实体是从原始语句信息的首位置开始至原始语句信息的末位置结束,此时,人机对话服务器针对每一候选共享命名实体,检测原始语句信息中是否存在位于该候选共享命名实体之后,且与该候选共享命名实体相邻的共享命名实体,即检测原始语句信息中是否存在起始位置为任一候选共享命名实体的结束位置的后一位置的共享命名实体。人机对话服务器若检测到原始语句信息中存在至少一个起始位置为任一候选共享命名实体的结束位置的后一位置的共享命名实体,则将该至少一个共享命名实体确定为新的候选共享命名实体。人机对话服务器检测各个新的候选共享命名实体的结束位置是否为原始语句信息的末位置。In this embodiment, when the human-machine dialogue server detects that the end positions of all candidate shared named entities are not the end positions of the original sentence information, it indicates that none of the candidate shared named entities starts from the first position of the original sentence information to the original sentence. The end position of the information ends. At this time, for each candidate shared named entity, the man-machine dialogue server detects whether there is a shared named entity located after the candidate shared named entity and adjacent to the candidate shared named entity in the original sentence information. That is, it is detected whether there is a shared named entity whose starting position is a position after the ending position of any candidate shared named entity in the original sentence information. If the man-machine dialogue server detects that there is at least one shared named entity whose starting position is the end position of any candidate shared named entity in the original sentence information, it will determine the at least one shared named entity as a new candidate shared entity Named entities. The human-machine dialogue server detects whether the end position of each new candidate shared named entity is the end position of the original sentence information.
具体的,人机对话服务器若检测到新的候选共享命名实体中至少有一个候选共享命名实体的结束位置为原始语句信息的末位置,则说明原始语句信息仅由该新的候选共享命名实体以及与该新的候选共享命名实体相邻且位于该新的候选共享命名实体之前的候选共享命名实体构成,即说明原始语句信息中仅包含共享命名实体。示例性的,若原始语句信息为“植物园动物园”,由于共享命名实体“动物园”的起始位置为候选共享命名实体“植物园”的结束位置的后一位置,因此,将共享命名实体“动物园”确定为新的候选共享命名实体,进一步的,由于新的候选共享命 名实体“动物园”的结束位置为原始语句信息的末位置,因此,判定原始语句信息“植物园动物园”仅包含共享命名实体。Specifically, if the human-machine dialogue server detects that the end position of at least one candidate shared named entity among the new candidate shared named entities is the end position of the original sentence information, it means that the original sentence information is only composed of the new candidate shared named entity and The candidate shared named entity that is adjacent to the new candidate shared named entity and is located before the new candidate shared named entity is composed of the candidate shared named entity, which means that the original sentence information only contains the shared named entity. Exemplarily, if the original sentence information is "Botanic Garden Zoo", since the start position of the shared named entity "Zoo" is a position after the end position of the candidate shared named entity "Botanical Garden", the shared named entity "Zoo" will be shared. It is determined as a new candidate shared named entity. Furthermore, since the end position of the new candidate shared named entity "zoo" is the end position of the original sentence information, it is determined that the original sentence information "Botanical Garden Zoo" only contains the shared named entity.
人机对话服务器若检测到所有新的候选共享命名实体的结束位置均不是原始语句信息的末位置,则继续循环,检测原始语句信息中是否存在起始位置为任一候选共享命名实体的结束位置的后一位置的共享命名实体,若存在,则将起始位置为任一候选共享命名实体的结束位置的后一位置的共享命名实体确定为新的候选共享命名实体,以及检测各个新的候选共享命名实体的结束位置是否为原始语句信息的末位置的步骤,直至遍历完原始语句信息中的所有共享命名实体为止,若在遍历完原始语句信息中的所有共享命名实体后,没有一个候选共享命名实体的结束位置是原始语句信息的末位置,则人机对话服务器执行S2244。If the human-machine dialogue server detects that the ending position of all new candidate shared named entities is not the end position of the original sentence information, it will continue to loop to detect whether there is a starting position in the original sentence information that is the end position of any candidate shared named entity If there is a shared named entity in the latter position, the shared named entity whose starting position is the ending position of any candidate shared named entity is determined as a new candidate shared named entity, and each new candidate is detected Whether the end position of the shared named entity is the last position of the original sentence information, until all the shared named entities in the original sentence information are traversed, if after traversing all the shared named entities in the original sentence information, there is no candidate for sharing The end position of the named entity is the end position of the original sentence information, and the man-machine dialogue server executes S2244.
S2244:在遍历完所有所述共享命名实体后,若所有所述新的候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则判定所述原始语句信息中不是仅包含共享命名实体。S2244: After traversing all the shared named entities, if the end positions of all the new candidate shared named entities are not the end positions of the original sentence information, it is determined that the original sentence information does not only include shared names entity.
在本实施中,人机对话服务器在遍历完原始语句信息中的所有共享命名实体后,若检测到没有一个候选共享命名实体的结束位置是原始语句信息的末位置时,说明原始语句信息中除了包含共享命名实体外,还包含其他信息,此时,人机对话服务器判定原始语句信息中不是仅包含共享命名实体。示例性的,假设原始语句信息为“北京植物园怎么去”,则根据S2241可确定共享命名实体“北京”为候选共享命名实体,根据S2243可确定共享命名实体“植物园”为新的候选共享命名实体,且该新的共享命名实体“植物园”的结束位置不是原始语句信息“北京植物园怎么去”的末位置,由于此时已遍历完原始语句信息“北京植物园怎么去”中的所有共享命名实体,且没有一个候选共享命名实体的结束位置是原始语句信息的末位置“北京植物园怎么去”的末位置,因此,判定原始语句信息的末位置“北京植物园怎么去”不是仅包含共享命名实体。In this implementation, after the man-machine dialogue server has traversed all the shared named entities in the original sentence information, if it detects that the end position of none of the candidate shared named entities is the end position of the original sentence information, it means that the original sentence information except In addition to the shared named entity, it also contains other information. At this time, the man-machine dialogue server determines that the original sentence information does not only include the shared named entity. Exemplarily, assuming that the original sentence information is "How to get to Beijing Botanical Garden", the shared named entity "Beijing" can be determined as a candidate shared named entity according to S2241, and the shared named entity "Botanical Garden" can be determined as a new candidate shared named entity according to S2243 , And the end position of the new shared named entity "Botanic Garden" is not the end position of the original sentence information "How to get to Beijing Botanical Garden", because at this time all the shared named entities in the original sentence information "How to get to Beijing Botanical Garden" have been traversed, And the end position of none of the candidate shared named entities is the end position of the original sentence information "How to get to Beijing Botanical Garden", therefore, it is determined that the end position of original sentence information "How to get to Beijing Botanical Garden" does not only include the shared named entity.
在本申请另一实施例中,人机对话服务器若检测到原始语句信息中不存在起始位置为任一候选共享命名实体的结束位置的后一位置的共享命名实体,则说明原始语句信息中不存在与各个候选共享命名实体相邻的共享命名实体,即说明原始语句信息中有至少两个共享命名实体之间存在其他信息,此时,人机对话服务器判定原始语句信息中不是仅包含共享命名实体。示例性的,假设原始语句信息为“植物园到动物园怎么走”,由于候选共享命名实体“植物园”的结束位置的后一位置为“到”所在的位置,而共享命名实体“动物园”的起始位置为“长”所在的位置,因此,原始语句信息“植物园到动物园怎么走”中不存在起始位置为候选共享命名实体“植物园”的结束位置的后一位置的共享命名实体,此时,判定原始语句信息为“植物园到动物园怎么走”中不是仅包含共享命名实体。In another embodiment of the present application, if the human-machine dialogue server detects that there is no shared named entity whose starting position is the end position of any candidate shared named entity in the original sentence information, it indicates that the original sentence information There is no shared named entity adjacent to each candidate shared named entity, which means that there are other information between at least two shared named entities in the original sentence information. At this time, the man-machine dialogue server determines that the original sentence information does not only contain shared Named entities. Exemplarily, suppose the original sentence information is "how to get from the botanical garden to the zoo", since the last position of the end position of the candidate shared named entity "botanic garden" is the position of "to", and the start of the shared named entity "zoo" The location is the location of "Long". Therefore, in the original sentence information "How to get from the Botanical Garden to the Zoo", there is no shared named entity whose starting position is the end position of the candidate shared named entity "Botanical Garden". At this time, It is determined that the original sentence information "How to get from the botanical garden to the zoo" does not only include shared named entities.
在本申请另一实施例中,S224具体还可以通过如图5所示的S2245~S2240实现,详述如下:In another embodiment of the present application, S224 can also be specifically implemented through S2245 to S2240 as shown in FIG. 5, which is described in detail as follows:
S2245:定义一长度与所述原始语句信息的长度相同的标志位数组,并将所述标志位数组中的各个标志位的值置为第一预设值。S2245: Define a flag bit array with the same length as the length of the original sentence information, and set the value of each flag bit in the flag bit array to a first preset value.
在本实施例中,人机对话服务器在检测原始语句信息中是否仅包含共享命名实体时,可以先定义一长度与原始语句信息的长度相同的标志位数组,其中,标志位数组中的各个标志位分别与原始语句信息中的各个字符所在的位置相对应。示例性的,若原始语句信息为“北京植物园”,则可以定义一长度为5的标志位数组,标志位数组中的第一个标志位与原始语句信息“北京植物园”中的首字符“北”所在的位置相对应,标志位数组中的第二个标志位与原始语句信息“北京植物园”中的第二个字符“京”所在的位置相对应。In this embodiment, when the human-machine dialogue server detects whether the original sentence information contains only shared named entities, it can first define a flag bit array with the same length as the length of the original sentence information, where each flag in the flag bit array The bits respectively correspond to the positions of the characters in the original sentence information. Exemplarily, if the original sentence information is "Beijing Botanical Garden", a flag bit array with a length of 5 can be defined. The first flag bit in the flag bit array is the same as the first character "North" in the original sentence information "Beijing Botanical Garden". ”Corresponds to the position, and the second flag bit in the flag bit array corresponds to the position of the second character “京” in the original sentence information “Beijing Botanical Garden”.
在本实施例中,人机对话服务器在定义了标志位数组后,可以先将标志位数组中的各个标志 位的值置为第一预设值。其中,第一预设值可以是布尔逻辑值中的任一值,例如,第一预设值可以是布尔逻辑值中的0,也可以是布尔逻辑值中的1。需要说明的是,本实施例还会涉及到第二预设值,第二预设值也可以是布尔逻辑值中的任一值,但第二预设值不同于第一预设值,当第一预设值为0时,第二预设值为1;当第一预设值为1时,第二预设值为0。In this embodiment, after the man-machine dialogue server defines the flag bit array, it can first set the value of each flag bit in the flag bit array to the first preset value. The first preset value may be any value in the Boolean logic value. For example, the first preset value may be 0 in the Boolean logic value or 1 in the Boolean logic value. It should be noted that this embodiment will also involve a second preset value. The second preset value can also be any value of Boolean logic values, but the second preset value is different from the first preset value. When the first preset value is 0, the second preset value is 1, and when the first preset value is 1, the second preset value is 0.
在本实施例中,人机对话服务器还检测原始语句信息中是否包含起始位置为原始语句信息的首位置的共享命名实体。人机对话服务器若检测到原始语句信息中包含至少一个起始位置为原始语句信息的首位置的共享命名实体,则执行S2246~S2240。In this embodiment, the human-machine dialogue server also detects whether the original sentence information contains a shared named entity whose starting position is the first position of the original sentence information. If the man-machine dialogue server detects that the original sentence information contains at least one shared named entity whose starting position is the first position of the original sentence information, S2246 to S2240 are executed.
S2246:将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为第一目标共享命名实体,并将所述第一目标共享命名实体的结束位置对应的标志位的值更新为第二预设值。S2246: Determine the shared named entity whose start position is the first position of the original sentence information as the first target shared named entity, and update the value of the flag bit corresponding to the end position of the first target shared named entity Is the second preset value.
在本实施例中,人机对话服务器若检测到原始语句信息中包含至少一个起始位置为原始语句信息的首位置的共享命名实体,则将所有起始位置为原始语句信息的首位置的共享命名实体确定为第一目标共享命名实体,并将所有第一目标共享命名实体的结束位置对应的标志位的值更新为第二预设值。示例性的,假设原始语句信息为“北京植物园怎么走”,由于共享命名实体“北京”和“北京植物园”的起始位置为原始语句信息的首位置,因此,将共享命名实体“北京”和“北京植物园”均确定为第一目标共享命名实体,且将“北京”的结束位置(即“京”所在位置)对应的标志位的值更新为第二预设值,将“北京植物园”的结束位置(即“门”所在位置)对应的标志位的值更新为第二预设值。In this embodiment, if the man-machine dialogue server detects that the original sentence information contains at least one shared named entity whose starting position is the first position of the original sentence information, it will share all starting positions as the first position of the original sentence information. The named entity is determined to be the first target shared named entity, and the values of the flag bits corresponding to the end positions of all the first target shared named entities are updated to the second preset value. Exemplarily, assuming that the original sentence information is "How to get to Beijing Botanical Garden", since the starting positions of the shared named entities "Beijing" and "Beijing Botanical Garden" are the first positions of the original sentence information, the named entities "Beijing" and "Beijing Botanic Garden" is determined as the first target shared named entity, and the value of the flag corresponding to the end position of "Beijing" (ie the position of "京") is updated to the second preset value, and the value of "Beijing Botanic Garden" The value of the flag bit corresponding to the end position (that is, the position of the "door") is updated to the second preset value.
S2247:将起始位置不是所述原始语句信息的首位置的所述共享命名实体确定为第二目标共享命名实体,并检测各个所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值是否为所述第二预设值。S2247: Determine the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity, and detect that each of the second target shared named entities corresponds to the previous position of the starting position Whether the value of the flag bit is the second preset value.
S2248:若所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值为所述第二预设值,则将所述第二目标共享命名实体的结束位置对应的标志位的值更新为所述第二预设值。S2248: If the value of the flag bit corresponding to the previous position of the start position of the second target shared named entity is the second preset value, set the flag corresponding to the end position of the second target shared named entity The value of the bit is updated to the second preset value.
在本实施例中,人机对话服务器还将起始位置不是原始语句信息的首位置的共享命名实体确定为第二目标共享命名实体。示例性的,结合S2246中的示例,由于原始语句信息“北京植物园怎么走”中的共享命名实体“植物园”的起始位置不是原始语句信息的首位置,因此,将共享命名实体“植物园”确定为第二目标共享命名实体。In this embodiment, the human-machine dialogue server also determines the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity. Exemplarily, in combination with the example in S2246, since the starting position of the shared named entity "Botanical Garden" in the original sentence information "How to get to Beijing Botanical Garden" is not the first position of the original sentence information, the shared named entity "Botanical Garden" is determined Share a named entity for the second target.
人机对话服务器确定出第二目标共享命名实体后,检测各个第二目标共享命名实体的起始位置的前一位置对应的标志位的值是否为第二预设值。人机对话服务器若检测到某第二目标共享命名实体的起始位置的前一位置对应的标志位的值为第二预设值,则说明该第二目标共享命名实体的起始位置的前一位置为某第一目标共享命名实体的结束位置,即说明该第二目标共享命名实体与原始语句信息中的某第一目标共享命名实体相邻,此时,人机对话服务器将该第二目标共享命名实体的结束位置对应的标志位的值更新为第二预设值。After determining the second target shared named entity, the man-machine dialogue server detects whether the value of the flag bit corresponding to the previous position of the starting position of each second target shared named entity is the second preset value. If the human-machine dialogue server detects that the value of the flag corresponding to the first position of the second target shared named entity is the second preset value, it indicates that the second target shared named entity is before the start position of the shared named entity. A position is the end position of a first target shared named entity, which means that the second target shared named entity is adjacent to a first target shared named entity in the original sentence information. The value of the flag bit corresponding to the end position of the target shared named entity is updated to the second preset value.
在本实施例中,人机对话服务器遍历完所有的第二目标共享命名实体后,检测原始语句信息的末位置对应的标志位在更新后的值是否为第二预设值。人机对话服务器若检测到原始语句信息的末位置对应的标志位在更新后的值为第二预设值,则执行S2249;人机对话服务器若检测到原始语句信息的末位置对应的标志位在更新后的值为第一预设值,则执行S2240。In this embodiment, after the man-machine dialogue server has traversed all the second target shared named entities, it detects whether the updated value of the flag bit corresponding to the end position of the original sentence information is the second preset value. If the man-machine dialogue server detects that the flag bit corresponding to the end position of the original sentence information is updated to the second preset value, execute S2249; if the man-machine dialogue server detects the flag bit corresponding to the end position of the original sentence information After the updated value is the first preset value, S2240 is executed.
在本申请另一实施例中,人机对话服务器若检测到某第二目标共享命名实体的起始位置的前一位置对应的标志位的值为第一预设值,则说明该第二目标共享命名实体没有与原始语句信息中的任一第一目标共享命名实体相邻,此时,人机对话服务器不对该第二目标共享命名实体的结束 位置对应的标志位的值进行更新。In another embodiment of the present application, if the human-machine dialogue server detects that the value of the flag corresponding to the previous position of the start position of a second target shared named entity is the first preset value, it indicates that the second target The shared named entity is not adjacent to any first target shared named entity in the original sentence information. At this time, the man-machine dialogue server does not update the value of the flag bit corresponding to the end position of the second target shared named entity.
S2249:在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第二预设值,则判定所述原始语句信息中仅包含共享命名实体。S2249: After traversing all the shared named entities, if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the second preset value, then it is determined that the original sentence information only contains shared Named entities.
在本实施例中,人机对话服务器在遍历完所有共享命名实体后,若检测到原始语句信息的末位置对应的标志位在更新后的值为第二预设值,则说明从原始语句信息的首位置开始到原始语句信息的末位置结束,是由至少一个共享命名实体首尾相邻构成的,即原始语句信息中不包含除了共享命名实体之外的其他信息,此时,人机对话服务器判定原始语句信息中仅包含共享命名实体。In this embodiment, after the human-machine dialogue server has traversed all shared named entities, if it detects that the updated value of the flag bit corresponding to the end position of the original sentence information is the second preset value, it indicates that the original sentence information From the first position to the end of the original sentence information, is composed of at least one shared named entity that is adjacent to the end, that is, the original sentence information does not contain other information except the shared named entity. At this time, the man-machine dialogue server It is determined that only shared named entities are included in the original sentence information.
S2240:在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第一预设值,则判定所述原始语句信息中不是仅包含共享命名实体。S2240: After traversing all the shared named entities, if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the first preset value, it is determined that the original sentence information does not only contain Shared named entities.
在本实施例中,人机对话服务器在遍历完所有共享命名实体后,若检测到原始语句信息的末位置对应的标志位在更新后的值为第一预设值,则说明从原始语句信息的首位置开始到原始语句信息的末位置结束,并不是由至少一个共享命名实体首尾相邻构成的,即原始语句信息中除了包含共享命名实体外,还包含其他信息,此时,人机对话服务器判定原始语句信息中不是仅包含共享命名实体。In this embodiment, after the human-machine dialogue server has traversed all the shared named entities, if it detects that the updated value of the flag bit corresponding to the end position of the original sentence information is the first preset value, it indicates that the original sentence information From the first position of the original sentence to the end of the original sentence information, it is not composed of at least one shared named entity that is adjacent to the end. That is, in addition to the shared named entity, the original sentence information also contains other information. At this time, the man-machine dialogue The server determines that the original sentence information does not include only shared named entities.
在本实施例另一种可能的实现方式中,S224还可以包括以下步骤:In another possible implementation manner of this embodiment, S224 may further include the following steps:
若所述共享命名实体中不存在起始位置为所述原始语句信息的首位置的共享命名实体,则判定所述原始语句信息中不是仅包含共享命名实体。If there is no shared named entity whose starting position is the first position of the original sentence information in the shared named entity, it is determined that the original sentence information does not only include the shared named entity.
本实施例中,人机对话服务器在检测到原始语句信息包含的共享命名实体中不存在起始位置为原始语句信息的首位置的共享命名实体时,说明原始语句信息中的第一个字符未包含在共享命名实体中,即说明原始语句信息中还包含除了共享命名实体之外的其他信息,此时,人机对话服务器判定原始语句信息中不是仅包含共享命名实体。In this embodiment, when the human-machine dialogue server detects that there is no shared named entity whose starting position is the first position of the original sentence information in the shared named entity contained in the original sentence information, it indicates that the first character in the original sentence information is not Included in the shared named entity means that the original sentence information also contains other information besides the shared named entity. At this time, the man-machine dialogue server determines that the original sentence information does not only include the shared named entity.
S23:若所述分析结果指示所述原始语句信息中仅包含共享命名实体,则检测所述原始语句信息对应的目标对话轮次是否是首轮对话。S23: If the analysis result indicates that the original sentence information only includes a shared named entity, detect whether the target dialogue round corresponding to the original sentence information is the first round of dialogue.
通常,当首轮人机对话过程中的原始语句信息中仅包含共享命名实体时,由于没有更多的参考信息,因此难以准确识别出用户的真正意图类别,此时需要进行更多轮的人机对话来获取更多的参考信息再进一步识别用户的真正意图。而当非首轮人机对话过程中的原始语句信息中仅包含共享命名实体时,通常可以参考其他轮人机对话中已获得的信息来识别出用户的真正意图类别,从而无需再进行更多轮次的人机对话。基于此,在具体应用中,人机对话终端每次将每轮人机对话过程中来自用户的语音数据转换为相应的原始语句信息后,还记录每轮人机对话过程中的原始语句信息对应的对话轮次,其中,对话轮次包括首轮对话和非首轮对话,即除了首轮对话之外的其他轮对话均为非首轮对话。Generally, when the original sentence information in the first round of human-machine dialogue only contains shared named entities, because there is no more reference information, it is difficult to accurately identify the user’s true intention category. At this time, more rounds of people are needed. Machine dialogue to obtain more reference information and further identify the real intention of the user. When the original sentence information in the non-first round of human-machine dialogue only contains shared named entities, it is usually possible to refer to the information obtained in other rounds of human-machine dialogue to identify the user’s true intention category, so there is no need to do more Rounds of man-machine dialogue. Based on this, in specific applications, after each human-machine dialogue terminal converts the voice data from the user during each round of human-machine dialogue into corresponding original sentence information, it also records the corresponding original sentence information in each round of human-machine dialogue. Dialogue rounds, among them, the dialogue round includes the first round of dialogue and non-first round of dialogue, that is, all other rounds of dialogue except the first round of dialogue are non-first round of dialogues.
在本实施中,当共享命名实体分析引擎输出的分析结果指示原始语句信息中仅包含共享命名实体时,人机对话服务器还进一步检测该原始语句信息对应的目标对话轮次是否是首轮对话。人机对话服务器若检测到原始语句信息对应的目标对话轮次是首轮对话,则S24。In this implementation, when the analysis result output by the shared named entity analysis engine indicates that the original sentence information only contains the shared named entity, the man-machine dialogue server further detects whether the target dialogue round corresponding to the original sentence information is the first round of dialogue. If the human-machine dialogue server detects that the target dialogue round corresponding to the original sentence information is the first round of dialogue, S24 is performed.
S24:若所述目标对话轮次是首轮对话,则输出与所述共享命名实体所属的共享命名实体类别对应的意图类别,并确定所述用户在所述意图类别中选择的目标意图类别。S24: If the target dialogue round is the first round of dialogue, output the intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine the target intent category selected by the user in the intent category.
在本实施例中,人机对话服务器在检测到原始语句信息中仅包含共享命名实体,且原始语句信息对应的目标对话轮次是首轮对话时,可以基于原始语句信息包含的各个共享命名实体所属的共享命名实体类别,从共享命名实体类别列表中获取与各个共享命名实体所属的共享命名实体类 别对应的意图类别。人机对话服务器在获取到与原始语句信息中包含的各个共享命名实体所属的共享命名实体类别对应的意图类别后,输出这些意图类别,以使用户在这些意图类别中选择其想要表达的目标意图类别。In this embodiment, when the man-machine dialogue server detects that the original sentence information contains only shared named entities, and the target dialogue round corresponding to the original sentence information is the first round of dialogue, it can be based on each shared named entity contained in the original sentence information The category of shared named entity to which it belongs, the intent category corresponding to the category of shared named entity to which each shared named entity belongs is obtained from the list of shared named entity categories. After the human-machine dialogue server obtains the intent categories corresponding to the shared named entity category to which each shared named entity contained in the original sentence information belongs, it outputs these intent categories so that the user can select the target they want to express from these intent categories Intent category.
具体的,人机对话服务器可以将与原始语句信息中包含的各个共享命名实体所属的共享命名实体类别对应的意图类别发送至人机对话终端,人机对话终端可以基于这些意图类别生成并输出相应的语音询问信息,以询问用户在这些意图类别中选择的目标意图类别,人机对话终端将用户在这些意图类别中选择的目标意图类别发送至人机对话服务器,人机对话服务器即获取到用户在这些意图类别中选择的目标意图类别。Specifically, the man-machine dialogue server may send the intent category corresponding to the shared named entity category to which each shared named entity contained in the original sentence information belongs to the man-machine dialogue terminal, and the man-machine dialogue terminal may generate and output corresponding intent categories based on these intent categories. To ask the user for the target intent category selected in these intent categories. The man-machine dialogue terminal sends the target intent category selected by the user in these intent categories to the man-machine dialogue server, and the man-machine dialogue server obtains the user The target intent category selected among these intent categories.
在本申请一实施例中,人机对话服务器确定出目标意图类别后,还可以进一步获取原始语句信息对应的槽位信息,进而根据目标意图类别、原始语句信息以及原始语句信息对应的槽位信息,确定出明确的用户指令。其中,槽位信息指原始语句信息中包含的共享命名实体在目标意图类别下所属的必要信息类型。示例性的,假设目标意图类别为“打车”,而“打车”这一意图类别通常需要包含“出发地”和“目的地”这两类的必要信息,假设原始语句信息中包含的共享命名实体为“北京植物园”,且“北京植物园”在“打车”这一目标意图类别下所属的必要信息类型为目的地,则该原始语句信息对应的槽位信息即为目的地,基于此,人机对话服务器基于目标意图类别“打车”、原始语句信息“北京植物园”以及原始语句信息对应的槽位信息“目的地”,确定出的明确的用户指令可以是“打车去北京植物园”。In an embodiment of the present application, after the human-machine dialogue server determines the target intent category, it can further obtain the slot information corresponding to the original sentence information, and then according to the target intent category, the original sentence information, and the slot information corresponding to the original sentence information , To determine clear user instructions. Among them, the slot information refers to the necessary information type to which the shared named entity contained in the original sentence information belongs under the target intention category. Exemplarily, suppose that the target intention category is "hailing a taxi", and the intention category "hailing a taxi" usually needs to include two types of necessary information: "departure" and "destination". Assume that the shared named entity contained in the original sentence information Is "Beijing Botanical Garden", and the necessary information type of "Beijing Botanical Garden" under the target intention category of "Taxi" is the destination, then the slot information corresponding to the original sentence information is the destination. Based on this, the man-machine Based on the target intent category "Taxi", the original sentence information "Beijing Botanical Garden", and the slot information "Destination" corresponding to the original sentence information, the dialogue server determines a clear user instruction that may be "Take a taxi to Beijing Botanical Garden".
在本实施例一种可能的实现方式中,人机对话系统中的人机对话终端可以通过询问用户的方式来获取原始语句信息中包含的共享命名实体在目标意图类别下所属的必要信息类型,进而得到原始语句信息对应的槽位信息,人机对话终端可以将原始语句信息对应的槽位信息发送至人机对话服务器。In a possible implementation of this embodiment, the human-machine dialogue terminal in the human-machine dialogue system can obtain the necessary information type of the shared named entity contained in the original sentence information under the target intention category by asking the user. Then the slot information corresponding to the original sentence information is obtained, and the man-machine dialogue terminal can send the slot information corresponding to the original sentence information to the man-machine dialogue server.
在本实施例另一种可能的实现方式中,当原始语句信息中包含的共享命名实体所属的共享命名实体类别为“地名”时,人机对话系统中的人机对话终端可以在采集原始语句信息对应的语音数据时,获取其当前所处位置的地理位置信息,并将其当前所处位置的地理位置信息发送至人机对话服务器,人机对话服务器可以根据人机对话终端当前所处位置的地理位置信息以及原始语句信息中包含的共享命名实体对应的地理位置信息,来确定原始语句信息对应的槽位信息。具体的,当人机对话终端当前所处位置的地理位置信息与原始语句信息中包含的共享命名实体对应的地理位置信息相匹配时,确定原始语句信息对应的槽位信息为出发地;当人机对话终端当前所处位置的地理位置信息与原始语句信息中包含的共享命名实体对应的地理位置信息不匹配时,确定原始语句信息对应的槽位信息为目的地。需要说明的是,人机对话终端当前所处位置的地理位置信息与原始语句信息中包含的共享命名实体对应的地理位置信息相匹配具体指,人机对话终端当前所处的地理位置与原始语句信息中包含的共享命名实体对应的地理位置之间的位置偏差在预设范围内;人机对话终端当前所处位置的地理位置信息与原始语句信息中包含的共享命名实体对应的地理位置信息不匹配具体指,人机对话终端当前所处的地理位置与原始语句信息中包含的共享命名实体对应的地理位置之间的位置偏差不在预设范围内。In another possible implementation of this embodiment, when the shared named entity category to which the shared named entity contained in the original sentence information belongs is "place name", the man-machine dialogue terminal in the man-machine dialogue system can collect the original sentence When the voice data corresponds to the information, the geographic location information of its current location is obtained, and the geographic location information of its current location is sent to the man-machine dialogue server. The man-machine dialogue server can be based on the current location of the man-machine dialogue terminal The geographic location information and the geographic location information corresponding to the shared named entity contained in the original sentence information are used to determine the slot information corresponding to the original sentence information. Specifically, when the geographic location information of the current location of the human-machine dialogue terminal matches the geographic location information corresponding to the shared named entity contained in the original sentence information, the slot information corresponding to the original sentence information is determined as the starting place; When the geographic location information of the current location of the machine dialogue terminal does not match the geographic location information corresponding to the shared named entity contained in the original sentence information, the slot information corresponding to the original sentence information is determined as the destination. It should be noted that the geographic location information of the current location of the human-machine dialogue terminal matches the geographic location information corresponding to the shared named entity contained in the original sentence information. Specifically, the current geographic location of the human-machine dialogue terminal matches the original sentence. The location deviation between the geographic locations corresponding to the shared named entities contained in the information is within a preset range; the geographic location information of the current location of the human-machine dialogue terminal is different from the geographic location information corresponding to the shared named entities contained in the original sentence information. The matching specifically refers to that the position deviation between the current geographic location of the human-machine dialogue terminal and the geographic location corresponding to the shared named entity included in the original sentence information is not within a preset range.
以上可以看出,本申请实施例提供的一种意图识别方法,在获取到用户的原始语句信息后,不是直接将该原始语句信息输入至传统的意图识别模型中来确定用户所表达的意图类别,而是将该原始语句信息输入至预设的共享命名实体分析引擎中,通过该共享命名实体分析引擎来分析原始语句信息中是否仅包含共享命名实体,在原始语句信息中仅包含共享命名实体,且原始语句信 息对应的目标对话轮次是首轮对话时,通过输出与共享命名实体所属的共享命名实体类别对应的意图类别,使用户能够从所述意图类别中选择其所表达的目标意图类别,由于目标意图类别是通过用户的进一步确认得到的,因此能够降低意图识别的错误率,提高意图识别的准确性。It can be seen from the above that the intention recognition method provided by the embodiments of the present application does not directly input the original sentence information of the user into the traditional intention recognition model to determine the intention category expressed by the user after obtaining the original sentence information of the user. , But input the original sentence information into the preset shared named entity analysis engine, through the shared named entity analysis engine to analyze whether the original sentence information contains only shared named entities, and the original sentence information contains only shared named entities , And when the target dialogue round corresponding to the original sentence information is the first round of dialogue, by outputting the intent category corresponding to the shared named entity category to which the shared named entity belongs, the user can select the expressed target intention from the intent category Category, since the target intention category is obtained through further confirmation by the user, it can reduce the error rate of intention recognition and improve the accuracy of intention recognition.
请参阅图6,图6是本申请又一实施例提供的一种意图识别方法的示意性流程图。如图6所示,相对于图3至图5对应的各实施例,本实施例提供的一种意图识别方法在S23之后,还可以包括S25~S26,详述如下:Please refer to FIG. 6, which is a schematic flowchart of an intention recognition method according to another embodiment of the present application. As shown in FIG. 6, with respect to the embodiments corresponding to FIGS. 3 to 5, an intention recognition method provided in this embodiment may further include S25 to S26 after S23, which is described in detail as follows:
S25:若所述目标对话轮次不是首轮对话,则获取所述目标对话轮次之前的历史对话轮次中所述用户的历史原始语句信息。S25: If the target dialogue round is not the first round of dialogue, obtain historical original sentence information of the user in the historical dialogue round before the target dialogue round.
S26:根据所述历史原始语句信息,确定所述原始语句信息对应的目标意图类别。S26: Determine the target intention category corresponding to the original sentence information according to the historical original sentence information.
在本实施例中,当原始语句信息对应的目标对话轮次为非首轮对话时,由于目标对话轮次之前的历史对话轮次中的用户的历史原始语句信息中可能会包含能够表达用户意图的必要信息,例如包含原始语句信息所表达的目标意图类别,因此,人机对话服务器在检测到原始语句信息中仅包含共享命名实体,且原始语句信息对应的目标对话轮次为非首轮对话时,获取目标对话轮次之前的历史对话轮次中的用户的历史原始语句信息,并基于历史原始语句信确定原始语句信息所表达的目标意图类别。In this embodiment, when the target dialogue round corresponding to the original sentence information is not the first round of dialogue, because the user’s historical original sentence information in the historical dialogue round before the target dialogue round may contain information that can express the user’s intentions The necessary information for, for example, includes the target intention category expressed by the original sentence information. Therefore, the man-machine dialogue server detects that the original sentence information contains only the shared named entity, and the target dialogue round corresponding to the original sentence information is not the first round of dialogue At the time, the historical original sentence information of the user in the historical dialogue round before the target dialogue round is obtained, and the target intention category expressed by the original sentence information is determined based on the historical original sentence information.
在本申请一实施例中,人机对话服务器确定出目标意图类别后,还可以进一步获取原始语句信息对应的槽位信息,进而根据目标意图类别、原始语句信息以及原始语句信息对应的槽位信息,确定出明确的用户指令。需要说明的是,本实施例中,人机对话服务器根据目标意图类别、原始语句信息以及原始语句信息对应的槽位信息,确定明确的用户指令的具体方式可以参照S24中的相关描述,此处不再赘述。In an embodiment of the present application, after the human-machine dialogue server determines the target intent category, it can further obtain the slot information corresponding to the original sentence information, and then according to the target intent category, the original sentence information, and the slot information corresponding to the original sentence information , To determine clear user instructions. It should be noted that, in this embodiment, the man-machine dialogue server determines the specific way of definite user instructions according to the target intent category, original sentence information, and slot information corresponding to the original sentence information. You can refer to the relevant description in S24 here. No longer.
示例性的,假设第一轮人机对话过程中的原始语句信息为“我要打车”,第二轮人机对话过程中的原始语句信息为“北京植物园”,由于第二轮人机对话过程中的原始语句信息中仅包含共享命名实体,则可以根据第一轮对话过程中的原始语句信息“我要打车”确定原始语句信息“北京植物园”所表达的目标意图类别为打车意图。进一步的,假设通过询问用户的方式获取到原始语句信息“北京植物园”的槽位信息为“目的地”,则可以进一步确定出明确的用户指令为“打车去北京植物园”。For example, suppose that the original sentence information in the first round of human-machine dialogue is "I want to take a taxi", and the original sentence information in the second round of human-computer dialogue is "Beijing Botanical Garden". The original sentence information in only contains the shared named entity, and the target intention category expressed by the original sentence information "Beijing Botanical Garden" can be determined as the taxi intention based on the original sentence information "I want to take a taxi" in the first round of dialogue. Further, assuming that the slot information of the original sentence information "Beijing Botanical Garden" obtained by asking the user is "destination", it can be further determined that the clear user instruction is "Take a taxi to Beijing Botanical Garden".
以上可以看出,本实施例提供的一种意图识别方法,当原始语句信息中仅包含共享命名实体,但原始语句信息对应的目标对话轮次为非首轮对话时,由于目标对话轮次之前的历史对话轮次中的历史原始语句信息中可能会包含能够表达用户意图的必要信息,例如包含原始语句信息所表达的目标意图类别,因此,直接通过目标轮次之前的历史对话轮次中的历史原始语句信息来确定原始语句信息所表达的目标意图类别,而无需再通过用户意图识别模型来确定用户的目标意图类别,从而能提高用户意图识别的效率。As can be seen from the above, in the intention recognition method provided by this embodiment, when the original sentence information only contains the shared named entity, but the target dialogue round corresponding to the original sentence information is not the first round of dialogue, because the target dialogue round is before The historical original sentence information in the historical dialogue round may contain necessary information that can express the user’s intentions, such as the target intention category expressed by the original sentence information. Therefore, directly pass the historical dialogue round before the target round The historical original sentence information determines the target intention category expressed by the original sentence information, without the need to determine the user's target intention category through the user intention recognition model, thereby improving the efficiency of user intention recognition.
在本申请另一实施例中,人机对话服务器若检测到原始语句信息中不是仅包含共享命名实体,则可以执行以下步骤:In another embodiment of the present application, if the human-machine dialogue server detects that the original sentence information does not only include the shared named entity, it can perform the following steps:
若所述原始语句信息中不是仅包含共享命名实体,则将所述原始语句信息输入至预设的意图识别模型中,获得所述原始语句信息所表达的目标意图类别。If the original sentence information does not only include a shared named entity, the original sentence information is input into a preset intention recognition model to obtain the target intention category expressed by the original sentence information.
在本实施例中,当原始语句信息中不是仅包含共享命名实体,即原始语句信息中除了包含共享命名实体还包含其他的信息时,人机对话服务器可以将原始语句信息直接输入至预设的意图识别模型中,进而得到原始语句信息所表达的目标意图类别。需要说明的是,本实施例中的用户意 图识别模型可以是基于神经网络的意图识别模型,也可以是基于统计学的意图识别模型,或者还可以是其他类别的意图识别模型,具体可以根据实际需求设置。用户意图识别模型在输入端接收到原始语句信息对应的特征向量时,可以输出原始语句信息所表达的目标意图类别。In this embodiment, when the original sentence information does not only contain the shared named entity, that is, when the original sentence information contains other information in addition to the shared named entity, the man-machine dialogue server can directly input the original sentence information into the preset In the intention recognition model, the target intention category expressed by the original sentence information is obtained. It should be noted that the user intent recognition model in this embodiment may be an intent recognition model based on neural networks, or an intent recognition model based on statistics, or may also be an intent recognition model of other types, which may be based on actual conditions. Demand settings. When the user intention recognition model receives the feature vector corresponding to the original sentence information at the input terminal, it can output the target intention category expressed by the original sentence information.
在本申请一实施例中,人机对话服务器在确定出原始语句信息所表达的目标意图类别后,可以基于目标意图类别所需包含的必要信息,获取目标意图类别对应的槽位信息,并基于目标意图类别以及目标意图类别对应的槽位信息,得到明确的用户指令。In an embodiment of the present application, after determining the target intent category expressed by the original sentence information, the human-machine dialogue server can obtain the slot information corresponding to the target intent category based on the necessary information that the target intent category needs to include, and based on The target intent category and the slot information corresponding to the target intent category are given clear user instructions.
以上可以看出,本实施例提供的一种意图识别方法,在原始语句信息中不是仅包含共享命名实体时,才通过用户意图识别模型来确定原始语句信息所表达的目标意图类,从而能够提高用户意图识别的准确性。It can be seen from the above that the intent recognition method provided by this embodiment uses the user intent recognition model to determine the target intent class expressed by the original sentence information when the original sentence information does not only include a shared named entity, thereby improving The accuracy of user intent recognition.
可以理解的是,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It can be understood that the size of the sequence number of each step in the above embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any implementation process of the embodiments of this application. limited.
对应于上述实施例所述的意图识别方法,图7示出了本申请实施例提供的一种服务器的结构框图,该服务器具体可以是人机对话系统中的人机对话服务器,该服务器包括的各单元用于执行上述实施例中的各步骤,具体请参阅上述实施例中的相关描述,为了便于说明,仅示出了与本申请实施例相关的部分。请参阅图7,该服务器70包括第一获取单元71、第二获取单元72、第一检测单元73及第一确定单元74。其中:Corresponding to the intention recognition method described in the foregoing embodiment, FIG. 7 shows a structural block diagram of a server provided by an embodiment of the present application. The server may specifically be a human-machine dialogue server in a human-machine dialogue system. The server includes Each unit is used to execute each step in the foregoing embodiment. For details, please refer to the relevant description in the foregoing embodiment. For ease of description, only the parts related to the embodiment of the present application are shown. Please refer to FIG. 7, the server 70 includes a first acquiring unit 71, a second acquiring unit 72, a first detecting unit 73, and a first determining unit 74. among them:
第一获取单元71用于获取用户的原始语句信息。The first obtaining unit 71 is used to obtain the user's original sentence information.
第二获取单元72用于将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果。The second obtaining unit 72 is configured to input the original sentence information into a preset shared named entity analysis engine to obtain an analysis result output by the shared named entity analysis engine.
第一检测单元73用于若所述分析结果指示所述原始语句信息中仅包含共享命名实体,则检测所述原始语句信息对应的目标对话轮次是否是首轮对话。The first detection unit 73 is configured to detect whether the target dialogue round corresponding to the original sentence information is the first round of dialogue if the analysis result indicates that the original sentence information only includes a shared named entity.
第一确定单元74用于若所述目标对话轮次是首轮对话,则输出与所述共享命名实体所属的共享命名实体类别对应的意图类别,并确定所述用户在所述意图类别中选择的目标意图类别。The first determining unit 74 is configured to, if the target dialogue round is the first round of dialogue, output an intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine that the user selects among the intent categories The target intent category.
在本实施例一种可能的实现方式中,第二获取单元72具体包括命名实体识别单元、共享命名实体识别单元、位置确定单元及分析单元。其中:In a possible implementation of this embodiment, the second acquisition unit 72 specifically includes a named entity recognition unit, a shared named entity recognition unit, a location determination unit, and an analysis unit. among them:
命名实体识别单元用于识别所述原始语句信息中包含的命名实体。The named entity recognition unit is used to recognize the named entity contained in the original sentence information.
共享命名实体识别单元用于根据预设的共享命名实体类别列表,识别所述命名实体中的共享命名实体,并确定所述共享命名实体所属的共享命名实体类别The shared named entity identification unit is used to identify the shared named entity in the named entity according to a preset list of shared named entity categories, and determine the shared named entity category to which the shared named entity belongs
位置确定单元用于确定所述共享命名实体在所述原始语句信息中的起始位置和结束位置。The position determining unit is used to determine the start position and the end position of the shared named entity in the original sentence information.
分析单元用于根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果。The analysis unit is used to analyze whether the original sentence information contains only the shared named entity according to the start position and the end position of each of the shared named entities, and obtain the analysis result.
在本实施例一种可能的实现方式中,分析单元具体包括:第二确定单元和第一判定单元。其中:In a possible implementation manner of this embodiment, the analysis unit specifically includes: a second determination unit and a first determination unit. among them:
第二确定单元用于将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为候选共享命名实体。The second determining unit is configured to determine the shared named entity whose starting position is the first position of the original sentence information as a candidate shared named entity.
第一判定单元用于若有一个所述候选共享命名实体的结束位置为所述原始语句信息的末位置,则判定所述原始语句信息中仅包含共享命名实体。The first determining unit is configured to determine that the original sentence information only includes the shared named entity if the end position of one of the candidate shared named entities is the end position of the original sentence information.
在本实施例一种可能的实现方式中,分析单元具体还包括:第三确定单元及第二判定单元。其中:In a possible implementation manner of this embodiment, the analysis unit specifically further includes: a third determination unit and a second determination unit. among them:
第三确定单元用于若所有所述候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则循环执行将起始位置为任一所述候选共享命名实体的结束位置的后一位置的所述共享命名实体确定为新的候选共享命名实体,并检测所述新的候选共享命名实体的结束位置是否为所述原始语句信息的末位置的步骤。The third determining unit is configured to, if the end positions of all the candidate shared named entities are not the end positions of the original sentence information, perform the loop execution to set the start position to the end position of any one of the candidate shared named entities. The step of determining that the shared named entity at the location is a new candidate shared named entity, and detecting whether the end position of the new candidate shared named entity is the end position of the original sentence information.
第二判定单元用于在遍历完所有所述共享命名实体后,若所有所述新的候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则判定所述原始语句信息中不是仅包含共享命名实体。The second determining unit is used to determine that the end position of all the new candidate shared named entities is not the end position of the original sentence information after traversing all the shared named entities. Contains only shared named entities.
在本实施例另一种可能的实现方式中,分析单元具体包括:第一定义单元、第一更新单元、第一检测单元、第二更新单元、第三判定单元及第四判定单元。其中:In another possible implementation manner of this embodiment, the analysis unit specifically includes: a first definition unit, a first update unit, a first detection unit, a second update unit, a third determination unit, and a fourth determination unit. among them:
第一定义单元用于定义一长度与所述原始语句信息的长度相同的标志位数组,并将所述标志位数组中的各个标志位的值置为第一预设值。The first definition unit is used to define a flag bit array with the same length as the length of the original sentence information, and set the value of each flag bit in the flag bit array to a first preset value.
第一更新单元用于将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为第一目标共享命名实体,并将所述第一目标共享命名实体的结束位置对应的标志位的值更新为第二预设值。The first update unit is configured to determine the shared named entity whose starting position is the first position of the original sentence information as the first target shared named entity, and mark the end position of the first target shared named entity corresponding to the mark The value of the bit is updated to the second preset value.
第一检测单元用于将起始位置不是所述原始语句信息的首位置的所述共享命名实体确定为第二目标共享命名实体,并检测各个所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值是否为所述第二预设值。The first detection unit is configured to determine the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity, and detect the start position of each of the second target shared named entities Whether the value of the flag bit corresponding to the previous position is the second preset value.
第二更新单元用于若所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值为所述第二预设值,则将所述第二目标共享命名实体的结束位置对应的标志位的值更新为所述第二预设值。The second update unit is configured to, if the value of the flag bit corresponding to the previous position of the start position of the second target shared named entity is the second preset value, set the end of the second target shared named entity The value of the flag bit corresponding to the position is updated to the second preset value.
第三判定单元用于在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第二预设值,则判定所述原始语句信息中仅包含共享命名实体。The third determining unit is configured to determine the original sentence information if the value of the flag bit corresponding to the end position of the original sentence information is the second preset value after traversing all the shared named entities Contains only shared named entities.
第四判定单元用于在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第一预设值,则判定所述原始语句信息中不是仅包含共享命名实体。The fourth determining unit is configured to determine the original sentence information if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the first preset value after traversing all the shared named entities Does not only contain shared named entities.
在本实施例一种可能的实现方式中,分析单元还包括第五判定单元。In a possible implementation manner of this embodiment, the analysis unit further includes a fifth determination unit.
第五判定单元用于若所述共享命名实体中不存在起始位置为所述原始语句信息的首位置的共享命名实体,则判定所述原始语句信息中不是仅包含共享命名实体。The fifth determining unit is used for determining that the original sentence information does not only include the shared named entity if there is no shared named entity whose starting position is the first position of the original sentence information in the shared named entity.
在本申请又一实施例中,服务器70还包括:第三获取单元和第四确定单元。其中:In another embodiment of the present application, the server 70 further includes: a third acquiring unit and a fourth determining unit. among them:
第三获取单元用于若所述目标对话轮次不是首轮对话,则获取所述目标对话轮次之前的历史对话轮次中所述用户的历史原始语句信息。The third obtaining unit is configured to obtain historical original sentence information of the user in the historical dialogue round before the target dialogue if the target dialogue round is not the first round of dialogue.
第四确定单元用于根据所述历史原始语句信息,确定所述原始语句信息对应的目标意图类别。The fourth determining unit is configured to determine the target intention category corresponding to the original sentence information according to the historical original sentence information.
以上可以看出,本申请实施例提供的一种服务器,在获取到用户的原始语句信息后,不是直接将该原始语句信息输入至传统的意图识别模型中来确定用户所表达的意图类别,而是将该原始语句信息输入至预设的共享命名实体分析引擎中,通过该共享命名实体分析引擎来分析原始语句信息中是否仅包含共享命名实体,在原始语句信息中仅包含共享命名实体,且原始语句信息对应的目标对话轮次是首轮对话时,通过输出与共享命名实体所属的共享命名实体类别对应的意图类别,使用户能够从所述意图类别中选择其所表达的目标意图类别,由于目标意图类别是通过用户的进一步确认得到的,因此能够降低意图识别的错误率,提高意图识别的准确性。It can be seen from the above that, after obtaining the original sentence information of the user, the server provided by the embodiment of the present application does not directly input the original sentence information into the traditional intention recognition model to determine the intention category expressed by the user. The original sentence information is input into the preset shared named entity analysis engine, and the shared named entity analysis engine is used to analyze whether the original sentence information contains only shared named entities, and the original sentence information contains only shared named entities, and When the target dialogue round corresponding to the original sentence information is the first round of dialogue, by outputting the intent category corresponding to the shared named entity category to which the shared named entity belongs, so that the user can select the expressed target intent category from the intent categories, Since the target intention category is obtained through further confirmation by the user, the error rate of intention recognition can be reduced, and the accuracy of intention recognition can be improved.
请参阅图8,图8是本申请另一实施例提供的服务器的结构示意图。如图8所示,该实施例 的服务器800包括:至少一个处理器80(图8中仅示出一个)处理器、存储器81以及存储在所述存储器81中并可在所述至少一个处理器80上运行的计算机程序82,所述处理器80执行所述计算机程序82时实现上述任意各个意图识别方法实施例中的步骤。Please refer to FIG. 8. FIG. 8 is a schematic structural diagram of a server provided by another embodiment of the present application. As shown in FIG. 8, the server 800 of this embodiment includes: at least one processor 80 (only one is shown in FIG. 8), a processor, a memory 81, and a memory 81 stored in the memory 81 and available in the at least one processor. A computer program 82 running on the processor 80, when the processor 80 executes the computer program 82, implements the steps in any of the above-mentioned intention recognition method embodiments.
所述服务器800可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该服务器可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是服务器800的举例,并不构成对服务器800的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The server 800 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The server may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art can understand that FIG. 8 is only an example of the server 800, and does not constitute a limitation on the server 800. It may include more or less components than shown, or a combination of certain components, or different components, such as It can also include input and output devices, network access devices, and so on.
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),该处理器80还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), and the processor 80 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), and application specific integrated circuits (Application Specific Integrated Circuits). , ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器81在一些实施例中可以是所述服务器800的内部存储单元,例如服务器800的硬盘或内存。所述存储器81在另一些实施例中也可以是所述服务器800的外部存储设备,例如所述服务器800上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述服务器800的内部存储单元也包括外部存储设备。所述存储器81用于存储操作系统、应用程序、引导装载程序(Boot Loader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。In some embodiments, the memory 81 may be an internal storage unit of the server 800, such as a hard disk or a memory of the server 800. In other embodiments, the memory 81 may also be an external storage device of the server 800, for example, a plug-in hard disk equipped on the server 800, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital). Digital, SD) card, flash card, etc. Further, the storage 81 may also include both an internal storage unit of the server 800 and an external storage device. The memory 81 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of this application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat it here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as required. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist alone physically, or two or more units can be integrated into one unit. The above-mentioned integrated units can be hardware-based Formal realization can also be realized in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which will not be repeated here.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现上述意图识别方法中的步骤。The embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned intention recognition method can be realized.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时可实现上述意图识别方法中的步骤。The embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the steps in the above-mentioned intention recognition method can be realized when the mobile terminal is executed.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到服 务器的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the implementation of all or part of the processes in the above-mentioned embodiment methods in this application can be accomplished by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may include at least: any entity or device capable of carrying computer program code to the server, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as U disk, mobile hard disk, floppy disk or CD-ROM, etc. In some jurisdictions, according to legislation and patent practices, computer-readable media cannot be electrical carrier signals and telecommunication signals.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail or recorded in an embodiment, reference may be made to related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/network equipment and method may be implemented in other ways. For example, the device/network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units. Or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分别到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be separately on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。Finally, it should be noted that the above are only specific implementations of this application, but the scope of protection of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application shall be covered by this application. Within the scope of protection applied for. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (10)

  1. 一种意图识别方法,其特征在于,包括:An intention recognition method, which is characterized in that it includes:
    获取用户的原始语句信息;Get the user's original sentence information;
    将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果;Inputting the original sentence information into a preset shared named entity analysis engine to obtain an analysis result output by the shared named entity analysis engine;
    若所述分析结果指示所述原始语句信息中仅包含共享命名实体,则检测所述原始语句信息对应的目标对话轮次是否是首轮对话;If the analysis result indicates that the original sentence information only contains a shared named entity, detecting whether the target dialogue round corresponding to the original sentence information is the first round of dialogue;
    若所述目标对话轮次是首轮对话,则输出与所述共享命名实体所属的共享命名实体类别对应的意图类别,并确定所述用户在所述意图类别中选择的目标意图类别。If the target dialogue round is the first round of dialogue, output the intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine the target intent category selected by the user in the intent category.
  2. 如权利要求1所述的意图识别方法,其特征在于,所述将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果,包括:3. The intention recognition method of claim 1, wherein the inputting the original sentence information into a preset shared named entity analysis engine to obtain the analysis result output by the shared named entity analysis engine comprises:
    识别所述原始语句信息中包含的命名实体;Identifying named entities included in the original sentence information;
    根据预设的共享命名实体类别列表,识别所述命名实体中的共享命名实体,并确定所述共享命名实体所属的共享命名实体类别;Identify the shared named entity among the named entities according to a preset list of shared named entity categories, and determine the shared named entity category to which the shared named entity belongs;
    确定所述共享命名实体在所述原始语句信息中的起始位置和结束位置;Determining the start position and the end position of the shared named entity in the original sentence information;
    根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果。According to the starting position and the ending position of each of the shared named entities, it is analyzed whether the original sentence information only includes the shared named entity, and the analysis result is obtained.
  3. 如权利要求2所述的意图识别方法,其特征在于,所述根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果,包括:3. The intention recognition method according to claim 2, wherein said analyzing whether said original sentence information contains only shared named entities according to said starting position and said ending position of each of said shared named entities, Obtaining the analysis result includes:
    将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为候选共享命名实体;Determining the shared named entity whose starting position is the first position of the original sentence information as a candidate shared named entity;
    若有一个所述候选共享命名实体的结束位置为所述原始语句信息的末位置,则判定所述原始语句信息中仅包含共享命名实体。If the end position of one of the candidate shared named entities is the end position of the original sentence information, it is determined that only the shared named entity is included in the original sentence information.
  4. 如权利要求3所述的意图识别方法,其特征在于,在将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为候选共享命名实体之后,还包括:5. The intention recognition method of claim 3, wherein after determining the shared named entity whose starting position is the first position of the original sentence information as a candidate shared named entity, the method further comprises:
    若所有所述候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则循环执行将起始位置为任一所述候选共享命名实体的结束位置的后一位置的所述共享命名实体确定为新的候选共享命名实体,并检测所述新的候选共享命名实体的结束位置是否为所述原始语句信息的末位置的步骤;If the ending positions of all the candidate shared named entities are not the end positions of the original sentence information, the shared naming with the starting position being the position after the ending position of any one of the candidate shared named entities is executed in a loop The step of determining whether the entity is a new candidate shared named entity, and detecting whether the end position of the new candidate shared named entity is the end position of the original sentence information;
    在遍历完所有所述共享命名实体后,若所有所述新的候选共享命名实体的结束位置均不是所述原始语句信息的末位置,则判定所述原始语句信息中不是仅包含共享命名实体。After traversing all the shared named entities, if the end positions of all the new candidate shared named entities are not the end positions of the original sentence information, it is determined that the original sentence information does not only include the shared named entity.
  5. 如权利要求2所述的意图识别方法,其特征在于,所述根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果,包括:3. The intention recognition method according to claim 2, wherein said analyzing whether said original sentence information contains only shared named entities according to said starting position and said ending position of each of said shared named entities, Obtaining the analysis result includes:
    定义一长度与所述原始语句信息的长度相同的标志位数组,并将所述标志位数组中的各个标志位的值置为第一预设值;Defining a flag bit array with the same length as the length of the original sentence information, and setting the value of each flag bit in the flag bit array to a first preset value;
    将起始位置为所述原始语句信息的首位置的所述共享命名实体确定为第一目标共享命名实体,并将所述第一目标共享命名实体的结束位置对应的标志位的值更新为第二预设值;The shared named entity whose starting position is the first position of the original sentence information is determined as the first target shared named entity, and the value of the flag corresponding to the end position of the first target shared named entity is updated to the first target shared named entity. Two preset values;
    将起始位置不是所述原始语句信息的首位置的所述共享命名实体确定为第二目标共享命名实体,并检测各个所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值是否为所述第二预设值;Determine the shared named entity whose starting position is not the first position of the original sentence information as the second target shared named entity, and detect the mark corresponding to the previous position of the starting position of each second target shared named entity Whether the value of the bit is the second preset value;
    若所述第二目标共享命名实体的起始位置的前一位置对应的标志位的值为所述第二预设值,则将所述第二目标共享命名实体的结束位置对应的标志位的值更新为所述第二预设值;If the value of the flag bit corresponding to the previous position of the start position of the second target shared named entity is the second preset value, set the value of the flag bit corresponding to the end position of the second target shared named entity The value is updated to the second preset value;
    在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第二预设值,则判定所述原始语句信息中仅包含共享命名实体;After traversing all the shared named entities, if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the second preset value, it is determined that the original sentence information only contains the shared named entity ;
    在遍历完所有所述共享命名实体后,若检测到所述原始语句信息的末位置对应的标志位的值为所述第一预设值,则判定所述原始语句信息中不是仅包含共享命名实体。After traversing all the shared named entities, if it is detected that the value of the flag bit corresponding to the end position of the original sentence information is the first preset value, it is determined that the original sentence information does not only include the shared name entity.
  6. 如权利要求2所述的意图识别方法,其特征在于,所述根据各个所述共享命名实体的所述起始位置和所述结束位置,分析所述原始语句信息中是否仅包含共享命名实体,得到所述分析结果,还包括:3. The intention recognition method according to claim 2, wherein said analyzing whether said original sentence information contains only shared named entities according to said starting position and said ending position of each of said shared named entities, Obtaining the analysis result also includes:
    若所述共享命名实体中不存在起始位置为所述原始语句信息的首位置的共享命名实体,则判定所述原始语句信息中不是仅包含共享命名实体。If there is no shared named entity whose starting position is the first position of the original sentence information in the shared named entity, it is determined that the original sentence information does not only include the shared named entity.
  7. 如权利要求1至6任一项所述的意图识别方法,其特征在于,在检测所述原始语句信息对应的目标对话轮次是否是首轮对话之后,还包括:7. The intention recognition method according to any one of claims 1 to 6, characterized in that, after detecting whether the target dialogue round corresponding to the original sentence information is the first round of dialogue, the method further comprises:
    若所述目标对话轮次不是首轮对话,则获取所述目标对话轮次之前的历史对话轮次中所述用户的历史原始语句信息;If the target dialogue round is not the first round of dialogue, acquiring historical original sentence information of the user in the historical dialogue round before the target dialogue round;
    根据所述历史原始语句信息,确定所述原始语句信息对应的目标意图类别。According to the historical original sentence information, the target intention category corresponding to the original sentence information is determined.
  8. 一种服务器,其特征在于,包括:A server, characterized in that it comprises:
    第一获取单元,用于获取用户的原始语句信息;The first obtaining unit is used to obtain the original sentence information of the user;
    第二获取单元,用于将所述原始语句信息输入至预设的共享命名实体分析引擎中,获得所述共享命名实体分析引擎输出的分析结果;The second obtaining unit is configured to input the original sentence information into a preset shared named entity analysis engine to obtain the analysis result output by the shared named entity analysis engine;
    第一检测单元,用于若所述分析结果指示所述原始语句信息中仅包含共享命名实体,则检测所述原始语句信息对应的目标对话轮次是否是首轮对话;The first detecting unit is configured to detect whether the target dialogue round corresponding to the original sentence information is the first round of dialogue if the analysis result indicates that the original sentence information contains only shared named entities;
    第一确定单元,用于若所述目标对话轮次是首轮对话,则输出与所述共享命名实体所属的共享命名实体类别对应的意图类别,并确定所述用户在所述意图类别中选择的目标意图类别。The first determining unit is configured to, if the target dialogue round is the first round of dialogue, output an intent category corresponding to the shared named entity category to which the shared named entity belongs, and determine that the user selects among the intent categories The target intent category.
  9. 一种服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的意图识别方法。A server comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program as claimed in claims 1 to 7 Any one of the intention recognition methods.
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的意图识别方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program implements the intention recognition method according to any one of claims 1 to 7 when the computer program is executed by a processor.
PCT/CN2020/125213 2019-12-31 2020-10-30 Intention recognition method, server and storage medium WO2021135603A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911417222.2 2019-12-31
CN201911417222.2A CN111177358B (en) 2019-12-31 2019-12-31 Intention recognition method, server and storage medium

Publications (1)

Publication Number Publication Date
WO2021135603A1 true WO2021135603A1 (en) 2021-07-08

Family

ID=70623964

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125213 WO2021135603A1 (en) 2019-12-31 2020-10-30 Intention recognition method, server and storage medium

Country Status (2)

Country Link
CN (1) CN111177358B (en)
WO (1) WO2021135603A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177358B (en) * 2019-12-31 2023-05-12 华为技术有限公司 Intention recognition method, server and storage medium
CN111767372B (en) * 2020-06-30 2023-08-01 北京百度网讯科技有限公司 Analysis method of voice query, training method, device and equipment of analysis model
CN113609266A (en) * 2021-07-09 2021-11-05 阿里巴巴新加坡控股有限公司 Resource processing method and device
CN117275471A (en) * 2022-06-13 2023-12-22 华为技术有限公司 Method for processing voice data and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109063035A (en) * 2018-07-16 2018-12-21 哈尔滨工业大学 A kind of man-machine more wheel dialogue methods towards trip field
US20190206407A1 (en) * 2017-12-29 2019-07-04 DMAI, Inc. System and method for personalizing dialogue based on user's appearances
CN110597958A (en) * 2019-09-12 2019-12-20 苏州思必驰信息科技有限公司 Text classification model training and using method and device
CN111177358A (en) * 2019-12-31 2020-05-19 华为技术有限公司 Intention recognition method, server, and storage medium

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377186B (en) * 2012-04-26 2016-03-16 富士通株式会社 Based on the web service integration of named entity recognition, method and equipment
US9424233B2 (en) * 2012-07-20 2016-08-23 Veveo, Inc. Method of and system for inferring user intent in search input in a conversational interaction system
US9971763B2 (en) * 2014-04-08 2018-05-15 Microsoft Technology Licensing, Llc Named entity recognition
KR20160027640A (en) * 2014-09-02 2016-03-10 삼성전자주식회사 Electronic device and method for recognizing named entities in electronic device
CN107193978A (en) * 2017-05-26 2017-09-22 武汉泰迪智慧科技有限公司 A kind of many wheel automatic chatting dialogue methods and system based on deep learning
CN109388795B (en) * 2017-08-07 2022-11-08 芋头科技(杭州)有限公司 Named entity recognition method, language recognition method and system
CN108427722A (en) * 2018-02-09 2018-08-21 卫盈联信息技术(深圳)有限公司 intelligent interactive method, electronic device and storage medium
CN110502738A (en) * 2018-05-18 2019-11-26 阿里巴巴集团控股有限公司 Chinese name entity recognition method, device, equipment and inquiry system
CN110619050B (en) * 2018-06-20 2023-05-09 华为技术有限公司 Intention recognition method and device
CN109461039A (en) * 2018-08-28 2019-03-12 厦门快商通信息技术有限公司 A kind of text handling method and intelligent customer service method
CN109616108B (en) * 2018-11-29 2022-05-31 出门问问创新科技有限公司 Multi-turn dialogue interaction processing method and device, electronic equipment and storage medium
CN110111787B (en) * 2019-04-30 2021-07-09 华为技术有限公司 Semantic parsing method and server
CN110287283B (en) * 2019-05-22 2023-08-01 中国平安财产保险股份有限公司 Intention model training method, intention recognition method, device, equipment and medium
CN110276075A (en) * 2019-06-21 2019-09-24 腾讯科技(深圳)有限公司 Model training method, name entity recognition method, device, equipment and medium
CN110502740B (en) * 2019-07-03 2022-05-17 平安科技(深圳)有限公司 Question entity identification and linking method and device, computer equipment and storage medium
CN110309514B (en) * 2019-07-09 2023-07-11 北京金山数字娱乐科技有限公司 Semantic recognition method and device
CN110516247B (en) * 2019-08-27 2021-11-16 湖北亿咖通科技有限公司 Named entity recognition method based on neural network and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190206407A1 (en) * 2017-12-29 2019-07-04 DMAI, Inc. System and method for personalizing dialogue based on user's appearances
CN109063035A (en) * 2018-07-16 2018-12-21 哈尔滨工业大学 A kind of man-machine more wheel dialogue methods towards trip field
CN110597958A (en) * 2019-09-12 2019-12-20 苏州思必驰信息科技有限公司 Text classification model training and using method and device
CN111177358A (en) * 2019-12-31 2020-05-19 华为技术有限公司 Intention recognition method, server, and storage medium

Also Published As

Publication number Publication date
CN111177358A (en) 2020-05-19
CN111177358B (en) 2023-05-12

Similar Documents

Publication Publication Date Title
WO2021135603A1 (en) Intention recognition method, server and storage medium
TWI729472B (en) Method, device and server for determining feature words
WO2020077841A1 (en) Voiceprint recognition-based customer service method, device, computer device, and storage medium
EP2869298A1 (en) Information identification method and apparatus
US10565986B2 (en) Extracting domain-specific actions and entities in natural language commands
WO2021115176A1 (en) Speech recognition method and related device
CN108959247B (en) Data processing method, server and computer readable medium
TW202119288A (en) Image classification model training method, image processing method, data classification model training method, data processing method, computer device, and storage medium
WO2022116487A1 (en) Voice processing method and apparatus based on generative adversarial network, device, and medium
WO2018107953A1 (en) Smart terminal, and automatic application sorting method thereof
CN108682421B (en) Voice recognition method, terminal equipment and computer readable storage medium
WO2021218087A1 (en) Intention recognition method and apparatus based on artificial intelligence, and computer device
WO2022042297A1 (en) Text clustering method, apparatus, electronic device, and storage medium
CN109584881B (en) Number recognition method and device based on voice processing and terminal equipment
WO2020103447A1 (en) Link-type storage method and apparatus for video information, computer device and storage medium
CN111354354B (en) Training method, training device and terminal equipment based on semantic recognition
US20200093392A1 (en) Brainprint signal recognition method and terminal device
WO2022178933A1 (en) Context-based voice sentiment detection method and apparatus, device and storage medium
CN111949793B (en) User intention recognition method and device and terminal equipment
WO2021072864A1 (en) Text similarity acquisition method and apparatus, and electronic device and computer-readable storage medium
US20230017449A1 (en) Method and apparatus for processing natural language text, device and storage medium
US20230186613A1 (en) Sample Classification Method and Apparatus, Electronic Device and Storage Medium
CN112802495A (en) Robot voice test method and device, storage medium and terminal equipment
CN112069267A (en) Data processing method and device
WO2021159668A1 (en) Robot dialogue method and apparatus, computer device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20910621

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20910621

Country of ref document: EP

Kind code of ref document: A1