Chat robot based on natural language real-time scene generation
1. A chat robot generated based on a real-time scene of natural language, comprising:
the input module is used for receiving a man-machine conversation instruction input by a user;
the grammar parsing module is used for parsing the human-computer conversation instruction and enabling the natural language processing module to recognize and process the instruction by decomposing the instruction into a chat part and a scene part;
the natural language processing module comprises an analysis model and a processing model, wherein the analysis model is used for carrying out characteristic analysis and identification on a chatting part and a scene part, and the processing model is used for operating by taking the identified characteristics as an input end and outputting a processing result;
and the feedback module is used for displaying the result of the man-machine conversation to the user.
2. The chat robot based on real-time scene generation of natural language according to claim 1, wherein a virtual scene generation module and a grammar integration module are further connected between the natural language processing module and the feedback module;
the virtual scene generation module is used for generating a real-time scene of a scene part;
the grammar integration module is used for integrating the chat results of the chat part.
3. The chat robot based on real-time scene generation in natural language according to claim 2, wherein the virtual scene generation module is driven by a 3D generation engine.
4. The chat robot based on real-time scene generation of natural language according to claim 2, wherein the natural language processing module comprises a scene language NLP model, an expressive language NLP model, an action language NLP model and a dialogue language NLP model, wherein the scene language NLP model is used for processing dialogue instructions of the scene part, and the expressive language NLP model, the action language NLP model and the dialogue language NLP model are used for processing dialogue instructions of the chat part.
5. The chat robot based on natural language real-time scene generation of claim 4, wherein the scene language NLP model is connected with the virtual scene generation module, and the expression language NLP model, the action language NLP model and the dialogue language NLP model are connected with the grammar integration module.
6. The chat robot of claim 1, wherein the input module comprises a chat input and a scene input, wherein the chat input is used to input a transcript language, the scene input is used to input a scene description, the transcript language is parsed by the grammar parsing module using a transcript grammar, and the scene description is parsed by the grammar parsing module using a description grammar.
7. The chat robot based on real-time scene generation of natural language according to claim 1, wherein the parsing method of the grammar parsing module comprises:
acquiring a man-machine conversation instruction of an input module;
dividing the instruction into four parts of scene, expression, action and conversation;
the words of each part are extracted and forwarded to the natural language processing module.
Background
Natural Language Processing (NLP) is a field of computer science, artificial intelligence, linguistics that focuses on the interaction between computers and human (natural) language. Thus, natural language processing is relevant to the field of human-computer interaction. Natural language processing faces many challenges, including natural language understanding, and thus, natural language processing involves an area of human-computer interaction. Many challenges in NLP relate to natural language understanding, i.e., computer-derived meaning from human or natural language input, and other concerns with natural language generation. The mainstream chat robot takes characters as chat contents and carries out single-dimensional conversation.
A chat bot is a program used to simulate a human conversation or chat. The NLP technology of the chat robot is mainly used to generate a man-machine conversation. However, the traditional chat robot has a single conversation mode and a small amount of information, and is mostly used in practical scenes such as customer service and daily assistance.
Disclosure of Invention
The invention aims to solve the problems of single conversation mode and small information amount of the chat robot in man-machine conversation, and provides the chat robot based on real-time scene generation of natural language, which has the advantages of adopting script language to virtualize and scenize scenes of scenes, expressions, actions and conversations and enriching man-machine conversation.
The invention achieves the above object through the following technical scheme, a chat robot based on natural language real-time scene generation, comprising:
the input module is used for receiving a man-machine conversation instruction input by a user;
the grammar parsing module is used for parsing the human-computer conversation instruction and enabling the natural language processing module to recognize and process the instruction by decomposing the instruction into a chat part and a scene part;
the natural language processing module comprises an analysis model and a processing model, wherein the analysis model is used for carrying out characteristic analysis and identification on a chatting part and a scene part, and the processing model is used for operating by taking the identified characteristics as an input end and outputting a processing result;
and the feedback module is used for displaying the result of the man-machine conversation to the user.
Preferably, a virtual scene generation module and a grammar integration module are further connected between the natural language processing module and the feedback module;
the virtual scene generation module is used for generating a real-time scene of a scene part;
the grammar integration module is used for integrating the chat results of the chat part.
Preferably, the virtual scene generation module is driven by a 3D generation engine. And the 3D generation engine generates a 3D scene, and the language, expression and action of the 3D character according to the NLP analysis result.
Preferably, the natural language processing module includes a scene language NLP model, an expression language NLP model, an action language NLP model, and a dialogue language NLP model, where the scene language NLP model is used to process dialogue instructions of the scene part, and the expression language NLP model, the action language NLP model, and the dialogue language NLP model are used to process dialogue instructions of the chat part.
Preferably, the scene language NLP model is connected to the virtual scene generation module, and the expression language NLP model, the action language NLP model, and the dialogue language NLP model are connected to the grammar integration module.
Preferably, the input module includes a chat input for inputting a script language and a scene input for inputting a scene description, the script language is parsed by the grammar parsing module using script grammar, and the scene description is parsed by the grammar parsing module using description grammar.
Preferably, the parsing method of the syntax parsing module includes:
acquiring a man-machine conversation instruction of an input module;
dividing the instruction into four parts of scene, expression, action and conversation;
the words of each part are extracted and forwarded to the natural language processing module.
Compared with the prior art, the invention has the beneficial effects that: by using the script language as an input instruction mode, scenes, expressions, actions and conversations in the script language are decomposed by the natural language processing module, so that the man-machine conversation has virtualized scenes and virtualized character actions, and the richness of man-machine conversation communication is improved.
Drawings
FIG. 1 is a schematic diagram of the overall system configuration of the present invention.
FIG. 2 is a schematic diagram of the internal model composition of the natural language processing module according to the present invention.
Fig. 3 is a schematic diagram of the input module according to the present invention.
FIG. 4 is a flow chart of a parsing method of the syntax parsing module according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a chat robot based on real-time scene generation in natural language includes:
an input module, configured to receive a human-computer conversation instruction input by a user, where the input module is shown in fig. 3 and includes a chat input and a scenario input, where the chat input is used to input a script language, the scenario input is used to input a scenario description, the script language is parsed by a grammar parsing module using a script grammar, the scenario description is parsed by a description grammar parsing module, and the script language expresses a scenario, an action, and an expression by a specific grammar, which is exemplified by: (giving you a white eye), expressions are shown in parentheses, and specific grammars include, but are not limited to, brackets, braces, asterisks, underlines, quotation marks and proper nouns, wherein the brackets, asterisks, quotation marks and proper nouns are used for representing chat parts, and the underlines represent scene parts, so that the input conversation instructions can be conveniently decomposed by the grammar parsing module through the specific grammars.
A grammar parsing module for parsing the human-computer conversation instruction, and enabling the natural language processing module to recognize and process the instruction by decomposing the instruction into a chat part and a scene part, as shown in fig. 4, wherein the parsing method of the grammar parsing module comprises the following steps:
step S1, a man-machine conversation instruction of the input module is obtained, and the man-machine conversation instruction is input through the input module according to the specific grammar of the script language;
step S2, dividing the instruction into four parts of scene, expression, action and dialogue, for example, analyzing the content in brackets as expression, the content in asterisk as action, and the underline content as scene description, through specific grammar, the instruction can be conveniently decomposed, which is beneficial to the subsequent processing of natural language processing module;
and step S3, extracting words of each part and forwarding the words to the natural language processing module, extracting the content in brackets, the content in stars and the underline content, and forwarding the words to the natural language processing module for processing, so that the natural language processing module can output the result of each content.
The natural language processing module comprises an analysis model and a processing model, wherein the analysis model analyzes and identifies the characteristics of the chat part and the scene part, the processing model operates by taking the identified characteristics as an input end and outputs a processing result, a virtual scene generation module and a grammar integration module are further connected between the natural language processing module and the feedback module, the virtual scene generation module is used for generating a real-time scene of the scene part, the grammar integration module is used for integrating the chat result of the chat part, the virtual scene generation module is driven by a 3D generation engine, and the scene belongs to an open type, non-preset type and real-time generation. The scene content instructions can be generated in real time through the driving of a 3D generation engine without manual programming of a user or using a prefabricated scene. For example, a "scene: petal rain; a place: a road; time: by default, the 3D generation engine generates petal rain spray on the road. As shown in fig. 2, the natural language processing module includes a scene language NLP model, an expression language NLP model, an action language NLP model and a dialogue language NLP model, wherein the scene language NLP model is used for processing the dialogue instructions of the scene part, the expression language NLP model, the action language NLP model and the dialogue language NLP model are used for processing the dialogue instructions of the chat part, the scene language NLP model is connected with the virtual scene generation module, the expression language NLP model, the action language NLP model and the dialogue language NLP model are connected with the grammar integration module, the instruction content analyzed by the grammar analysis module can be output through a scene language NLP model, an expression language NLP model, an action language NLP model and a dialogue language NLP model, for example, but not limited to, user input (giving you a white eye), expressive language NLP model output (giving you a smile). The user inputs a sentence 'i love you', the dialogue language NLP model outputs a character 'i know', therefore, virtual scenes, actions, expressions and characters can be output through the natural language processing module, and the display is richer when the language is displayed to the user.
And the feedback module is used for displaying the result of the man-machine conversation to the user, and in the chat interface, the grammar integration module carries out user feedback on the result generated by grammar integration and feeds back the action, the expression and the language to the user according to the specific grammar. For example, actions are fed back directly as parenthetical statements: (give you a smile). Specific grammars include, but are not limited to, small brackets, medium brackets, large brackets, asterisks, underlines, quotation marks, etc., while adjusting the actions, expressions, and virtual environment of the avatar.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.