Artificial intelligence based method and apparatus for classifying voice-recognized text

Embodiments of the present disclosure disclose an artificial intelligence based method and apparatus for classifying a voice-recognized text. A specific embodiment of the method includes: acquiring a current interactive text of a voice query from a user; analyzing the current interactive text using a lexical analyzer to obtain a current lexical structure; determining whether the current lexical structure matches a template of a category in a classifier; and classifying, if the current lexical structure matches the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into the category belonging to the matched template. The embodiment can fast classify texts, effectively reduce the magnitude of manually annotated texts, and improve the annotation efficiency in intelligent voice interaction services.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is related to and claims the priority from Chinese Application No. 201710728382.3, filed on Aug. 23, 2017, entitled “Artificial Intelligence Based Method and Apparatus for Classifying a Voice-recognized Text,” the entire disclosure of which is incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to the field of computer technology, specifically to the field of computer network technology, and more specifically to an artificial intelligence based method and apparatus for classifying a voice-recognized text.

BACKGROUND

Rapid development of the artificial intelligence (AI) technology facilitates daily work and life. Artificial intelligence is a new technological science that studies and develops theories, methods, techniques and application systems for simulating, extending and expanding human intelligence. Artificial intelligence is a branch of the computer science that attempts to understand the essence of intelligence and produces novel intelligent machinery capable of responding in a way similar to human intelligence. Studies in the field include robots, speech recognition, image recognition, natural language processing, expert systems, and the like. The artificial intelligence is increasingly integrated into applications. Applications combined with the artificial intelligence can accurately determine information types, and push different types of information to appropriate users based on the needs of the different users.

With the rapid development of the artificial intelligence, enabling machineries to have intelligence comparable to the human intelligence is desired by numerous enterprises. In this context, machine is expected to be capable of intelligent voice interaction with users. In the early stage of the intelligent voice interaction service, collected text corpora of users were usually imperfect, and how to cold start classification of these text corpora is a challenging problem for the intelligent voice interaction service. At present, in the face of such a problem as cold starting text classification, the intelligent voice interaction service needs to collect a considerable amount of text corpora, and only after completing manual annotation of the text corpora, can training of each category be performed.

However, the current intelligent voice interaction service fails to effectively and rapidly classify texts in the early stage of the service. Furthermore, manual annotation requires a considerable amount of annotating manpower, thereby resulting in low annotation efficiency.

SUMMARY

An objective of the present disclosure is to provide an improved artificial intelligence based method and apparatus for classifying a voice-recognized text, to solve the technical problems mentioned in the Background section.

In a first aspect, an embodiment of the present disclosure provides an artificial intelligence based method for classifying a voice-recognized text, the method including: acquiring a current interactive text of a voice query from a user; analyzing the current interactive text using a lexical analyzer to obtain a current lexical structure; determining whether the current lexical structure matches a template of a category in a classifier; and classifying, if the current lexical structure matches the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into the category belonging to the matched template.

In some embodiments, the template of the category is determined by the following steps: acquiring a preset category for a predetermined interaction scenario; acquiring a to-be-generalized interactive text having a frequency of occurrence higher than a predetermined frequency in the category; and receiving manual generalization of the to-be-generalized interactive text in the category to obtain the template of the category.

In some embodiments, the method further includes: classifying, if the current lexical structure fails to match the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into a to-be-classified category.

In some embodiments, the method further includes: acquiring a to-be-processed interactive text having a frequency of occurrence higher than a preset frequency in the to-be-classified category; receiving a manually classifying operation of the to-be-processed interactive text; and classifying the to-be-processed interactive text into a category corresponding to the classifying operation in the classifier.

In some embodiments, the classifying the to-be-processed interactive text into a category corresponding to the classifying operation in the classifier includes: classifying, if there is the category corresponding to the classifying operation in the classifier, the to-be-processed interactive text directly into the category corresponding to the classifying operation in the classifier.

In some embodiments, the classifying the to-be-processed interactive text into a category corresponding to the classifying operation in the classifier includes: establishing, if there is no category corresponding to the classifying operation in the classifier, the category corresponding to the classifying operation in the classifier; and classifying the to-be-processed interactive text into the category corresponding to the classifying operation in the classifier.

In some embodiments, the method further includes: receiving manual generalization of the to-be-processed interactive text classified into the category in the classifier; and updating the template of the category in the classifier based on a generalization result.

In a second aspect, an embodiment of the present disclosure further provides an artificial intelligence based apparatus for classifying a voice-recognized text, the apparatus including: a current text acquisition unit, configured to acquire a current interactive text of a voice query from a user; a current text analyzing unit, configured to analyze the current interactive text using a lexical analyzer to obtain a current lexical structure; a template matching determination unit, configured to determine whether the current lexical structure matches a template of a category in a classifier; and a current text classification unit, configured to classify, if the current lexical structure matches the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into the category belonging to the matched template.

In some embodiments, the template of the category in the template matching determination unit is determined by the following units: a preset category acquisition unit, configured to acquire a preset category for a predetermined interaction scenario; a predetermined text acquisition unit, configured to acquire a to-be-generalized interactive text having a frequency of occurrence higher than a predetermined frequency in the category; and a predetermined text generalization unit, configured to receive manual generalization of the to-be-generalized interactive text in the category to obtain the template of the category.

In some embodiments, the apparatus further includes: a current text to-be-classifying unit, configured to classify, if the current lexical structure fails to match the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into a to-be-classified category.

In some embodiments, the apparatus further includes: a to-be-processed text acquisition unit, configured to acquire a to-be-processed interactive text having a frequency of occurrence higher than a preset frequency in the to-be-classified category; a classifying operation receiving unit, configured to receive a manually classifying operation of the to-be-processed interactive text; and a to-be-processed text classification unit, configured to classify the to-be-processed interactive text into the category corresponding to the classifying operation in the classifier.

In some embodiments, the to-be-processed text classification unit is further configured to: classify, if there is the category corresponding to the classifying operation in the classifier, the to-be-processed interactive text directly into the category corresponding to the classifying operation in the classifier.

In some embodiments, the to-be-processed text classification unit is further configured to: establish, if there is no category corresponding to the classifying operation in the classifier, the category corresponding to the classifying operation in the classifier; and classify the to-be-processed interactive text into the category corresponding to the classifying operation in the classifier.

In some embodiments, the apparatus further includes: a to-be-processed text generalization unit, configured to receive manual generalization of the to-be-processed interactive text classified into the category in the classifier; and a category template updating unit, configured to update the template of the category in the classifier based on a generalization result.

In a third aspect, an embodiment of the present disclosure provides a device, including: one or more processors; and a memory, for storing one or more programs, the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the artificial intelligence based method for classifying a voice-recognized text according to any one of the above embodiments.

In a fourth aspect, an embodiment of the present disclosure provides a computer readable storage medium storing a computer program thereon, the program, when executed by a processor, implements the artificial intelligence based method for classifying a voice-recognized text according to any one of the above embodiments.

An artificial intelligence based method and apparatus for classifying a voice-recognized text provided by an embodiment of the present disclosure firstly acquire a current interactive text of a voice query from a user; then analyze the current interactive text using a lexical analyzer to obtain a current lexical structure; then determine whether the current lexical structure matches a template of a category in a classifier; and finally classify, if the current lexical structure matches the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into the category belonging to the matched template. The artificial intelligence based method and apparatus for classifying a voice-recognized text provided by the embodiment can fast classify texts in the intelligent voice interaction service.

In some embodiments, the current interactive text corresponding to the current lexical structure failing to match the template of the category in the classifier is classified into a to-be-classified category, then a manually classifying operation of a to-be-processed interactive text having a frequency of occurrence higher than a preset frequency is received, and then the to-be-processed interactive text is classified into a category corresponding to the classifying operation in the classifier, thereby effectively reducing the magnitude of manually annotated texts, and improving the annotation efficiency.

DETAILED DESCRIPTION OF EMBODIMENTS

FIG. 1is a flow100of an embodiment of an artificial intelligence based method for classifying a voice-recognized text according to the present disclosure. The artificial intelligence based method for classifying a voice-recognized text includes:

Step110: acquiring a current interactive text of a voice query from a user.

In the embodiment, an electronic device running an artificial intelligence based method for classifying a voice-recognized text may acquire a voice query from a user, and then obtain a current interactive text by voice recognition of the voice query; and may also directly acquire the current interactive text by pre-recognizing the voice query from the user.

Step120: analyzing the current interactive text using a lexical analyzer to obtain a current lexical structure.

In the embodiment, after acquiring a current interactive text of a voice query from a user, the current interactive text may be analyzed using a lexical analyzer to obtain a current lexical structure. The lexical analyzer here may be a lexical analyzer for extracting a current lexical structure in existing technologies or technologies to be developed in the future, and is not limited in the present disclosure. For example, a lexical analyzer Lexparser (a Lex-based lexical analyzer, where Lex is the abbreviation of lexical compiler, is a tool in a UNIX environment, has the main function of generating a C source code of a lexical analyzer (scanner), and uses a descriptive rule of a regular expression) may be used to analyze the current interactive text.

Step130: determining whether the current lexical structure matches a template of a category in a classifier.

In the embodiment, the template of a category in a classifier may be a predefined template for the category in the classifier. The template of a category may be a manually defined template, and may also be a template derived from other applications. The category here may be predefined by a skilled person based on a voice interaction scenario. For example, in a vehicular voice interaction scenario, categories, such as a navigation category, an instruction category, and a music category, may be defined; while in a children's voice interaction scenario, categories, such as a nursery rhyme category, a story category, an ancient poem category, and a portrayal category, may be defined.

In some alternative implementations of the embodiment, the template of the category may be determined by the following steps: acquiring a preset category for a predetermined interaction scenario; acquiring a to-be-generalized interactive text having a frequency of occurrence higher than a predetermined frequency in the category; and receiving manual generalization of the to-be-generalized interactive text in the category to obtain the template of the category.

In the implementation, the to-be-generalized interactive text having a frequency of occurrence higher than a predetermined frequency in the category refers to a manually collected common interactive text in the category. Generalization refers to expansion of a specific and individual interactive text to a general interactive text. For example, for the portrayal category, a common interactive text expressed as “you” or “thou” may be generalized to “you,” “when” and “what time” may be generalized to “when,” and “birth” and “birthday” and the like may be generalized to “birth.” Thus, a template “you+when+birth” is obtained, and then these templates may be used as the basis for classifying the category. When receiving manual generalization of a to-be-generalized interactive text in a category, a generalized vocabulary between a lexical structure of the to-be-generalized interactive text and a generalization template may also be generated.

A current interactive text of a voice query may be classified through a template of a category without the need of manually annotating the current interactive text of a possible voice query. For example, for a current interactive text of a voice query “When is your birthday,” if a user changes a way to ask “When were you born,” and if there is no annotated recognized text “when were you born,” it cannot be classified using the annotation method of the existing technology, but may be classified using the template of the category obtained by generalization according to the present disclosure.

Step140: classifying, if the current lexical structure matches the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into the category belonging to the matched template.

In the embodiment, whether the current lexical structure matches the generalized vocabulary may be determined based on the generalized vocabulary previously generated when determining the template of the category. If the current lexical structure matches the generalized vocabulary, then it means that the current lexical structure matches the template of the category in the classifier. Under the circumstance, the current interactive text corresponding to the current lexical structure may be classified into the category belonging to the matched template.

Alternatively, step150: classifying, if the current lexical structure fails to match the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into a to-be-classified category.

In the embodiment, the current interactive text is classified into a to-be-classified category for subsequent processing. For example, when interactive texts in a to-be-classified category satisfy a processing condition (for example, after reaching a certain number or after an interval of a predetermined duration), interactive texts having a frequency of occurrence higher than a preset frequency in the to-be-classified category may be processed manually, thus effectively reducing the magnitude of manually annotated texts, and improving the annotation efficiency. Here, the optional step150is not an essential step in the embodiment, and the embodiment of the present disclosure may also only include step110to step140.

The artificial intelligence based method for classifying a voice-recognized text provided by the embodiment of the present disclosure can fast classify a current interactive text in the intelligent voice interaction service, and may classify, in some optional schemes, a current unclassified interactive text into a to-be-classified category for subsequently processing the interactive text in the to-be-classified category when the interactive text in the to-be-classified category satisfies a processing condition (for example, after reaching a certain number or after an interval of a predetermined duration), thus effectively reducing the magnitude of manually annotated texts, and improving the annotation efficiency.

Furthermore, referring toFIG. 2, a schematic flow of an embodiment of a method for updating a template of a category in a classifier in the artificial intelligence based method for classifying a voice-recognized text according to the present disclosure is shown.

As shown inFIG. 2, a method200for updating a template of a category in a classifier includes:

Step210: acquiring a to-be-processed interactive text having a frequency of occurrence higher than a preset frequency in the to-be-classified category.

In the embodiment, after the artificial intelligence based method for classifying a voice-recognized text as shown inFIG. 1runs for a period of time, the to-be-classified category will include some unclassified interactive texts. When these interactive texts satisfy a processing condition (for example, after reaching a certain number or after an interval of a predetermined duration), interactive texts having a frequency of occurrence higher than a preset frequency may be selected from the unclassified interactive texts for use as to-be-processed interactive texts, i.e., texts of voice queries frequently asked by users, for subsequent processing. It should be appreciated that, the preset frequency here may be identical to, or different from, the predetermined frequency in the alternative implementation of the step130, which is not limited in the present disclosure.

Step220: receiving a manually classifying operation of the to-be-processed interactive text.

In the embodiment, the to-be-processed interactive texts obtained in step210may be manually processed again, their categories may be analyzed, and their templates may be generalized to realize a template iteration of the classifier, thus greatly reducing the magnitude of manually annotated texts, and improving the annotation efficiency.

Step230: classifying the to-be-processed interactive text into a category corresponding to the classifying operation in the classifier.

In the embodiment, in the early stage of the running of the artificial intelligence based method for classifying a voice-recognized text, there will be a few templates of a category, while with the continuous running of the method, there will be more interactive texts corresponding to voice queries from the users. Under the circumstance, these increased unclassified interactive texts corresponding to voice queries may be classified manually.

Specifically, in a classifying operation, the to-be-processed interactive text may be classified into a category corresponding to the classifying operation in the classifier based on whether there is a category corresponding to the classifying operation in the classifier: if there is a category corresponding to the classifying operation in the classifier, the to-be-processed interactive text is directly classified into the category corresponding to the classifying operation in the classifier. If there is no category corresponding to the classifying operation in the classifier, the category corresponding to the classifying operation is established in the classifier; and the to-be-processed interactive text is classified into the category corresponding to the classifying operation in the classifier. For example, in a vehicular scenario, because a large number of users ask questions involving weather, a category “weather” may be added.

Step240: receiving manual generalization of the to-be-processed interactive text classified into the category in the classifier.

In the embodiment, the template may be manually generalized for the to-be-processed interactive text reclassified in step230. The generalization process may be referred to the process of template generalization in the artificial intelligence based method for classifying a voice-recognized text as shown inFIG. 1. Here, detailed description thereof will be omitted.

Step250: updating the template of the category in the classifier based on a generalization result.

In the embodiment, based on a generalization result in step240, if the template of the category in the classifier does not contain the generalization result, the generalization result is updated to the template of the category in the classifier. For example, in a vehicular scenario, because a large number of users ask questions involving weather, a category “weather” may be added, the to-be-processed interactive text in the category “weather” may be generalized, and the template of the category “weather” may be updated.

It should be appreciated that the embodiment ofFIG. 2implemented on the basis ofFIG. 1is only an illustrative embodiment of the present disclosure, and does not limit the present disclosure. For example, another embodiment of the present disclosure may only include step110to step150, and step210to step230.

The method for updating a template of a category in a classifier in the artificial intelligence based method for classifying a voice-recognized text provided by the above embodiment of the present disclosure may continuously update the category and the template of the category in the classifier in the process of classifying a voice-recognized text, effectively reduce the magnitude of manually annotated texts, and improve the annotation efficiency.

An exemplary application scenario of the artificial intelligence based method for classifying a voice-recognized text according to an embodiment of the present disclosure is described below with reference toFIG. 3.

As shown inFIG. 3, a schematic flowchart of an application scenario of the artificial intelligence based method for classifying a voice-recognized text according to an embodiment the present disclosure is illustrated.

As shown inFIG. 3, an artificial intelligence based method300for classifying a voice-recognized text according to an embodiment of the present disclosure may run in an electronic device320.

First, the electronic device320acquires a current interactive text301of a voice query from a user; then analyzes the current interactive text301using a lexical analyzer302to obtain a current lexical structure303; then determines whether the current lexical structure303matches a template304of a category in a classifier; then classifies, if the current lexical structure303matches the template304of the category in the classifier, the current interactive text301corresponding to the current lexical structure303into a category305belonging to the matched template; classifies, if the current lexical structure303fails to match the template304of the category in the classifier, the current interactive text301corresponding to the current lexical structure into a to-be-classified category306; then acquires a to-be-processed interactive text having a frequency of occurrence higher than a preset frequency in the to-be-classified category306, receives a manually classifying operation of the to-be-processed interactive text, and classifies the to-be-processed interactive text in the to-be-classified category into a category307corresponding to the classifying operation in the classifier, establishes, if there is no category corresponding to the classifying operation in the classifier, the category (newly established category308) corresponding to the classifying operation in the classifier, and classifies the to-be-processed interactive text into the category corresponding to the classifying operation in the classifier; then receives manual generalization of the to-be-processed interactive text309having a high frequency classified into the category in the classifier; and then updates the template304of the category in the classifier.

Here, for the initial template304of the category, a to-be-generalized interactive text311of the category may be manually determined based on a predetermined category in a predetermined interaction scenario310, and then the to-be-generalized interactive text311may be manually generalized to obtain the initial template304of the category.

The artificial intelligence based method for classifying a voice-recognized text provided in the above application scenario of the present disclosure can fast classify texts in the intelligent voice interaction service, and may continuously update the category and the template of the category in the classifier during the intelligent voice interaction service, thereby effectively reducing the magnitude of manually annotated texts, and improving the annotation efficiency.

With further reference toFIG. 4, as an implementation to the above method, the embodiment of the present disclosure provides an embodiment of an artificial intelligence based apparatus for classifying a voice-recognized text, and the embodiment of the artificial intelligence based apparatus for classifying a voice-recognized text corresponds to the embodiment of the artificial intelligence based method for classifying a voice-recognized text as shown inFIG. 1toFIG. 3. Thus, the operations and characteristics described in the artificial intelligence based method for classifying a voice-recognized text inFIG. 1toFIG. 3hereinbefore also apply to an artificial intelligence based apparatus400for classifying a voice-recognized text and units contained therein. Here, detailed description thereof will be omitted.

As shown inFIG. 4, the artificial intelligence apparatus400for classifying a voice-recognized text includes: a current text acquisition unit401, a current text analyzing unit402, a template matching determination unit403and a current text classification unit404.

The current text acquisition unit401is configured to acquire a current interactive text of a voice query from a user. The current text analyzing unit402is configured to analyze the current interactive text using a lexical analyzer to obtain a current lexical structure. The template matching determination unit403is configured to determine whether the current lexical structure matches a template of a category in a classifier. The current text classification unit404is configured to classify, if the current lexical structure matches the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into the category belonging to the matched template.

In some alternative implementations of the embodiment, the template of the category in the template matching determination unit403is determined by the following units (not shown in the figure): a preset category acquisition unit, configured to acquire a preset category for a predetermined interaction scenario; a predetermined text acquisition unit, configured to acquire a to-be-generalized interactive text having a frequency of occurrence higher than a predetermined frequency in the category; and a predetermined text generalization unit, configured to receive manual generalization of the to-be-generalized interactive text in the category to obtain the template of the category.

In some alternative implementations of the embodiment, the apparatus further includes: a current text to-be-classifying unit405, configured to classify, if the current lexical structure fails to match the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into a to-be-classified category.

In some alternative implementations of the embodiment, the apparatus further includes: a to-be-processed text acquisition unit406, configured to acquire a to-be-processed interactive text having a frequency of occurrence higher than a preset frequency in the to-be-classified category; a classifying operation receiving unit407, configured to receive a manually classifying operation of the to-be-processed interactive text; and a to-be-processed text classification unit408, configured to classify the to-be-processed interactive text into the category corresponding to the classifying operation in the classifier.

In some alternative implementations of the embodiment, the to-be-processed text classification unit is further configured to: classify, if there is the category corresponding to the classifying operation in the classifier, the to-be-processed interactive text directly into the category corresponding to the classifying operation in the classifier.

In some alternative implementations of the embodiment, the to-be-processed text classification unit is further configured to: establish, if there is no category corresponding to the classifying operation in the classifier, the category corresponding to the classifying operation in the classifier; and classify the to-be-processed interactive text into the category corresponding to the classifying operation in the classifier.

In some alternative implementations of the embodiment, the apparatus further includes: a to-be-processed text generalization unit409, configured to receive manual generalization of the to-be-processed interactive text classified into the category in the classifier; and a category template updating unit410, configured to update the template of the category in the classifier based on a generalization result.

The present disclosure further provides an embodiment of a device, including: one or more processors; and a memory, for storing one or more programs, the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the artificial intelligence based method for classifying a voice-recognized text according to any one of the above embodiments.

The present disclosure further provides an embodiment of a computer readable storage medium storing a computer program thereon, the program, when executed by a processor, implements the artificial intelligence based method for classifying a voice-recognized text according to any one of the above embodiments.

With reference toFIG. 5, a schematic structural diagram of a computer system500suitable for implementing a terminal device or a server according to an embodiment of the present disclosure is shown. The terminal device12shown inFIG. 5is only an example and should not impose any limitation to the function and scope of use of the embodiments of the present disclosure.

As shown inFIG. 5, the computer system500includes a central processing unit (CPU)501, which may execute various appropriate actions and processes in accordance with a program stored in a read-only memory (ROM)502or a program loaded into a random access memory (RAM)503from a storage portion508. The RAM503also stores various programs and data required by operations of the system500. The CPU501, the ROM502and the RAM503are connected to each other through a bus504. An input/output (I/O) interface505is also connected to the bus504.

The following components are connected to the I/O interface505: an input portion506including a keyboard, a mouse etc.; an output portion507comprising a cathode ray tube (CRT), a liquid crystal display device (LCD), a speaker etc.; a storage portion508including a hard disk and the like; and a communication portion509comprising a network interface card, such as a LAN card and a modem. The communication portion509performs communication processes via a network, such as the Internet. A drive510is also connected to the I/O interface505as required. A removable medium511, such as a magnetic disk, an optical disk, a magneto-optical disk, and a semiconductor memory, may be installed on the drive510, to facilitate the retrieval of a computer program from the removable medium511, and the installation thereof on the storage portion508as needed.

In particular, according to embodiments of the present disclosure, the process described above with reference to the flowchart may be implemented in a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which comprises a computer program that is tangibly embedded in a machine-readable medium. The computer program comprises program codes for executing the method as illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion509, and/or may be installed from the removable medium511. The computer program, when executed by the central processing unit (CPU)501, implements the above mentioned functionalities as defined by the method of the present disclosure.

It should be noted that the computer readable medium in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination thereof. An example of the computer readable storage medium may include, but not limited to: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, element, or a combination any of the above. A more specific example of the computer readable storage medium may include but is not limited to: electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), a fibre, a portable compact disk read only memory (CD-ROM), an optical memory, a magnet memory or any suitable combination of the above. In the present disclosure, the computer readable storage medium may be any physical medium containing or storing programs which can be used by a command execution system, apparatus or element or incorporated thereto. In the present disclosure, the computer readable signal medium may include a data signal that propagates in baseband or as part of a carrier wave carrying computer readable program codes. The data signal propagated in this way may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium except for the computer readable storage medium. The computer readable signal medium is capable of transmitting, propagating or transferring programs for use by, or used in combination with, a command execution system, apparatus or element. The program codes contained on the computer readable medium may be transmitted with any suitable medium including but not limited to: wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

The units involved in the embodiments of the present disclosure may be implemented by means of software or hardware. The described units may also be provided in a processor, for example, described as: a processor, comprising a current text acquisition unit, a current text analyzing unit, a template matching determination unit and a current text classification unit. For example, the current text acquisition unit may also be described as “a unit configured to acquire a current interactive text of a voice query from a user.”

In another aspect, the present disclosure further provides a non-transitory computer storage medium. The non-transitory computer storage medium may be the non-transitory computer storage medium included in the apparatus in the above described embodiments, or a stand-alone non-transitory computer storage medium not assembled into the terminal. The non-transitory computer storage medium stores one or more programs. The one or more programs, when executed by a device, cause the device to: acquire a current interactive text of a voice query from a user; analyze the current interactive text using a lexical analyzer to obtain a current lexical structure; determine whether the current lexical structure matches a template of a category in a classifier; and classify, if the current lexical structure matches the template of the category in the classifier, the current interactive text corresponding to the current lexical structure into the category belonging to the matched template.