WO2020221142A1 - Picture book-based question and answer interaction method and electronic device - Google Patents

Picture book-based question and answer interaction method and electronic device Download PDF

Info

Publication number
WO2020221142A1
WO2020221142A1 PCT/CN2020/086872 CN2020086872W WO2020221142A1 WO 2020221142 A1 WO2020221142 A1 WO 2020221142A1 CN 2020086872 W CN2020086872 W CN 2020086872W WO 2020221142 A1 WO2020221142 A1 WO 2020221142A1
Authority
WO
WIPO (PCT)
Prior art keywords
question
template
electronic device
asked
answer
Prior art date
Application number
PCT/CN2020/086872
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 WO2020221142A1 publication Critical patent/WO2020221142A1/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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition

Definitions

  • This application relates to the field of artificial intelligence, and in particular to a question and answer interactive method and electronic equipment based on picture books.
  • this application provides a question and answer interaction method based on picture books.
  • the method includes: an electronic device loads a database related to a target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, An answer template library and a word set, the entity attribute library includes multiple entity names and multiple entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, and the question template database includes at least one A question template, the call function library includes at least one call function, each question template in the question template library corresponds to one or more call functions in the call function library, and each question template library The question template includes a plurality of slots, the answer template library includes at least one answer template, the answer templates in the answer template library correspond to the calling functions in the calling function library, and the word set indicates Correspondence between multiple keywords and generalized words, the generalized words include entities; the electronic device receives the user's question; the electronic device performs word segmentation processing on the user's question to obtain word segmentation Word string, the word segmentation string, the
  • the number and types of the parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template. In this way, the function called by the questioned question can be accurately determined, so that the answer to be answered can be accurately determined subsequently.
  • the electronic device updates the entity attribute database according to the entity name and entity attributes contained in the interaction history information; wherein, the interaction history information is the result of reading the target picture book on the electronic device
  • the electronic device receives speech information input by the user or action information of the user.
  • the electronic device can make the updated entity attribute library more in line with user needs, make human-computer interaction more targeted, and make reading deeper.
  • the electronic device collects the image of the picture book displayed by the user through a camera; the electronic device collects The image of the picture book is analyzed to determine the target picture book.
  • the electronic device when the electronic device includes a display screen, when the electronic device outputs the answer to be answered to the user, it may also display the answer to be answered through the display screen.
  • the electronic device can output the answer to the user more flexibly, and the answer can be displayed on the display screen while answering the user by voice, making the output of the electronic device more intuitive, making the user easier to understand, and improving user acceptance degree.
  • the electronic device when the electronic device further includes a movable component, when the electronic device outputs the answer to be answered to the user, the electronic device may also control the movable component to perform outputting. Describe the action to be answered.
  • the electronic device can output the answer to the user more flexibly, and the answer can be indicated by performing an action while answering the user by voice, so that the output of the electronic device is more diversified and the user's acceptance is improved.
  • the electronic device can automatically generate questions to be asked according to the database related to the target picture book, and does not need to preset the questions, and does not mechanically ask the user according to the preset questions, so that the picture book can be read
  • the interaction between electronic devices and users is more intelligent, which can improve the effectiveness of reading picture books.
  • the database further includes an answer template library, the answer template library contains at least one answer template, and the answer templates in the answer template library are one-to-one with the calling functions in the calling function library.
  • the electronic device extracts the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the question to be asked from the question to be asked; then, the electronic device calls according to the question to be asked Function and the entity name corresponding to the question to be asked, the entity attribute corresponding to the entity name corresponding to the question to be asked is obtained from the entity attribute library, or the electronic device calls the function and The entity attribute corresponding to the question to be asked is obtained from the entity attribute library and the entity name corresponding to the entity attribute corresponding to the question to be asked is obtained; finally, the electronic device calls the function according to the question to be asked from the answer A to-be-determined answer template is obtained from a template library, where the to-be-determined answer template is an answer template in the answer template library that corresponds to the call function to be asked, and
  • the electronic device can automatically generate the answers to the questions to be asked according to the database related to the target picture book, and does not need to mechanically preset the question answer pairs, which can make the electronic device ask questions and user answers more during the picture book reading process.
  • the electronic device receives the user's answer to the question to be asked, and compares the user's answer to the question to be asked with the answer to be determined to obtain the user According to the result of judging whether the answer is correct, corresponding operations are made to the user according to the judgment result.
  • the electronic device can accurately determine whether the user's answer is correct, and perform corresponding operations to the user to directly or indirectly prompt the user whether the answer is correct, which can improve the user's acceptance of the answer.
  • the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked. In this way, the function to be called can be accurately determined, so that the answer to be determined can be accurately determined subsequently.
  • the electronic device when the question template information is the transition probability set, the electronic device obtains the question template to be asked from the question template library according to the question template information, and the specific method may be: The electronic device determines the target transition probability from the set of transition probabilities according to a predetermined random value; the electronic device obtains the question template to be asked from the question template library according to the target transition probability.
  • the electronic device can make more diversified questions, prevent the user from feeling bored, and increase the user's interest in picture book reading.
  • the electronic device when the question template information is the question template type, the electronic device obtains the question template to be asked from the question template library according to the question template information.
  • the specific method may be: The electronic device determines the target question template type according to the user’s age and the corresponding relationship between the age and the question template type; the corresponding relationship indicates that the user’s age corresponds to at least one of the following question template types: space, detail, society, color, number, Text and nature; the electronic device obtains a question template that meets the target question template type from the question template library as the question template to be asked.
  • a question template that is more suitable for the user's cognitive ability can be selected, so that subsequent questions are more targeted, and the user's reading is more effective.
  • the electronic device updates the entity attribute database according to the entity name and entity attributes contained in the interaction history information; wherein, the interaction history information is the result of reading the target picture book on the electronic device
  • the electronic device receives speech information input by the user or action information of the user.
  • the electronic device can make the updated entity attribute library more in line with user needs, make human-computer interaction more targeted, and make reading deeper.
  • the electronic device collects the image of the picture book displayed by the user through a camera; the electronic device collects The image of the picture book is analyzed to determine the target picture book.
  • the electronic device can flexibly and accurately obtain the target picture book, so that the subsequent electronic device can accurately obtain the database related to the target picture book and enter the subsequent question and answer interaction process with the user.
  • the embodiments of the present application also provide an electronic device, which has the function of implementing the behavior of the electronic device in the method example of the first aspect.
  • the function can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions.
  • the structure of the electronic device includes a processing unit, an input unit, and an output unit. These units can perform the corresponding functions in the method example of the first aspect. For details, please refer to the detailed description in the method example. Do not repeat it.
  • the structure of the electronic device includes a processor and a communication unit, and may also include a memory.
  • the communication unit is used to interact with a user; the processor is configured to support the electronic device to perform the corresponding function in the above-mentioned method in the first aspect.
  • the memory is coupled with the processor, and stores the necessary program instructions and data of the electronic device.
  • the electronic device includes a processor and a memory connected to each other, and the processor is configured to read and execute program instructions stored in the memory, and execute any one of the possible options in the first aspect. The methods mentioned in the design.
  • an embodiment of the present application also provides an electronic device that has a function of implementing the behavior of the electronic device in the method example of the second aspect.
  • the function can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions.
  • the structure of the electronic device includes a processing unit and an output unit, and may also include an input unit. These units can perform the corresponding functions in the method example of the second aspect. For details, please refer to the detailed description in the method example , Do not repeat it here.
  • the structure of the electronic device includes a processor and a communication unit, and may also include a memory.
  • the communication unit is used to interact with a user; the processor is configured to support the electronic device to perform the corresponding function in the method of the second aspect.
  • the memory is coupled with the processor, and stores the necessary program instructions and data of the electronic device.
  • the electronic device includes a processor and a memory connected to each other, and the processor is configured to read and execute program instructions stored in the memory, and execute any one of the possible options in the second aspect. The methods mentioned in the design.
  • the embodiments of the present application also provide a computer-readable storage medium in which computer-executable instructions are stored, and the computer-executable instructions are used to make the computer executable when called by the computer.
  • the computer executes the method mentioned in any possible design in the first aspect or the second aspect.
  • the embodiments of the present application also provide a computer program product containing instructions, which when run on an electronic device, causes the electronic device to execute any of the possible designs in the first aspect or the second aspect.
  • the mentioned method when run on an electronic device, causes the electronic device to execute any of the possible designs in the first aspect or the second aspect.
  • an embodiment of the present application also provides an electronic device.
  • the electronic device may be a chip, and the chip is connected to a memory, and is used to read and execute the program instructions stored in the memory to implement the above-mentioned The method mentioned in any possible design in one aspect or in the second aspect.
  • Figure 1 is a schematic diagram of a main artificial intelligence framework provided by this application.
  • Figure 2 is a schematic diagram of an application scenario provided by this application.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by this application.
  • FIG. 4 is a flowchart of a question and answer interaction method based on picture books provided by this application.
  • FIG. 5 is a flowchart of another question and answer interaction method based on picture books provided by this application.
  • FIG. 6 is a schematic diagram of the transition probability between question templates provided by this application.
  • Figure 7 is a flow chart for updating the entity attribute database provided by this application.
  • Figure 8 is another flow chart for updating the entity attribute database provided by this application.
  • FIG. 9 is a schematic diagram of identifying a position in a picture book provided by this application.
  • FIG. 10 is a schematic diagram of a question and answer interaction process provided by this application.
  • FIG 11 is a schematic diagram of another question and answer interaction process provided by this application.
  • Figure 12 is a schematic diagram of a child's intention provided in this application.
  • FIG. 13 is a schematic diagram of a picture book provided by this application.
  • Figure 14 is a flow chart of a method for inquiring about purchasing goods provided by this application.
  • FIG. 15 is a schematic structural diagram of an electronic device provided by this application.
  • FIG. 16 is a structural diagram of an electronic device provided by this application.
  • the embodiment of the present application provides a question and answer interaction method based on a picture book and an electronic device, which are used to intelligently interact with a user during the process of reading the picture book by the electronic device.
  • the method and the electronic device described in this application are based on the same inventive concept. Since the method and the principle of the electronic device to solve the problem are similar, the implementation of the electronic device and the method can be referred to each other, and the repetition will not be repeated.
  • Figure 1 shows a schematic diagram of an artificial intelligence main framework, which describes the overall workflow of the artificial intelligence system and is suitable for general artificial intelligence field requirements.
  • Intelligent Information Chain reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has gone through the condensing process of "data-information-knowledge-wisdom".
  • Infrastructure provides computing power support for artificial intelligence systems, realizes communication with the outside world, and realizes support through the basic platform. Communicate with the outside through sensors; computing capabilities are provided by smart chips (CPU, NPU, GPU, ASIC, FPGA and other hardware acceleration chips); the basic platform includes distributed computing framework and network related platform guarantees and support, which can include cloud storage and Computing, interconnection network, etc. For example, sensors communicate with the outside to obtain data, and these data are provided to the smart chip in the distributed computing system provided by the basic platform for calculation.
  • smart chips CPU, NPU, GPU, ASIC, FPGA and other hardware acceleration chips
  • the basic platform includes distributed computing framework and network related platform guarantees and support, which can include cloud storage and Computing, interconnection network, etc. For example, sensors communicate with the outside to obtain data, and these data are provided to the smart chip in the distributed computing system provided by the basic platform for calculation.
  • the data in the upper layer of the infrastructure is used to indicate the data source in the field of artificial intelligence.
  • the data involves graphics, images, voice, and text, as well as IoT data of traditional devices, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
  • Data processing usually includes data training, machine learning, deep learning, search, reasoning, and decision-making. Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, training, etc.
  • Reasoning refers to the process of simulating human intelligent reasoning in a computer or intelligent system, using formal information to conduct machine thinking and solving problems based on reasoning control strategies. The typical function is search and matching.
  • Decision-making refers to the decision-making process of intelligent information after reasoning, and usually provides functions such as classification, ranking, and prediction.
  • Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. It is an encapsulation of the overall solution of artificial intelligence, productizing intelligent information decision-making and realizing landing applications. Its application fields Mainly include: smart manufacturing, smart transportation, smart home, smart medical, smart security, autonomous driving, safe city, smart terminal, etc.
  • Artificial intelligence has wide applications in many fields, such as human-computer question answering and interaction.
  • the question and answer interactive method based on picture books provided in this application belongs to the field of artificial intelligence.
  • the picture book-based question and answer interaction method provided by the embodiment of the application is applied to a picture book question and answer system.
  • question and answer are one question and one answer, and this type of question and answer usually includes two types: one is for people to ask the machine to answer, and the other is for machines to ask people to answer.
  • the question and answer interaction method based on picture books provided by the embodiments of the present application is generally the question and answer interaction between the child and the machine that occurs when the machine is reading the picture book for the child (ie, the user).
  • FIG. 2 shows a possible application scenario to which the picture book-based question and answer interaction method provided by an embodiment of the present application is applicable, and the application scenario may include a user and an electronic device. among them:
  • the electronic device may be a physical device with a voice output function.
  • the electronic device may be a smart terminal, such as a smart phone or smart terminal shown in FIG. 2; the electronic device may also be The wearable terminal or robot shown in FIG. 2.
  • the electronic device is not limited to the example shown in FIG. 2, but can also be other electronic devices, such as notebook computers, tablet computers, car computers, personal digital assistants (personal digital assistant, PDA), smart watches, personal computers ( (personal computer, PC), TV, etc.
  • the electronic device is not limited to the above-listed devices, and this application does not limit it.
  • the electronic device has at least the functions of receiving sound and voice, and outputting sound and voice.
  • the electronic device also has functions such as sound or voice analysis, semantic analysis, and speech synthesis. If the electronic device has the capabilities of data storage and data processing, in this application scenario Only the user and the electronic device can complete the question and answer interactive process on the picture book.
  • the electronic device can be connected to a server through a network, and the server completes the storage and processing of data, as shown in FIG. 2 .
  • the electronic device when the electronic device has the capability of data storage and data processing, in order to reduce the energy consumption of the electronic device, the electronic device can also be connected to a server via a network, and the server completes the storage and processing of data. There is no restriction on this.
  • the electronic device may also include a camera, which can be used to take picture books for reading picture books, or take pictures of children for subsequent image analysis and so on.
  • a camera which can be used to take picture books for reading picture books, or take pictures of children for subsequent image analysis and so on.
  • the electronic device when the electronic device is a robot or other device with movable parts, the electronic device can also interact with children more flexibly through limbs or movable parts, such as hugging, giving instructions and so on.
  • FIG. 2 may also include other devices, which are not shown here.
  • Fig. 3 shows a partial structural block diagram of the electronic device related to this embodiment.
  • the electronic device 300 may include: a communication unit 310, a power supply 320, a processor 330, a memory 340, an input unit 350, an output unit 360, an audio circuit 370 and other components.
  • a communication unit 310 may include: a communication unit 310, a power supply 320, a processor 330, a memory 340, an input unit 350, an output unit 360, an audio circuit 370 and other components.
  • the structure of the electronic device shown in FIG. 3 does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or a combination of certain components, or different component arrangements. .
  • the communication unit 310 may provide voice or data communication capabilities, and may provide a wired or wireless communication interface.
  • the communication unit 310 may include radio frequency (RF) transceiver components, global positioning system (global positioning system, GPS) transceiver components (for example, the RF circuit 311 shown in FIG. 3), and wireless fidelity (wireless fidelity, WiFi) components (for example, the WiFi module 312 shown in FIG. 3), some or all of other components, etc.; the communication unit 310 may also be software and hardware (for example, an antenna, a modulator/demodulator, an /Decoder, analog/digital processing circuit, etc.).
  • the RF circuit 311 can be used for receiving and sending data in the process of sending and receiving information or talking.
  • the RF circuit 311 receives the downlink data from the base station, it sends it to the processor 330 for processing; in addition, it sends the uplink data to be sent to the base station.
  • the RF circuit 311 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
  • the RF circuit 311 can also communicate with the network and other devices through wireless communication.
  • the wireless communication may use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (code division multiple access). division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
  • GSM global system of mobile communication
  • GPRS general packet radio service
  • code division multiple access code division multiple access
  • CDMA division multiple access
  • WCDMA wideband code division multiple access
  • LTE long term evolution
  • email short messaging service
  • SMS short messaging service
  • the audio circuit 370, the speaker 371, and the microphone 372 can provide an audio interface between the user and the electronic device 300.
  • the audio circuit 370 can transmit the electrical signal converted from the received audio data to the speaker 371, and the speaker 371 converts it into a sound signal for output; on the other hand, the microphone 372 converts the collected sound signal It is an electrical signal that is received by the audio circuit 370 and converted into audio data, and then the audio data is output to the RF circuit 310 for sending to, for example, another electronic device, or the audio data is output to the memory 340 for further processing .
  • WiFi is a short-distance wireless transmission technology.
  • the electronic device 300 can be connected to an access point (AP) through the WiFi module 312, thereby achieving data network access.
  • the WiFi module 312 can be used to receive and send data during communication with other devices.
  • the memory 340 can be used to store software programs and modules.
  • the processor 330 executes various functional applications and data processing of the electronic device 300 by running software programs and modules stored in the memory 340.
  • the memory 340 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, various application programs, etc.; the storage data area may store information according to the use of the electronic device 300 Data created, etc.
  • the processor 340 may also store static data (for example, images, etc.), rules, etc. required by the processor 330 and other modules.
  • the memory 340 may store the content of a picture book and a database related to the picture book.
  • the memory 340 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • memory 340 may be embodied in the electronic device 300 as shown in FIG. 3, and may also be implemented in a server (for example, a cloud server), etc., and it is only exemplified here as a part of the electronic device 300. But not as a limitation on memory.
  • the input unit 350 can be used to receive input digital, sound or character information, and generate key signal input related to user settings and function control of the electronic device 300.
  • the input unit 350 can receive and input a child's voice.
  • the input unit 350 may include a touch panel 351 and other input devices 352.
  • the touch panel 351 which can also be called a touch screen, can collect user touch operations on or near it (for example, the user uses a finger, a stylus, or any other suitable object or accessory on the touch panel 351 or touches it. The operation near the control panel 351), and drive the corresponding connection device according to the preset program.
  • the touch panel 351 may include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, and It is converted into contact coordinates, and then transmitted to the processor 330, and can receive and execute the command sent by the processor 330.
  • the touch detection device detects this signal brought about by this touch, and then transmits the signal to The touch controller, the touch controller then converts this signal into coordinates and sends it to the processor 330, and the processor 330 determines what is executed on the picture book catalog according to the coordinates and the type (touch) of the signal. Operate (select a picture book in the picture book catalog), and then the processor 330 will instruct to read the selected picture book.
  • the touch panel 351 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the other input device 352 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick.
  • function keys such as volume control buttons, switch buttons, etc.
  • the output unit 360 may be used to output various information for user interaction or provided to the user.
  • the output unit 360 may include a display unit 361, a vibration motor (which can be used to provide vibration feedback), and so on.
  • the display unit 361 can be used to display information input by the user, information provided to the user, and various menus of the electronic device 300.
  • the display unit 361 is the display system of the electronic device 300 for The interface is presented to realize human-computer interaction.
  • the input unit 350 receives a user's instruction requiring human-computer interaction, it transmits the instruction to the processor 330, and then the processor 330 displays the picture book through the display unit 361 according to the instruction ( Specifically, the picture book can be displayed through the display panel 3611, so that the user can see the picture book, and thus human-computer interaction can be realized.
  • the display unit 361 may include a display panel 3611.
  • the display panel 3611 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
  • the touch panel 351 can cover the display panel 3611, and when the touch panel 351 detects a touch operation on or near it, it is transmitted to the processor 330 to determine the type of touch event, Then the processor 330 provides corresponding visual output on the display panel 3611 according to the type of the touch event.
  • the touch panel 351 detects that the user clicks on it to select a picture book, it transmits it to the processor 330, and the processor 330 determines that the type of the touch event is a click, and displays it on the display panel 3611
  • the content of the corresponding picture book after being selected such as the picture in the selected picture book, etc., achieve the purpose of displaying the picture book.
  • the touch panel 351 and the display panel 3611 are used as two independent components to implement the input and input functions of the electronic device 300, but in some embodiments, the The touch panel 351 is integrated with the display panel 3611 to realize the input and output functions of the electronic device 300.
  • the processor 330 is the control center of the electronic device 300, and uses various interfaces and lines to connect various parts of the entire electronic device, and by running or executing software programs and/or modules stored in the memory 340, and calling
  • the data stored in the memory 340 executes various functions of the electronic device 300 and processes data, thereby realizing various services based on the electronic device 300.
  • the processor 330 may include one or more processing units; specifically, the processor 330 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, User interface and application programs, etc., the modem processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 330.
  • the processor 330 may include a display driving unit, and after the processor 330 generates a picture book, the display driving unit may control the display panel 3611 to present the contents of the picture book through the display driving unit.
  • a display driver program is stored in the memory 340, and the processor 330 may call the driver program in the memory 340 to control the display panel 3611 to present picture book content.
  • the electronic device 300 also includes the power source 320 (such as a battery) for supplying power to various components.
  • the power source 320 may be logically connected to the processor 330 through a power management system, so as to pass through the power management system. Realize the functions of managing charging, discharging, and power consumption.
  • the electronic device 300 may also include a camera, a Bluetooth module, a sensor, etc., which will not be repeated here.
  • the picture book-based question and answer interaction method provided by the embodiment of the application mainly includes two interactive processes: the child asks the electronic device and the electronic device answers the child's question; and the electronic device actively asks the child and the child answers the electronic device’s question.
  • the electronic device determines whether the child's answer is correct.
  • data processing and data storage are required.
  • the stored data involved in this embodiment is mainly a database related to picture books, and the specific database may include an entity attribute library, a grammar library, a word collection, and a calling function library.
  • the grammar library may also include a question template library and an answer template library.
  • the entity attribute library is used to store multiple entity names and multiple entity attributes related to the content of the picture book, and the multiple entity names correspond to the multiple entity attributes in a one-to-one correspondence, wherein the entity refers to the real world Objects or things that exist objectively and can be distinguished from each other.
  • Concrete entities often refer to a collection of certain types of things, which can be concrete people, things, abstract concepts, connections, etc.;
  • the problem template library is used to store A sentence template used to generate a question, that is, the question template library contains at least one question template, and each question template may include multiple slots;
  • the calling function library is used to store calling functions for obtaining answers based on questions, Set functions and parameters for each question template, and the function defines the path and rules corresponding to the answer to the question template from the database.
  • Each question template in the question template library may correspond to one or more calling functions in the calling function library;
  • the answer templates in the answer template library correspond to the calling functions in the calling function library one-to-one
  • the word set indicates the correspondence between a plurality of keywords and generalized words, and the generalized words include entities.
  • the database needs to be pre-established, pre-stored in the electronic device, and data processing by the electronic device, or pre-stored in a server connected to the electronic device, and the server assists in data processing.
  • the process of establishing the question template library can be as follows:
  • generalized words in the word set are used to replace the specific words in the problem sample to obtain the generalized problem sample, that is, the generalized problem.
  • generalization refers to the expansion of specific and individual to general, for example, generalization of hens to Entity.
  • the question template obtained can be (Entity)[ ⁇ ][What](Color), other question templates such as (Entity)[ ⁇ ][Where] and so on.
  • the problem templates in the established problem template library are shown in Table 2:
  • the question template is a combination of mandatory word set names, mandatory words, optional word set names, and optional words. Fill in the mandatory word set names or mandatory words in (), and fill in the optional word set names Or fill in the optional words in [], where the content in () and [] can be called the slots included in the question template.
  • the process of establishing the calling function library may be as follows:
  • the calling function may include functions and parameters, where the function defines the path and rules corresponding to the answer to the question template extracted from the entity attribute library, that is, the meaning of the function represented by the function, including the name of the table for extracting the answer. Extracted field names, etc.
  • the function expresses the user's intention.
  • the parameters correspond to the output of the problem template and provide constraints for the function.
  • the calling function corresponding to the above question template 1 can be:
  • the calling function corresponding to the question template 1 may be as shown in Table 3:
  • the establishment process of the answer template library is to set an answer template for each calling function.
  • the answer template corresponding to each calling function can be as shown in Table 4:
  • Embodiment 1 The child asks questions to the electronic device and the electronic device answers the specific method flow.
  • the electronic device may be any device shown in FIG. 2 or not shown that can implement the picture book-based question and answer interaction method provided in the embodiment of the present application, and the electronic device is applied to the device shown in FIG. 3 Electronic equipment.
  • the specific process of the method may include:
  • Step 401 The electronic device loads a database related to the target picture book.
  • the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set.
  • entity attribute library includes multiple entity names and multiple entity attributes, and the multiple entity names are related to The multiple entity attributes are in one-to-one correspondence
  • the question template library includes at least one question template
  • the call function library includes at least one call function
  • each question template in the question template library corresponds to the call function
  • One or more calling functions in the library each question template in the question template library includes multiple slots
  • the answer template library includes at least one answer template
  • the answer template in the answer template library is consistent with all the
  • the calling functions in the calling function library have a one-to-one correspondence
  • the word set indicates the correspondence between a plurality of keywords and generalized words, and the generalized words include entities.
  • the target picture book is a picture book that needs to be read by children.
  • the electronic device determines the target picture book based on a child's instruction.
  • the method for the electronic device to determine the target picture book may include Variety:
  • the electronic device asks the child which picture book the child wants to listen to. For example, the electronic device asks the child "Shall we read a story?", and the child answers "OK, I want to listen to the hen "Silk", after receiving the user's answer, the electronic device determines that the target picture book is "Hen Rose Going for a Walk” according to semantic analysis and matching.
  • the electronic device when the electronic device cannot perform data processing, the electronic device sends the child's answer received to the server, and the server performs semantic analysis and matching, and then after determining the target picture book, it will determine The result of notifying the electronic device, and then the electronic device knows that the target picture book is "Rose the Hen Going for a Walk" according to the determined result.
  • a picture book catalog can be displayed on the display touch screen, that is, multiple picture books are displayed for children to choose. Click the selected picture book to confirm the target picture book. For example, if the child clicks "Rose the Hen Going for a Walk" on the display touch screen, the electronic device determines that the target picture book is "Rose the Hen Going for a Walk".
  • the electronic device when the electronic device has a camera, for example, when the electronic device is a mobile phone, a robot with a touch screen, etc., the electronic device can collect information of the picture book displayed by the child through the camera. Image, the image of the collected picture book is analyzed by image analysis technology to determine the target picture book.
  • the electronic device when the electronic device cannot perform data processing, the electronic device sends the image of the picture book collected by the camera to the server, and the server analyzes the collected image of the picture book through image analysis technology. , And then after determining the target picture book, notify the electronic device of the determined result, and then the electronic device learns the target picture book according to the determined result.
  • the electronic device may determine the target picture book in multiple ways other than the above methods, which will not be listed here.
  • the target picture book is "Rose the Hen Going for a Walk" as an example.
  • the electronic device when the database is stored in the electronic device, the electronic device can directly load the database related to the target picture book from the memory or other modules of the electronic device; when the database is stored in the server In the middle, the electronic device needs to load the database related to the target picture book from the server.
  • the database acquired by the electronic device includes the entity attribute database.
  • the entity attribute library loaded by the electronic device locally or from a server may be as shown in Table 5:
  • Entity Entity attributes (Color) hen red Little bird yellow fox Brownish yellow ... ...
  • the entity names of the entities in Table 5 can be hen, bird, fox..., and the corresponding entity attributes of each entity name are red, yellow, brown....
  • the question template library and the calling function library included in the database related to the target picture book loaded by the electronic device may be as shown in Table 6:
  • Step 402 The electronic device receives the question raised by the child.
  • the electronic device when the electronic device reads the target picture book, when the electronic device receives the question posed by the child, it defaults that the child asked based on the target picture book, that is, the The children’s questions are considered to be related to the target picture book.
  • the electronic device may obtain the child's question through the input unit, and then transmit the child's question to the processor of the electronic device, so that the processor can analyze the child's question; or
  • the processor of the electronic device transmits the question raised by the child to a server, so that the server analyzes the question raised by the child.
  • the child inputs the question "What color is the hen?" to the electronic device through the microphone of the electronic device.
  • Step 403 The electronic device performs word segmentation processing on the question posed by the child to obtain a word segmentation string, and the word segmentation string is a plurality of keyword text sequences.
  • the electronic device performs word segmentation processing on the child's question, and divides the child's question into five words: "hen", “yes”, “what", “color”, and “of". For example, the word segmentation can be obtained. String “what color is the hen”.
  • Step 404 The electronic device obtains a generalized question according to the word segmentation word string and the word set, and the generalized question is a plurality of generalized word text sequences.
  • the electronic device generalizes the word segmentation word string problem based on the word set.
  • the electronic device matches the keywords in the word segmentation string through the word set (for example, Table 1) obtained during the construction of the question template library corresponding to the target picture book.
  • the word set for example, Table 1
  • “hen” has a corresponding key word in the word set is “hen”
  • "what” has a corresponding key word “what” in the word set
  • "color” has a corresponding key in the word set
  • the word is "color”.
  • Table 7 the marked keywords shown in Table 7:
  • Entity Entity Hen , rose, hen rose, fox, rake Property: Color Color , red, yellow, blue Common words: What What , what
  • the electronic device determines a generalized word corresponding to each keyword in the word segmentation string according to the word set. For example, the generalized word corresponding to "hen” is “Entity”, the generalized word corresponding to "What” is “What”, and the generalized word corresponding to "Color” is "Color”.
  • the generalized question obtained by the electronic device is "Entity is What Color”.
  • Step 405 The electronic device extracts the entity name corresponding to the question posed by the child from the generalized question, and the entity name corresponding to the question posed by the child is in the generalized question Keywords that are generalized into entities.
  • the entity name corresponding to the question asked by the child is extracted from the generalized question in step 404 as "hen".
  • Step 406 The electronic device obtains the question template to be asked from the question template library according to the text similarity between the generalized question and the question template in the question template library.
  • the electronic device may obtain the question template to be asked from the question template library according to the generalized question based on the method with the smallest edit distance.
  • the method for the smallest edit distance is: when the generalized question is modified into a question template, the question template with the least number of changes is the question template being asked.
  • the electronic device may also obtain the question template to be asked from the question template library in other ways, for example, matching the question template library according to the keywords in the generalized question As the question template in question, the question template with the highest matching rate is used as the question template.
  • the above methods are all implemented by using the text similarity between the generalized question and the question template in the question template library.
  • Step 407 The electronic device obtains the questioned call function from the call function library according to the matching degree between the slot of the question template and the parameter of the call function in the call function library.
  • the number and types of parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template.
  • the electronic device when the calling function library contains a calling function corresponding to the questioned question template, the electronic device directly uses this calling function as the calling function of the questioned. It should be understood here that the number and types of parameters of this calling function match the number and types of slots of the question template to the highest degree.
  • the electronic device compares the slots of the question template with the The matching degree of the parameters of the calling function in the calling function library is obtained, and the calling function in question is obtained from the calling function library.
  • the specific method may be: the electronic device obtains the number and type of parameters from the calling function library and the The calling function with the highest matching degree between the number of slots and the type in the question template being asked determines the call function being questioned corresponding to the question template being asked.
  • the number and types of parameters of a calling function match the number and types of slots in the question template to the highest degree, specifically referring to the parameters and slots of the same type in the calling function and the question template.
  • the number of bits is the largest.
  • calling the function getColor(Entity,What,Color) matches the question template (Entity)[ ⁇ ][What](Color) with the same type of parameters and the largest number of slots (there are 3 types of parameters) Matches the slot), therefore, it is determined that the calling function is the called function being questioned.
  • the parameter Entity in the calling function and the slot Entity in the question template are all of the same type, and the parameter What in the calling function and the slot What in the question template are both of the same type.
  • the parameter Color in the function and the slot Color in the question template are of the same type.
  • Step 408 The electronic device obtains the entity attribute corresponding to the entity name corresponding to the question posed by the child from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the child .
  • the entity name corresponding to the question posed by the child and the entity attribute corresponding to the entity name corresponding to the question posed by the child acquired by the electronic device may be used as the answer keywords to be answered.
  • the electronic device obtains the entity attribute corresponding to the entity name corresponding to the question posed by the child from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the child At the time, it is necessary to combine the meaning of the function represented by the function called by the question and the entity name corresponding to the question posed by the child, and obtain the entity attribute corresponding to the entity name corresponding to the question posed by the child from the entity attribute library . For example, the electronic device substitutes the name of the entity corresponding to the question posed by the child into the questioned calling function to obtain getColor (hen, what, color). The meaning of the getColor function is to query an entity in the entity attribute library. s color.
  • the color attribute of the entity name "hen” is “red”, so the entity attribute corresponding to the entity name corresponding to the question asked by the child is “red", that is, to be answered
  • the answer key word is "hen” and "red”.
  • Step 409 The electronic device obtains an answer template to be answered from the answer template library according to the called function of the question, where the answer template to be answered is an answer corresponding to the function of the question called in the answer template library template.
  • the electronic device may obtain from the answer template library that the answer template to be answered corresponding to the function called by the question is that the Entity is Color.
  • Step 410 Based on the answer template, the electronic device generates an answer to be answered by using the entity name corresponding to the question asked by the child and the entity attribute corresponding to the entity name corresponding to the question asked by the user.
  • the electronic device generates the answer to be answered by the entity name and entity attribute corresponding to the question asked by the child, that is, the electronic device generates the answer to be answered by the keyword of the answer to be answered.
  • the answer template for the answer to be answered is Entity is Color
  • the electronic device converts the entity name corresponding to the question posed by the child and the entity attribute corresponding to the entity name corresponding to the question posed by the user.
  • Answer key word) "hen” and “red” are combined into a sentence “hen is red” according to the answer template to be answered, that is, the answer to be answered is generated.
  • Step 411 The electronic device outputs the answer to be answered to the child.
  • the electronic device first synthesizes the answer to be answered into a voice, and plays the answer to be answered through the voice.
  • the electronic device plays the voice corresponding to the answer to be answered through a speaker.
  • the execution of the above steps 403 to 410 by the electronic device is based on the premise that the electronic device has data storage and data processing capabilities.
  • the electronic device does not have data storage and data processing capabilities.
  • the electronic device After the electronic device receives the child's question, it transmits the child's question to the server connected to the electronic device, and the server performs the operation of the electronic device in the above steps 403 to 410, Then, the server transmits the answer to be answered to the electronic device, so that the electronic device directly executes step 411.
  • the electronic device or server can flexibly determine the answer based on the database related to the target picture book according to the question asked by the child, and does not need to preset the answer to the question mechanically. You need to ask questions according to preset questions, you can ask questions flexibly, and the electronic device can answer more questions, so that the interaction between the electronic device and the child during the picture book reading process can be more intelligent, which can improve the effectiveness of reading picture books and enhance the children’s experience .
  • Embodiment 2 The electronic device asks the child a question and the child answers the specific method flow.
  • the electronic device may be any device shown in FIG. 2 or not shown that can implement the picture book-based question and answer interaction method provided in the embodiment of the present application, and the electronic device is applied to the device shown in FIG. 3 Electronic equipment.
  • the specific process of the method may include:
  • Step 501 The electronic device loads a database related to the target picture book.
  • the database includes an entity attribute library, a question template library, and a calling function library.
  • entity attribute library includes multiple entity names and multiple entity attributes, and the multiple entity names are one-to-one with the multiple entity attributes.
  • the question template library includes at least one question template
  • the call function library includes at least one call function
  • each question template in the question template library corresponds to one or more calls in the call function library Function
  • each question template in the question template library includes multiple slots.
  • step 501 is similar to step 401 in the foregoing embodiment, and reference may be made to each other for details, and details are not repeated here.
  • Step 502 The electronic device obtains a question template to be asked from the question template library according to the question template information, where the question template information is a transition probability set or a question template type, and the transition probability set includes historical question templates and all questions.
  • the transition probability between other question templates in the question template library, the historical question template is the question template acquired by the electronic device in the process of generating the last question posed to the user, and the historical question template is used to generate the upper A question template of a question posed to the user at a time, and the type of the question template is related to the age of the user.
  • the electronic device may randomly select a question template from the question template library as the question template to be asked.
  • the electronic device may still randomly select a question template from the question template library as the question template to be asked, or the The electronic device obtains the question template to be asked by the method in step 502.
  • Example 1 When the question template information is the transition probability set, the electronic device obtains the question template to be asked from the question template library according to the question template information.
  • the specific method may be: the electronic device The determined random value determines the target transition probability from the transition probability set; the electronic device obtains the question template to be asked from the question template library according to the target transition probability.
  • the random value is greater than a set threshold.
  • the random value may be a random number that is currently determined when the question template to be asked needs to be obtained; the random value may also be a value that is randomly selected and determined from a plurality of preset values. Of course, it can also be in other situations, which are not limited in this application.
  • Example 2 When the question template information is the question template type, the electronic device obtains the question template to be asked from the question template library according to the question template information.
  • the specific method may be: State the age of the user and the corresponding relationship between the age and the question template type to determine the target question template type; the correspondence indicates that the user's age corresponds to at least one of the following question template types: space, detail, society, color, number, text, nature;
  • the electronic device obtains a question template that meets the target question template type from the question template library as the question template to be asked.
  • the electronic device may use the question template acquired by the electronic device in the process of generating the last question posed to the child Obtaining the template of the question to be asked can achieve diversified questions, prevent children from feeling bored, and increase children's interest in picture book reading, thereby enhancing children's experience.
  • the transition probability between question templates the purpose of determining one question template based on another question template can be achieved. In this way, it is necessary to set the transition probability between question templates in advance when building the database. Among them, the transition probability between question templates with similar meanings is lower, and the transition probability between question templates with large meaning differences is higher.
  • the transition probability between every two question templates can be manually set in advance, and it can also be based on statistical methods to analyze the questions asked by the child, and calculate every two according to the number of question templates hit. Probability of transition between templates.
  • FIG. 6 shows a schematic diagram of transition probability between question templates.
  • the electronic device determines a random When the value is 0.34, the transition probability (that is, the target transition probability) close to 0.34 in the transition probability between the electronic device and the problem template 1 shown in FIG. 6 (that is, the transition probability set) is 0.34 ; Then the electronic device can determine a question template with a transition probability of 0.34 between the question template 1 and at this time, it can be seen from FIG. 6 that the question template 2 in FIG. 6 can be used as the question template to be asked.
  • the transition probability that is, the target transition probability
  • the type setting for the question templates in the question template library can also be performed. Because a certain period in the process of children's psychological development is easier to learn certain knowledge and behavior than other periods, a certain aspect of the psychological process develops most rapidly, this period is called the "sensitive period".
  • the sensitive period theory was put forward by the Italian educator Montaigne. The sensitive period is not only a critical period for children's learning, but also affects the development of their soul and personality.
  • the 31 sensitive periods experienced by children aged 0-9 include muscle sensitivity period: 1-3 years old; sensitive period interested in subtle things: 1.5-4 years old; language sensitivity period: 1.5-2.5 years old; society Standard sensitive period: 2 and a half to 4 years old; Space sensitive period: 3-4 years old; Color sensitive period: 3-4 years old; Mathematical concept sensitive period: 4.5 years old to 7 years old; Recognition sensitive period: 5 years old to 7 years old Years old; animals and plants, scientific experiments, collection sensitive period: 6-7 years old; cultural sensitive period: 6-9 years old, etc. Asking questions according to the developmental stage of children can more effectively promote the growth of children.
  • the question template type can be set for the question template, and the matching table between the question template type and the child’s age (also understood as the child’s development stage or the child’s age group) is stored in the database.
  • the child is at the corresponding age (development stage or Age group)
  • Table 8 shows the corresponding relationship between children's age (developmental stage or age group) and question template types:
  • Table 9 shows the type of question template, the corresponding relationship between examples of question templates and examples of questions:
  • Question template type Example of question template Examples of problems space (Entity)[ ⁇ ][Where] Where is the hen? detail (Entity)(position) has [What] What's behind the hen? society (Entity)[and][Entity][ ⁇ ][What](Relation) What is the relationship between Page and George? color (Entity)[ ⁇ ][What](Color) What color is a fox? digital Have [quantifier] (Entity) How many little pigs are there? Text [This is][What] What is this word? natural [This is][What][Entity] What kind of animal is this? culture [Do you know the history of](Entity)[] Do you know the history of the Great Wall?
  • the age (or age group) of the child can be set through the setting software on the electronic device (for example, an App that controls the robot on a mobile phone) to determine the corresponding question template type.
  • a man-machine interface for setting the problem template type can also be provided, so that parents can directly set the problem template type on the software.
  • some children’s sensitive periods do not correspond to specific question template types, but can correspond to the frequency of questions asked by electronic devices, such as the language sensitive period of 1.5-2.5 years old, which can improve every page Or the frequency of questions in each picture book.
  • the method of determining the question template based on the frequency is similar to the method of determining the question template based on the type of the question template, and will not be described in detail here.
  • selecting an appropriate question template according to the child's age (developmental stage or age group) can make the questioning more targeted and make the child's reading more effective.
  • Step 503 The electronic device obtains the calling function to be asked from the calling function library according to the matching degree between the slot of the question template to be asked and the parameter of the calling function in the calling function library.
  • the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked.
  • the electronic device when the calling function library contains a calling function corresponding to the question template to be asked, the electronic device directly uses this calling function as the calling function to be asked. It should be understood here that the number and types of parameters of this calling function match the number and types of slots of the question template to be asked to the highest degree.
  • the electronic device compares the slots of the question template with the The matching degree of the parameters of the calling function in the calling function library is obtained, and the calling function to be questioned is obtained from the calling function library.
  • the specific method may be: the electronic device obtains the number and type of parameters from the calling function library and the The calling function with the highest matching degree between the number of slots and the type in the question template to be asked is determined, the calling function to be asked corresponding to the question template to be asked is determined.
  • the specific implementation method with the highest degree of matching between the number and type of parameters of a calling function and the number and types of parameters in the question template to be asked is the same as the number and types of parameters of a calling function in step 407 above.
  • the number and type of the parameters in the question template have the highest degree of matching.
  • the specific implementation methods are similar, and can be referred to each other, and will not be described in detail here.
  • Step 504 The electronic device obtains the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked.
  • the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked can be understood as question keywords.
  • the electronic device when the electronic device obtains the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked, it needs to Combining the meaning of the function represented by the calling function to be asked, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked are obtained from the entity attribute library.
  • the question template to be asked is (Entity)[ ⁇ ][Where]
  • the question template to be asked is (Entity)[ ⁇ ][ What] (Color)
  • the question template to be asked is (Color)[ ⁇ ][What]
  • the entity attribute corresponding to the question template to be asked needs to be obtained.
  • Step 505 Based on the question template to be asked, the electronic device generates the question to be asked by the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked.
  • the electronic device generates the question to be asked based on the question key word template based on the question to be asked template.
  • the electronic device generates, based on the question template to be asked, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked (that is, the question keywords)
  • the questions to be asked can be as shown in the questions in Table 10:
  • Step 506 The electronic device outputs the question to be asked to the child, that is, the electronic device asks the child a question.
  • the electronic device first synthesizes the question to be asked into a voice, and plays the question to be asked through the voice.
  • the electronic device plays the voice corresponding to the question to be asked through a speaker.
  • Step 507 The electronic device extracts the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the question to be asked from the question to be asked.
  • the electronic device may extract the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the question to be asked according to the question to be asked in the above table 10. For example, when the question to be asked is "(hen)[at][where]", the entity name "hen” corresponding to the question to be asked can be extracted. For another example, when the question to be asked is "(red)[Yes][what]”, the entity attribute "red” corresponding to the question to be asked can be extracted. For another example, when the question to be asked is "(hen) [Yes] [what] (color)", the entity name "hen” corresponding to the question to be asked can be extracted.
  • Step 508 The electronic device obtains the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library according to the calling function to be asked and the entity name corresponding to the question to be asked, or The electronic device obtains the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library according to the calling function to be asked and the entity attribute corresponding to the question to be asked.
  • the electronic device may retrieve from the entity attribute database Obtain the entity attribute "red” corresponding to the entity name corresponding to the question to be asked. For another example, when the question to be asked is "(red) [Yes] [what]", when the entity attribute "red” corresponding to the question to be asked is extracted, the electronic device can obtain all the attributes from the entity attribute database. State the entity name "hen” corresponding to the entity attribute corresponding to the question to be asked.
  • the question to be asked is "(fox)[how][do not wear](clothes)"
  • the entity name "fox” corresponding to the question to be asked and the entity attribute "clothes” corresponding to the question to be asked are extracted.
  • the electronic device may obtain the entity attribute "full body plush” corresponding to the entity name corresponding to the question to be asked from the entity attribute database.
  • Step 509 The electronic device obtains an answer template to be determined from an answer template library according to the calling function to be asked, where the answer template to be determined is an answer template corresponding to the calling function to be asked in the answer template library.
  • the database further includes an answer template library, the answer template library includes at least one answer template, and the answer templates in the answer template library correspond to the calling functions in the calling function library in a one-to-one correspondence.
  • Step 510 Based on the to-be-determined answer template, the electronic device generates the to-be-determined answer key word.
  • the key of the answer to be determined is any one of the following: the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity name corresponding to the question to be asked, and the entity corresponding to the question to be asked.
  • the electronic device will send the entity name "hen” corresponding to the question to be asked and the name of the entity to be asked
  • the entity attribute “red” corresponding to the entity name corresponding to the question generates the answer to be determined “the hen is red”.
  • the electronic device when the question to be asked is "(red) [Yes] [what]", the electronic device generates the entity name "hen” corresponding to the entity attribute corresponding to the question to be asked to be determined The answer is "hen”, or the electronic device generates the entity name "hen” corresponding to the entity attribute corresponding to the question to be asked and the entity attribute "red” corresponding to the question to be asked to generate the answer to be determined” The red ones have hens".
  • Step 511 The electronic device receives the child's answer to the question to be asked.
  • Step 512 The electronic device compares and analyzes the child's answer to the question to be asked and the answer to be determined to obtain a judgment result of whether the child's answer is correct.
  • the electronic device compares the keywords in the child's answer with the keywords in the answer to be determined, and judges whether the child's answer is correct based on the comparison result, and obtains whether the judgment result is correct or incorrect.
  • Step 513 The electronic device performs a corresponding operation on the child according to the judgment result.
  • the electronic device may play the judgment result through a loudspeaker. For example, when the judgment result is correct, the electronic device may play "correct answer", or it may also play a voice with the same meaning, such as "Too Okay, you got it right” Wait.
  • the electronic device performing the above steps 502-505, 507-510, and 512 is based on the premise that the electronic device has data storage and data processing capabilities, when the electronic device does not have data storage And data processing capabilities, when the electronic device determines that it needs to ask a child a question, it triggers the server to perform the operations in step 502-step 505 and step 507-step 510, and the server transmits the determined question to be asked to the electronic device. Device, and then the electronic device asks the child a question. After receiving the child’s answer, it transmits the child’s answer to the server so that the server executes the judgment process in step 512, and then the server sends the judgment The result is transmitted to the electronic device, and the electronic device continues to perform step 513.
  • the electronic device or server can generate the questions and answers to be asked according to the database related to the target picture book, and there is no need to preset the question and answer pairs mechanically, and the electronic device does not Ask the user mechanically according to the preset questions, which can make the electronic device ask questions and the user's answer more flexibly during the picture book reading process, thereby making the interaction between the electronic device and the child smarter during the picture book reading process, and can improve the effectiveness of reading , To enhance children's experience.
  • the question and answer interaction process described in the above embodiment can be applied to the question and answer interaction between an electronic device and a child.
  • the electronic device may have a voiceprint recognition module, and a human-machine interface for user voiceprint recognition may be provided in the setting software of the electronic device.
  • the user specifies the user in which role the different voice corresponds to through the man-machine interface, and determines the corresponding relationship between the voiceprint and the role, such as the roles of parents, teachers, and children.
  • the electronic device can record a conversation history within a preset period of time. For questions that the parent or teacher has already asked, the corresponding question template is no longer selected.
  • the electronic device can first continuously detect the user's voice input. Through voiceprint recognition and semantic analysis, the electronic device can determine whether the child’s questions have been answered by the parent or teacher. If the child’s question exceeds a certain time threshold and the parent or teacher has not received a valid answer (wrong answer or no answer), the electronic device will then execute the follow-up process of answering the user’s question.
  • the question and answer interaction process involved in the foregoing embodiment is generally established in a scenario where the entity attribute library of the stored picture book is fixed.
  • the electronic device may also update the (at least one) entity name and (at least one) entity attribute contained in the interaction history information between the electronic device and the child during the process of reading the target picture book by the electronic device The entity attribute library.
  • the electronic device updates the entity attribute database according to the entity name and entity attribute contained in the interaction history information, which can be divided into the following two cases: In the first case, the interaction history information is in the electronic When the device reads the target picture book, the electronic device receives the speech information input by the child; in the second case, the interaction history information is that the electronic device reads the target picture book during the process of reading the target picture book. The electronic device receives the action information of the child.
  • the interaction history information is in the electronic When the device reads the target picture book, the electronic device receives the speech information input by the child; in the second case, the interaction history information is that the electronic device reads the target picture book during the process of reading the target picture book.
  • the electronic device receives the action information of the child.
  • the specific method flow for updating the entity attribute database may include the following steps:
  • Step 701 The electronic device obtains the child's speech information received during the process of reading the target picture book by the electronic device, and extracts the entity name (at least one) and the entity ( At least one) attribute.
  • the electronic device recognizes that the child has said a sentence: “The rabbit of Tongtong’s family is called Xiaobei”. Through semantic analysis, the electronic device can determine that an entity name in the sentence is "rabbit” and the synonym of the entity name is " ⁇ ".
  • Step 702 The electronic device judges whether there is a corresponding entity name in the existing entity attribute library, if there is a corresponding entity name, step 703 is executed, otherwise, step 704 is executed.
  • the electronic device judges that there is an entity name "rabbit” in the existing entity attribute database, and it has a Food attribute of "green vegetables", for example, as shown in Table 11, the existing entity can be judged at this time A certain entity name exists in the property library.
  • Entity Entity attribute Food rabbit vegetables
  • Step 703 The electronic device judges whether there is an entity attribute corresponding to the entity name in the existing entity attribute database, if there is an entity attribute corresponding to the entity name, it ends, otherwise, step 705 is executed.
  • Step 704 The electronic device updates the entity name and entity attributes to the existing entity attribute database to obtain the updated entity attribute database.
  • the electronic device updates the entity name "rabbit” and entity attribute (alias alias) "Xiaobei" into the existing entity attribute database.
  • the updated entity attribute database may be as shown in Table 12:
  • Entity Entity attributes alias rabbit Beckham
  • Step 705 The electronic device updates the entity attribute to the existing entity attribute database to obtain the updated entity attribute database.
  • the electronic device can obtain from Table 11 that the entity attribute (alias) "Xiaobei" does not exist in the existing entity attribute database, and the entity attribute is updated to the existing entity attribute database.
  • the updated entity attribute library is shown in Table 13:
  • Entity Entity attribute Food Entity attributes: alias rabbit vegetables Beckham
  • the electronic device when the electronic device asks the child again, it can generate a personalized question.
  • the question template Entity[ ⁇ ][What](Food)
  • the generated question should be "What does the rabbit eat”
  • the updated entity attribute library is used to generate the question. It is "what does Beckham eat”.
  • the questions generated by the above methods, combined with the children’s question and answer interaction process, can effectively strengthen the children’s acceptance of the questions.
  • the electronic device may be an electronic device having a camera and a display screen. Because some children are accompanied by physical movements (for example, pointing their fingers at the content of the picture book) when they listen to the picture book and read. The electronic device can obtain the indicated position of the child's finger on the picture book, thereby obtaining the position attribute of the entity on the picture book. Through this process, the electronic device can establish the corresponding relationship between the entity and its position in the picture book, thereby updating the entity attribute database.
  • the specific method flow for updating the entity attribute database may include the following steps:
  • Step 801 In the process of reading the target picture book, the electronic device receives the child's voice input and converts the voice into text.
  • the child when a child is listening to the target picture book and sees a dragonfly in the target picture book displayed on the display screen of the electronic device, the child will input the voice "here is a dragonfly" into the electronic device.
  • Step 802 The electronic device extracts the entity name and entity attributes from the text.
  • the electronic device extracts an entity name "Dragonfly” and an entity attribute "here” from "Here is a dragonfly”.
  • Step 803 The electronic device judges whether the entity attribute is a location pronoun, if it is, execute step 804, otherwise it ends.
  • Step 804 The electronic device recognizes the position where the child's finger points in the picture book, that is, the electronic device receives the child's action information.
  • the electronic device can use the method of edge detection and closed figure detection to determine the range of drawing the pages of the book (for example, the left picture in Fig. 9), and establish the quadrants of the book pages to obtain the upper and lower edges of the book pages. , Left, right, top left, top right, bottom left, bottom right, etc. (for example, the middle image in Figure 9).
  • the middle image in Figure 9 Through image recognition, you can also determine the child's finger and the corresponding object on the book page (the right image in Figure 9 shows a dragonfly).
  • the electronic device can determine that the child is pointing below the picture book in the picture book, that is, there is a dragonfly under the picture book.
  • Step 805 The electronic device updates the determined position in the picture book as the orientation attribute of the entity to the existing entity attribute database to obtain the updated entity attribute database.
  • the electronic device obtains the corresponding relationship between the entity name "Dragonfly" and “under the picture book”, and then updates "under the picture book” as the orientation attribute to the existing entity attribute database.
  • the updated entity attribute database can be as Table 14 shows:
  • Entity Entity attribute: position dragonfly Below the picture book
  • the subsequent electronic device can ask children questions flexibly. For example, after the electronic device recognizes the entity with the orientation attribute, it can be based on the question template [Let’s see See](where)[ ⁇ ](what) generates the question "Let's see what's below?”. In this way, you can make more use of the information in the picture book and make reading more in-depth.
  • steps 701 to 705 can be implemented by a server connected to the electronic device; and the electronic device in the embodiment shown in FIG. 8 can transmit the voice to the server after receiving the user's voice, and The acquired images of children pointing to the picture book are transmitted to the server, and the server completes the data processing process to update the entity attribute database.
  • the electronic device can further update the entity attribute database according to the life experience of the child. For example, when the electronic device has a camera, permission settings can be used to enable the setting software of the electronic device to obtain images/videos in the installed electronic device gallery, through image analysis, geographic location information carried by the image, etc. , Or get the notebooks related to parenting notes in electronic device note-taking software (such as Evernote) (which can be set by the user), etc., analyze the places that children have visited, what they have seen, and correspond to the question template.
  • electronic device note-taking software such as Evernote
  • the electronic device determines that the child has gone to the xx science and technology museum based on the geographic location carried in the photo in the today's gallery (of course it can be another name, here is just an example), and further determines that the child takes a photo with the dinosaur (model) through image analysis. This can update the entity attribute database as shown in Table 15:
  • Entity Entity attribute experience(Place) Entity attributes: experience(Entity) dinosaur XX Science and Technology Museum Brachiosaurus
  • the electronic device when the electronic device reads the picture book "Dinosaur Land", the electronic device (or server) can select the problem template related to the experience attribute in step 503 according to the updated entity attribute library, [ The baby has been to](Entity.position), [also seen](Entity), [is][What](Entity)? , And then asked the children, "The baby has also been to the xx science and technology museum and has seen dinosaurs. Which one is it?". When reading picture books are combined with children’s own life experiences, children’s understanding will be more effective because they have personal experience.
  • the electronic device is only output based on voice.
  • some electronic devices have display functions, such as electronic devices with display screens (mobile phones, etc.).
  • the text corresponding to the voice that is, all the The electronic device displays the answer to be answered through the display screen
  • some electronic devices have movable parts, such as robots with limbs.
  • the electronic device’s voice output can also add the action output of the movable parts ( That is, the electronic device controls the movable part to perform the action of outputting the answer to be answered); there are also some electronic devices that have both a display function and a movable part, for example, a robot with a display screen.
  • the electronic device voices The output can also be combined with the display and the actions of movable parts.
  • the above-mentioned various outputs can be realized by the processor control of the electronic device, and can also be realized by establishing the display/action control instruction function of the calling function in the calling function library.
  • the calling function contains display/action control instructions.
  • the call function getColor(Entity,What,Color) used to answer the color further includes the control command display(Entity,Color) to display the color.
  • the database can further store images/videos. By setting the entity name and entity attribute tags for these images/videos, the electronic device can display pictures related to the entity name and the entity attribute on the screen.
  • the child asks the question "What color is the polar bear?".
  • the electronic device obtains the answer to be answered.
  • the polar bear is white
  • the corresponding entity name is determined to be "polar bear”
  • the entity attribute is determined to be "white”
  • the corresponding entity name and entity attribute label are searched in the image/video stored in the database to obtain the result shown in Figure 10.
  • the picture shown is displayed on the display screen of the electronic device.
  • the call function (Entity)[ ⁇ ][Where] used to answer the position further includes the action control instruction raise_hand()point_to(Entity.position), which corresponds to the electronic device Movements of movable parts (such as robots) (such as body movements), such as raising hands, pointing (somewhere), etc.
  • raise_hand()point_to(Entity.position) corresponds to the electronic device Movements of movable parts (such as robots) (such as body movements), such as raising hands, pointing (somewhere), etc.
  • the electronic device can determine the location of the entity name and point to the location with a limb.
  • the child asks the question "Where is the dragonfly?", after the process of determining the answer to be answered described in the embodiment shown in Figure 4, and according to the determination that the corresponding entity name is "Dragonfly ", according to the confirmation question template (Entity) [in][Where], and according to the entity attribute library with orientation attribute described in the updated entity attribute library, the position of the entity name is determined to be "below", and then according to the answer
  • the position call function (Entity)[in][Where] includes the action control instructions, the electronic device (robot) executes the control instructions of "raise hand” and "point to (below the picture book)" to move the movable parts (movable limbs) Point to the position of the dragonfly on the picture book.
  • the robot can also be linked with other apps.
  • an interface with an e-commerce app can be provided in the setting software of an electronic device to call product search and purchase functions.
  • products can be matched through image recognition.
  • the back cover of many picture books will have recommendations of other books in the same series, works by the same author, books from the same publisher, etc.
  • the child’s intention diagram is to determine the name of the book through product matching, and search for it through the product search interface provided by the e-commerce App Commodities, thus asking the user if they want to buy.
  • the picture book shown in Figure 13 there is a specific animated image on the cover. Through image recognition, it can be determined that the image is "Super Pan", and children’s voice input "I want a Super Pan toy” can be recognized. It is considered that the child has a purchase intention, the name of the product is determined through product matching, and the product is searched through the product search interface provided by the e-commerce App, thereby asking the user whether to buy.
  • the method may specifically include the following steps:
  • Step 1401 Determine the purchase intention.
  • Step 1402 Determine the product search keywords.
  • [Entity] in children's input can be directly used as a search keyword. For example, in the above example, "I want a Super Flying Man toy”, then “Super Flying Man toy” is determined as the product search key.
  • the camera can also obtain images, perform image analysis, and determine the objects that appear in the image.
  • Books, characters, and animated images shown in dashed boxes in the two figures shown in Figure 12 and Figure 13 can also be It can be animals, plants, objects, etc.
  • image recognition to determine the location of the child's finger, whether it points to the above object. This step can further enhance the accuracy of product keywords.
  • Step 1403 Search for the product, return the search result to the child, and ask the child if he wants to buy it.
  • the electronic device also provides a product purchase function to directly search for the product, or the electronic device calls the product search interface of the e-commerce App to search.
  • children are used for description. It is understandable that a child is only a user and is not limited to a child.
  • an embodiment of the present application also provides an electronic device.
  • the electronic device is used to implement the picture book-based question and answer interaction method provided by the embodiment of the present application.
  • the electronic device 1500 may include: a processing unit 1501, an input unit 1502, and an output unit 1503.
  • the electronic device shown in FIG. 15 may be used to perform operations of the electronic device in the picture book-based question and answer interaction method shown in FIG. 4. specific:
  • the processing unit 1501 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set.
  • the entity attribute library contains multiple Entity names and entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, the call function library includes at least one call function, the Each question template in the question template library corresponds to one or more call functions in the call function library, each question template in the question template library includes multiple slots, and the answer template library includes at least one The answer template, the answer template in the answer template library corresponds to the call function in the call function library one-to-one, the word set indicates the correspondence between multiple keywords and generalized words, and the general Anagrams include entities;
  • the input unit 1502 is used to receive questions raised by users
  • the processing unit 1501 is further configured to perform word segmentation processing on the question posed by the user to obtain a word segmentation string, the word segmentation string being a plurality of keyword text sequences;
  • the entity name corresponding to the question posed by the user is extracted from the generalized question, and the entity name corresponding to the question posed by the user is the keyword that is generalized to the entity in the generalized question ;
  • the output unit 1503 is configured to output the answer to be answered to the user.
  • the user can flexibly determine the answer based on the database related to the target picture book according to the user’s question. There is no need to mechanically preset the question and answer. The user does not need to ask the question according to the preset question, and can ask the question flexibly.
  • the electronic device can also answer more questions, so that the interaction between the electronic device and the user during the picture book reading process can be more intelligent, and the effectiveness of reading can be improved.
  • the number and types of parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template.
  • the processing unit 1501 is further configured to: update the entity attribute database according to the entity name and entity attribute contained in the interaction history information; wherein, the interaction history information is In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
  • the electronic device further includes a camera for collecting images of the picture book displayed by the user
  • the processing unit 1501 is further used for loading a database related to the target picture book Previously, the image of the picture book displayed by the user was collected through the camera, and the image of the collected picture book was analyzed by image analysis technology to determine the target picture book.
  • the electronic device further includes a display screen
  • the processing unit 1501 is further configured to: when the output unit 1503 outputs the answer to be answered to the user, pass the The display screen displays the answer to be answered.
  • the electronic device further includes movable parts
  • the processing unit 1501 is further configured to: when the output unit 1503 outputs the answer to be answered to the user, control the The movable component performs an action of outputting the answer to be answered.
  • the electronic device shown in FIG. 15 may be used to perform operations of the electronic device in the picture book-based question and answer interaction method shown in FIG. 5. specific:
  • the processing unit 1501 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, and a calling function library, and the entity attribute library includes multiple entity names and multiple entity attributes ,
  • the multiple entity names correspond to the multiple entity attributes one-to-one
  • the question template library includes at least one question template
  • the call function library includes at least one call function
  • each question template library One question template corresponds to one or more call functions in the call function library, and each question template in the question template library includes multiple slots;
  • the historical question template is a question template obtained by the electronic device in the process of generating the question posed to the user last time, and the question template type is related to the age of the user;
  • the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked are generated to generate the question to be asked;
  • the output unit 1503 is configured to output the question to be asked to the user.
  • the database further includes an answer template library, the answer template library includes at least one answer template, the answer template in the answer template library and the call function in the call function library
  • the numbers correspond to each other; the processing unit 1501 is also used for:
  • the call function to be asked and the entity name corresponding to the question to be asked obtain the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library, or call according to the question to be asked Function and the entity attribute corresponding to the question to be asked, obtaining the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library;
  • the to-be-determined answer keyword is generated to generate a to-be-determined answer
  • the to-be-determined answer keyword is any of the following: the entity attribute corresponding to the entity name corresponding to the question The entity name corresponding to the question to be asked and the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the question to be asked The entity name corresponding to the corresponding entity attribute.
  • the electronic device further includes:
  • the input unit 1502 is configured to receive the user's answer to the question to be asked;
  • the processing unit 1501 is further configured to: compare and analyze the user's answer to the question to be asked and the answer to be determined to obtain a judgment result of whether the user's answer is correct; The user makes the corresponding operation.
  • the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked.
  • the processing unit 1501 is specifically configured to obtain the question template to be asked from the question template library according to the question template information :
  • the processing unit 1501 specifically uses the question template to be asked from the question template library according to the question template information. in:
  • the processing unit 1501 is further configured to: update the entity attribute database according to the entity name and entity attributes contained in the interaction history information; wherein, the interaction history information is in the In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
  • the electronic device further includes: a camera for collecting images of the picture book displayed by the user;
  • the processing unit 1501 is further configured to collect an image of the picture book displayed by the user through a camera before loading the database related to the target picture book; analyze the collected image of the picture book by image analysis technology to determine the Target picture book.
  • the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • 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 technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including a number of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .
  • the embodiments of the present application also provide an electronic device that can implement the picture book-based question and answer interaction method provided in the embodiments of the present application.
  • the electronic device 1600 includes a communication unit 1601 and a processor 1602, and optionally may also include a memory 1603, where:
  • the processor 1602 may be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP, and so on.
  • the processor 1602 may further include a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
  • CPLD complex programmable logic device
  • FPGA field-programmable gate array
  • GAL generic array logic
  • the communication unit 1601 and the processor 1602 are connected to each other.
  • the communication unit 1601 and the processor 1602 are connected to each other through a bus 1604;
  • the bus 1604 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. .
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in FIG. 16, but it does not mean that there is only one bus or one type of bus.
  • the memory 1603 is coupled with the processor 1602 for storing programs and the like.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory 1603 may include RAM, or may also include non-volatile memory, such as at least one disk memory.
  • the processor 1602 executes the application program stored in the memory 1603 to realize the above-mentioned functions, thereby realizing the function of the electronic device, that is, realizing the question and answer interactive method based on the picture book.
  • the electronic device shown in FIG. 16 may be used to perform operations of the electronic device in the embodiment shown in FIG. 4 above. specific:
  • the processor 1602 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set.
  • the entity attribute library includes multiple Entity names and multiple entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, and the calling function library includes at least one calling function, Each question template in the question template library corresponds to one or more call functions in the call function library, each question template in the question template library includes a plurality of slots, and the answer template library contains At least one answer template, the answer templates in the answer template library correspond to the calling functions in the calling function library, and the word set indicates the correspondence between multiple keywords and generalized words, so
  • the generalized words include entities;
  • the communication unit 1601 is configured to receive questions raised by the user;
  • the processor 1602 is further configured to perform word segmentation processing on the question posed by the user to obtain a word segmentation string, where the word segmentation string is a plurality of keyword text sequences;
  • the entity name corresponding to the question posed by the user is extracted from the generalized question, and the entity name corresponding to the question posed by the user is the keyword that is generalized to the entity in the generalized question ;
  • the communication unit 1601 is also used to output the answer to be answered to the user.
  • the user can flexibly determine the answer based on the database related to the target picture book according to the user’s question. There is no need to mechanically preset the question and answer. The user does not need to ask the question according to the preset question, and can ask the question flexibly.
  • the electronic device can also answer more questions, so that the interaction between the electronic device and the user during the picture book reading process can be more intelligent, and the effectiveness of reading picture books can be improved.
  • the number and types of parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template.
  • the processor 1602 is further configured to: update the entity attribute database according to the entity name and entity attribute contained in the interaction history information; wherein, the interaction history information is In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
  • the electronic device 1600 further includes a camera for collecting images of the picture book displayed by the user, and the processor 1602 is further used for loading a picture book related to the target Before the database, the image of the picture book displayed by the user is collected through the camera, and the collected image of the picture book is analyzed by image analysis technology to determine the target picture book.
  • the electronic device 1600 further includes a display screen
  • the processor 1602 is further configured to: when the communication unit 1601 outputs the answer to be answered to the user, pass the The display screen displays the answer to be answered.
  • the electronic device 1600 further includes movable components
  • the processor 1602 is further configured to: when the communication unit 1601 outputs the answer to be answered to the user, control The movable part performs an action of outputting the answer to be answered.
  • the electronic device shown in FIG. 16 may be used to perform operations of the electronic device in the picture book-based question and answer interaction method shown in FIG. 5. specific:
  • the processor 1602 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, and a calling function library, and the entity attribute library includes multiple entity names and multiple entity attributes ,
  • the multiple entity names correspond to the multiple entity attributes one-to-one
  • the question template library includes at least one question template
  • the call function library includes at least one call function
  • each question template library One question template corresponds to one or more call functions in the call function library, and each question template in the question template library includes multiple slots;
  • the historical question template is a question template obtained by the electronic device in the process of generating the question posed to the user last time, and the question template type is related to the age of the user;
  • the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked are generated to generate the question to be asked;
  • the communication unit 1601 is configured to output the question to be asked to the user.
  • the database further includes an answer template library, the answer template library includes at least one answer template, the answer template in the answer template library and the call function in the call function library
  • the numbers correspond to each other; the processor 1602 is also used for:
  • the call function to be asked and the entity name corresponding to the question to be asked obtain the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library, or call according to the question to be asked Function and the entity attribute corresponding to the question to be asked, obtaining the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library;
  • the to-be-determined answer keyword is generated to generate a to-be-determined answer
  • the to-be-determined answer keyword is any of the following: the entity attribute corresponding to the entity name corresponding to the question The entity name corresponding to the question to be asked and the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the question to be asked The entity name corresponding to the corresponding entity attribute.
  • the communication unit 1601 is further configured to receive the user's answer to the question to be asked;
  • the processor 1602 is further configured to: compare and analyze the user's answer to the question to be asked with the answer to be determined to obtain a judgment result of whether the user's answer is correct; The user makes the corresponding operation.
  • the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked.
  • the processor 1602 is specifically configured to obtain the question template to be asked from the question template library according to the question template information. :
  • the processor 1602 specifically uses the question template to be asked from the question template library according to the question template information. in:
  • the processor 1602 is further configured to: update the entity attribute database according to the entity name and entity attribute contained in the interaction history information; wherein, the interaction history information is in the In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
  • the electronic device 1600 further includes: a camera for collecting images of the picture book displayed by the user; and the processor 1602 is also used for loading a database related to the target picture book,
  • the image of the picture book displayed by the user is collected by a camera; the image of the collected picture book is analyzed by image analysis technology to determine the target picture book.
  • the embodiments of the present application provide a picture book-based question and answer interaction method and electronic device, so that the interaction between the electronic device and the user during the picture book reading process is more intelligent, which can improve efficiency and enhance user experience.
  • the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A picture book-based question and answer interaction method and an electronic device, which relate to the field of artificial intelligence, wherein intelligent interaction with a user is carried out when an electronic device reads a picture book. The question and answer interaction method comprises: an electronic device loading a database related to a target picture book (401); and after receiving a question asked by a user, determining an answer to be responded on the basis of an entity attribute library, a question template library, a call function library, an answer template library, and a word set that are comprised in the database, and outputting the answer to the user. As such, the electronic device can flexibly and automatically determine an answer, and questions and answers do not need to be manually preset; the user does not need to ask questions according to preset questions and can flexibly ask questions, and the electronic device can answer more questions, thus the interaction between the electronic device and the user when reading a picture book may be more intelligent, and the effectiveness of reading the picture book can be improved.

Description

一种基于绘本的问答交互方法及电子设备A question and answer interactive method and electronic device based on picture book
本申请要求在2019年04月28日提交中国专利局、申请号为201910349961.6、申请名称为“一种基于绘本的问答交互方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on April 28, 2019, the application number is 201910349961.6, and the application name is "a method for interactive question and answer and electronic equipment based on picture books", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及人工智能领域,尤其涉及一种基于绘本的问答交互方法及电子设备。This application relates to the field of artificial intelligence, and in particular to a question and answer interactive method and electronic equipment based on picture books.
背景技术Background technique
人工智能(artificial intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式作出反应的智能机器。人工智能也就是研究各种智能机器的设计原理与实现方法,使机器具有感知、推理与决策的功能。人工智能领域的研究包括机器人,自然语言处理,计算机视觉,决策与推理,人机交互,推荐与搜索,AI基础理论等。Artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, and basic AI theories.
目前,人工智能广泛应用于具有阅读绘本的功能的电子设备,例如智能音箱、智能机器人、智能学习机等等。例如,电子设备在阅读绘本的过程中,会根据预设的问题与答案向儿童提问。Currently, artificial intelligence is widely used in electronic devices with the function of reading picture books, such as smart speakers, smart robots, smart learning machines, and so on. For example, when the electronic device reads a picture book, it will ask children questions based on preset questions and answers.
但是,目前的电子设备是机械地根据预设好的问题和答案对向用户提出问题,向用户提出的问题的顺序是预设好的,答案也是预设好的,并且只能向儿童提问不能回答儿童的问题,互动性大打折扣,不能达到替代父母讲故事的效果。However, the current electronic equipment mechanically asks the user based on the preset question and answer pair. The order of the questions asked to the user is preset, the answer is also preset, and it can only ask questions to children. To answer children’s questions, the interactivity is greatly reduced, and it cannot achieve the effect of replacing parents with storytelling.
因此,目前亟需一种可以灵活实现与用户进行问答交互的方法和电子设备,特别是在电子设备阅读绘本的过程中能够智能地与用户(例如儿童)进行问答交互。Therefore, there is an urgent need for a method and electronic device that can flexibly implement question and answer interactions with users, especially in the process of reading picture books by electronic devices that can intelligently perform question and answer interactions with users (such as children).
发明内容Summary of the invention
本申请提供一种基于绘本的问答交互方法及电子设备,在电子设备阅读绘本的过程中能够智能地与用户进行互动。This application provides a question and answer interaction method based on a picture book and an electronic device, which can intelligently interact with the user during the process of reading the picture book by the electronic device.
第一方面,本申请提供了一种基于绘本的问答交互方法,该方法包括:电子设备加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库、调用函数库、答案模板库和字词集合,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应,所述字词集合指示多个关键词与泛化词之间的对应关系,所述泛化词包括实体;所述电子设备接收所述用户提出的问题;所述电子设备对所述用户提出的问题进行分词处理得到分词词串,所述分词词串为多个关键词文本序列;然后所述电子设备根据所述分词词串和所述字词集合得到泛化后的问题,所述泛化后的问题为多个泛化 词文本序列;所述电子设备从所述泛化后的问题中提取出所述用户提出的问题所对应的实体名称,所述用户提出的问题所对应的实体名称为所述泛化后的问题中被泛化成实体的关键词;所述电子设备根据所述泛化后的问题与所述问题模板库中问题模板的文本相似度,从所述问题模板库中获取被提问问题模板;所述电子设备根据所述被提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取被提问调用函数;所述电子设备根据所述被提问调用函数和所述用户提出的问题所对应的实体名称,从所述实体属性库中获取所述用户提出的问题所对应的实体名称对应的实体属性;最后所述电子设备根据所述被提问调用函数从所述答案模板库中获取待回答答案模板,所述待回答答案模板为所述答案模板库中与所述被提问调用函数对应的答案模板,基于所述待回答答案模板将所述用户提出的问题所对应的实体名称及所述用户提出的问题所对应的实体名称对应的实体属性生成待回答答案,并向所述用户输出所述待回答答案。In the first aspect, this application provides a question and answer interaction method based on picture books. The method includes: an electronic device loads a database related to a target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, An answer template library and a word set, the entity attribute library includes multiple entity names and multiple entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, and the question template database includes at least one A question template, the call function library includes at least one call function, each question template in the question template library corresponds to one or more call functions in the call function library, and each question template library The question template includes a plurality of slots, the answer template library includes at least one answer template, the answer templates in the answer template library correspond to the calling functions in the calling function library, and the word set indicates Correspondence between multiple keywords and generalized words, the generalized words include entities; the electronic device receives the user's question; the electronic device performs word segmentation processing on the user's question to obtain word segmentation Word string, the word segmentation string is a plurality of keyword text sequences; then the electronic device obtains a generalized question according to the word segmentation string and the word set, and the generalized question is multiple A generalized word text sequence; the electronic device extracts the entity name corresponding to the question posed by the user from the generalized question, and the entity name corresponding to the question posed by the user is the generalized The question in the question is generalized into an entity keyword; the electronic device obtains the question template to be asked from the question template library according to the text similarity between the generalized question and the question template in the question template library; The electronic device obtains the questioned calling function from the calling function library according to the degree of matching between the slot of the question template being asked and the parameter of the calling function in the calling function library; The question call function and the entity name corresponding to the question posed by the user are obtained from the entity attribute library and the entity attribute corresponding to the entity name corresponding to the question posed by the user is obtained; and finally the electronic device is based on the question The calling function obtains an answer template to be answered from the answer template library, the answer template to be answered is an answer template in the answer template library corresponding to the called function of the question, and based on the answer template to be answered The entity name corresponding to the question posed by the user and the entity attribute corresponding to the entity name corresponding to the question posed by the user generate an answer to be answered, and output the answer to be answered to the user.
通过上述方法,电子设备可以根据用户的问题基于与目标绘本相关的数据库灵活自行确定答案,并不需要机械地预设好问题和答案,用户可以不需要按照预设的问题进行提问,可以灵活提问,电子设备也可以回答更多的问题,从而可以使在绘本阅读过程中电子设备和用户的交互更加智能,可以提高阅读绘本有效性。Through the above method, the electronic device can flexibly determine the answer based on the user’s question based on the database related to the target picture book. It does not need to mechanically preset the question and answer. The user does not need to ask the question according to the preset question, but can ask the question flexibly , The electronic device can also answer more questions, so that the interaction between the electronic device and the user during the picture book reading process can be more intelligent, and the effectiveness of reading picture books can be improved.
在一个可能的设计中,所述被提问调用函数的参数的数量和类型与所述被提问问题模板的槽位的数量和类型的匹配程度最高。这样,可以准确地确定所述被提问调用函数,以使后续准确确定待回答答案。In a possible design, the number and types of the parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template. In this way, the function called by the questioned question can be accurately determined, so that the answer to be answered can be accurately determined subsequently.
在一个可能的设计中,所述电子设备根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。In a possible design, the electronic device updates the entity attribute database according to the entity name and entity attributes contained in the interaction history information; wherein, the interaction history information is the result of reading the target picture book on the electronic device In the process, the electronic device receives speech information input by the user or action information of the user.
通过上述方法,所述电子设备可以使更新的实体属性库更加符合用户需求,使人机交互更具针对性,使阅读更加深入。Through the above method, the electronic device can make the updated entity attribute library more in line with user needs, make human-computer interaction more targeted, and make reading deeper.
在一个可能的设计中,在所述电子设备加载与所述目标绘本相关的数据库之前,所述电子设备通过摄像头采集所述用户展示的绘本的图像;所述电子设备通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。In a possible design, before the electronic device loads the database related to the target picture book, the electronic device collects the image of the picture book displayed by the user through a camera; the electronic device collects The image of the picture book is analyzed to determine the target picture book.
通过上述方法,所述电子设备灵活且准确地获得所述目标绘本,以使后续电子设备可以准确地获取到与所述目标绘本相关的数据库,进入后续的与用户的问答交互过程。Through the above method, the electronic device can flexibly and accurately obtain the target picture book, so that the subsequent electronic device can accurately obtain the database related to the target picture book and enter the subsequent question and answer interaction process with the user.
在一个可能的设计中,当所述电子设备包含显示屏时,所述电子设备向所述用户输出所述待回答答案时,还可以通过所述显示屏显示所述待回答答案。In a possible design, when the electronic device includes a display screen, when the electronic device outputs the answer to be answered to the user, it may also display the answer to be answered through the display screen.
通过上述方法,可以使所述电子设备更灵活地向用户输出答案,可以在语音回答用户的同时在显示屏上显示答案,使电子设备输出答案更直观,使用户更容易理解,提高用户的接受度。Through the above method, the electronic device can output the answer to the user more flexibly, and the answer can be displayed on the display screen while answering the user by voice, making the output of the electronic device more intuitive, making the user easier to understand, and improving user acceptance degree.
在一个可能的设计中,当所述电子设备还包含可活动部件时,所述电子设备向所述用户输出所述待回答答案时,所述电子设备还可以控制所述可活动部件执行输出所述待回答答案的动作。In a possible design, when the electronic device further includes a movable component, when the electronic device outputs the answer to be answered to the user, the electronic device may also control the movable component to perform outputting. Describe the action to be answered.
通过上述方法,可以使所述电子设备更灵活地向用户输出答案,可以在语音回答用户的同时通过执行动作指示答案,使电子设备输出答案更具多样化,提高用户的接收度。Through the above method, the electronic device can output the answer to the user more flexibly, and the answer can be indicated by performing an action while answering the user by voice, so that the output of the electronic device is more diversified and the user's acceptance is improved.
第二方面,本申请提供了一种基于绘本的问答交互方法,该方法包括:电子设备加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库和调用函数 库,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位;所述电子设备根据问题模板信息从所述问题模板库中获取待提问问题模板,所述问题模板信息为转移概率集合或问题模板类型,所述转移概率集合包括历史问题模板与所述问题模板库中其他问题模板之间的转移概率,所述历史问题模板为所述电子设备在生成上一次向用户提出的问题的过程中获取的问题模板,所述问题模板类型与所述用户的年龄相关;所述电子设备根据所述待提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取待提问调用函数;所述电子设备根据所述待提问调用函数从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性;基于所述待提问问题模板,所述电子设备将所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性生成待提问问题;最后所述电子设备向所述用户输出所述待提问问题。In the second aspect, this application provides a question and answer interaction method based on picture books. The method includes: an electronic device loads a database related to a target picture book, wherein the database includes an entity attribute library, a question template library, and a calling function library, The entity attribute library includes multiple entity names and multiple entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, and the calling function library Contains at least one calling function, each question template in the question template library corresponds to one or more calling functions in the call function library, and each question template in the question template library includes multiple slots; The electronic device obtains a question template to be asked from the question template library according to question template information, the question template information is a transition probability set or a question template type, and the transition probability set includes a historical question template and the question template library The transition probability between other question templates in the above, the historical question template is a question template obtained by the electronic device in the process of generating the last question posed to the user, and the question template type is related to the age of the user; The electronic device obtains the calling function to be asked from the calling function library according to the degree of matching between the slot of the question template to be asked and the parameter of the calling function in the calling function library; The question calling function obtains the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library; based on the question template to be asked, the electronic device The entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked generates the question to be asked; finally, the electronic device outputs the question to be asked to the user.
通过上述方法,所述电子设备可以根据与目标绘本相关的数据库自行生成需要提问的问题,并不需要预设好问题,不用机械地按照预设好的问题向用户提问,从而可以使在绘本阅读过程中电子设备和用户的交互更加智能,可以提高阅读绘本有效性。Through the above method, the electronic device can automatically generate questions to be asked according to the database related to the target picture book, and does not need to preset the questions, and does not mechanically ask the user according to the preset questions, so that the picture book can be read In the process, the interaction between electronic devices and users is more intelligent, which can improve the effectiveness of reading picture books.
在一个可能的设计中,所述数据库还包括答案模板库,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应;所述电子设备从所述待提问问题中提取所述待提问问题所对应的实体名称和/或所述待提问问题所对应的实体属性;然后,所述电子设备根据所述待提问调用函数和所述待提问问题所对应的实体名称,从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性,或者,所述电子设备根据所述待提问调用函数和所述待提问问题所对应的实体属性,从所述实体属性库中获取所述待提问问题所对应的实体属性对应的实体名称;最后所述电子设备根据所述待提问调用函数从所述答案模板库中获取待确定答案模板,所述待确定答案模板为所述答案模板库中与所述待提问调用函数对应的答案模板,基于所述待确定答案模板,所述电子设备将待确定答案关键词生成待确定答案,所述待确定答案关键词为以下任一项:所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体名称和所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体属性、所述待提问问题所对应的实体属性和所述待提问问题所对应的实体属性对应的实体名称。In a possible design, the database further includes an answer template library, the answer template library contains at least one answer template, and the answer templates in the answer template library are one-to-one with the calling functions in the calling function library. Corresponding; the electronic device extracts the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the question to be asked from the question to be asked; then, the electronic device calls according to the question to be asked Function and the entity name corresponding to the question to be asked, the entity attribute corresponding to the entity name corresponding to the question to be asked is obtained from the entity attribute library, or the electronic device calls the function and The entity attribute corresponding to the question to be asked is obtained from the entity attribute library and the entity name corresponding to the entity attribute corresponding to the question to be asked is obtained; finally, the electronic device calls the function according to the question to be asked from the answer A to-be-determined answer template is obtained from a template library, where the to-be-determined answer template is an answer template in the answer template library that corresponds to the call function to be asked, and based on the to-be-determined answer template, the electronic device will A keyword generates a to-be-determined answer, and the keyword of the to-be-determined answer is any one of the following: the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity name corresponding to the question to be asked, and the question to be asked The entity attribute corresponding to the entity name corresponding to the question, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the entity name corresponding to the entity attribute corresponding to the question to be asked.
通过上述方法,所述电子设备可以根据与目标绘本相关的数据库自行生成待提问问题的答案,并不需要机械地预设好问题答案对,可以使在绘本阅读过程中电子设备提问及用户回答更加灵活,从而可以使在绘本阅读过程中电子设备和用户的交互更加智能,可以提高阅读绘本有效性。Through the above method, the electronic device can automatically generate the answers to the questions to be asked according to the database related to the target picture book, and does not need to mechanically preset the question answer pairs, which can make the electronic device ask questions and user answers more during the picture book reading process. Flexible, so that the interaction between the electronic device and the user in the picture book reading process can be more intelligent, and the effectiveness of reading picture books can be improved.
在一个可能的设计中,所述电子设备接收所述用户针对所述待提问问题的回答,将所述用户针对所述待提问问题的回答与所述待确定答案进行对比分析以得到所述用户的回答是否正确的判断结果,根据所述判断结果向用户做出相应的操作。In a possible design, the electronic device receives the user's answer to the question to be asked, and compares the user's answer to the question to be asked with the answer to be determined to obtain the user According to the result of judging whether the answer is correct, corresponding operations are made to the user according to the judgment result.
通过上述方法,所述电子设备可以准确地确定用户的回答是否正确,并向用户做出相应的操作以直接或间接地提示用户的回答是否正确,可以提升用户对回答结果的接受度。Through the above method, the electronic device can accurately determine whether the user's answer is correct, and perform corresponding operations to the user to directly or indirectly prompt the user whether the answer is correct, which can improve the user's acceptance of the answer.
在一个可能的设计中,所述待提问调用函数的参数的数量和类型与所述待提问问题模板的槽位的数量和类型的匹配程度最高。这样可以准确地确定所述待提问调用函数,以使后续准确确定待确定答案。In a possible design, the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked. In this way, the function to be called can be accurately determined, so that the answer to be determined can be accurately determined subsequently.
在一个可能的设计中,所述问题模板信息为所述转移概率集合时,所述电子设备根据所述问题模板信息从所述问题模板库中获取待提问问题模板,具体方法可以为:所述电子设备根据预先确定的随机取值从所述转移概率集合中确定目标转移概率;所述电子设备根据所述目标转移概率从所述问题模板库中获取所述待提问问题模板。In a possible design, when the question template information is the transition probability set, the electronic device obtains the question template to be asked from the question template library according to the question template information, and the specific method may be: The electronic device determines the target transition probability from the set of transition probabilities according to a predetermined random value; the electronic device obtains the question template to be asked from the question template library according to the target transition probability.
通过上述方法,可以使所述电子设备提问更具多样性,避免用户感到枯燥,提高用户对绘本阅读的兴趣。Through the above method, the electronic device can make more diversified questions, prevent the user from feeling bored, and increase the user's interest in picture book reading.
在一个可能的设计中,所述问题模板信息为所述问题模板类型时,所述电子设备根据所述问题模板信息从所述问题模板库中获取待提问问题模板,具体方法可以为:所述电子设备根据所述用户的年龄以及年龄与问题模板类型的对应关系确定目标问题模板类型;所述对应关系指示用户的年龄与以下至少一个问题模板类型对应:空间、细节、社会、色彩、数字、文字、自然;所述电子设备从所述问题模板库中获取符合所述目标问题模板类型的问题模板作为所述待提问问题模板。In a possible design, when the question template information is the question template type, the electronic device obtains the question template to be asked from the question template library according to the question template information. The specific method may be: The electronic device determines the target question template type according to the user’s age and the corresponding relationship between the age and the question template type; the corresponding relationship indicates that the user’s age corresponds to at least one of the following question template types: space, detail, society, color, number, Text and nature; the electronic device obtains a question template that meets the target question template type from the question template library as the question template to be asked.
通过上述方法,可以选择更适合用户的认知能力的问题模板,使后续提问更具针对性,使用户的阅读更加有效。Through the above method, a question template that is more suitable for the user's cognitive ability can be selected, so that subsequent questions are more targeted, and the user's reading is more effective.
在一个可能的设计中,所述电子设备根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。In a possible design, the electronic device updates the entity attribute database according to the entity name and entity attributes contained in the interaction history information; wherein, the interaction history information is the result of reading the target picture book on the electronic device In the process, the electronic device receives speech information input by the user or action information of the user.
通过上述方法,所述电子设备可以使更新的实体属性库更加符合用户需求,使人机交互更具针对性,使阅读更加深入。Through the above method, the electronic device can make the updated entity attribute library more in line with user needs, make human-computer interaction more targeted, and make reading deeper.
在一个可能的设计中,在所述电子设备加载与所述目标绘本相关的数据库之前,所述电子设备通过摄像头采集所述用户展示的绘本的图像;所述电子设备通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。In a possible design, before the electronic device loads the database related to the target picture book, the electronic device collects the image of the picture book displayed by the user through a camera; the electronic device collects The image of the picture book is analyzed to determine the target picture book.
通过上述方法,所述电子设备灵活且准确地获得所述目标绘本,以使后续电子设备可以准确地获取到与所述目标绘本相关的数据库,进入后续的与用户的问答交互过程。Through the above method, the electronic device can flexibly and accurately obtain the target picture book, so that the subsequent electronic device can accurately obtain the database related to the target picture book and enter the subsequent question and answer interaction process with the user.
第三方面,本申请实施例还提供了一种电子设备,该电子设备具有实现上述第一方面方法实例中电子设备行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In the third aspect, the embodiments of the present application also provide an electronic device, which has the function of implementing the behavior of the electronic device in the method example of the first aspect. The function can be realized by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions.
在一个可能的设计中,所述电子设备的结构中包括处理单元、输入单元和输出单元,这些单元可以执行上述第一方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a possible design, the structure of the electronic device includes a processing unit, an input unit, and an output unit. These units can perform the corresponding functions in the method example of the first aspect. For details, please refer to the detailed description in the method example. Do not repeat it.
在一种可能的设计中,所述电子设备的结构中包括处理器和通信单元,还可以包括存储器。所述通信单元用于与用户进行交互;所述处理器被配置为支持所述电子设备执行上述第一方面方法中相应的功能。所述存储器与所述处理器耦合,其保存所述电子设备必要的程序指令和数据。In a possible design, the structure of the electronic device includes a processor and a communication unit, and may also include a memory. The communication unit is used to interact with a user; the processor is configured to support the electronic device to perform the corresponding function in the above-mentioned method in the first aspect. The memory is coupled with the processor, and stores the necessary program instructions and data of the electronic device.
在一种可能的设计中,所述电子设备中包括相互连接的处理器与存储器,所述处理器用于读取并执行所述存储器中存储的程序指令,执行上述第一方面中任一可能的设计中所提及的方法。In a possible design, the electronic device includes a processor and a memory connected to each other, and the processor is configured to read and execute program instructions stored in the memory, and execute any one of the possible options in the first aspect. The methods mentioned in the design.
第四方面,本申请实施例还提供了一种电子设备,该电子设备具有实现上述第二方面方法实例中电子设备行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a fourth aspect, an embodiment of the present application also provides an electronic device that has a function of implementing the behavior of the electronic device in the method example of the second aspect. The function can be realized by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions.
在一个可能的设计中,所述电子设备的结构中包括处理单元和输出单元,还可以包括输入单元,这些单元可以执行上述第二方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a possible design, the structure of the electronic device includes a processing unit and an output unit, and may also include an input unit. These units can perform the corresponding functions in the method example of the second aspect. For details, please refer to the detailed description in the method example , Do not repeat it here.
在一种可能的设计中,所述电子设备的结构中包括处理器和通信单元,还可以包括存储器。所述通信单元用于与用户进行交互;所述处理器被配置为支持所述电子设备执行上述第二方面方法中相应的功能。所述存储器与所述处理器耦合,其保存所述电子设备必要的程序指令和数据。In a possible design, the structure of the electronic device includes a processor and a communication unit, and may also include a memory. The communication unit is used to interact with a user; the processor is configured to support the electronic device to perform the corresponding function in the method of the second aspect. The memory is coupled with the processor, and stores the necessary program instructions and data of the electronic device.
在一种可能的设计中,所述电子设备中包括相互连接的处理器与存储器,所述处理器用于读取并执行所述存储器中存储的程序指令,执行上述第二方面中任一可能的设计中所提及的方法。In a possible design, the electronic device includes a processor and a memory connected to each other, and the processor is configured to read and execute program instructions stored in the memory, and execute any one of the possible options in the second aspect. The methods mentioned in the design.
第五方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机可执行指令,所述计算机可执行指令在被所述计算机调用时用于使所述计算机执行上述第一方面或第二方面中任一可能的设计中所提及的方法。In a fifth aspect, the embodiments of the present application also provide a computer-readable storage medium in which computer-executable instructions are stored, and the computer-executable instructions are used to make the computer executable when called by the computer. The computer executes the method mentioned in any possible design in the first aspect or the second aspect.
第六方面,本申请实施例还提供了一种包含指令的计算机程序产品,当其在电子设备上运行时,使得所述电子设备执行上述第一方面或第二方面中任一可能的设计中所提及的方法。In the sixth aspect, the embodiments of the present application also provide a computer program product containing instructions, which when run on an electronic device, causes the electronic device to execute any of the possible designs in the first aspect or the second aspect. The mentioned method.
第七方面,本申请实施例还提供了一种电子设备,所述电子设备可以为芯片,所述芯片与存储器相连,用于读取并执行所述存储器中存储的程序指令,以实现上述第一方面或第二方面中任一可能的设计中所提及的方法。In a seventh aspect, an embodiment of the present application also provides an electronic device. The electronic device may be a chip, and the chip is connected to a memory, and is used to read and execute the program instructions stored in the memory to implement the above-mentioned The method mentioned in any possible design in one aspect or in the second aspect.
附图说明Description of the drawings
图1为本申请提供的一种人工智能主体框架示意图;Figure 1 is a schematic diagram of a main artificial intelligence framework provided by this application;
图2为本申请提供的一种应用场景的示意图;Figure 2 is a schematic diagram of an application scenario provided by this application;
图3为本申请提供的一种电子设备的结构示意图;Figure 3 is a schematic structural diagram of an electronic device provided by this application;
图4为本申请提供的一种基于绘本的问答交互方法的流程图;FIG. 4 is a flowchart of a question and answer interaction method based on picture books provided by this application;
图5为本申请提供的另一种基于绘本的问答交互方法的流程图;FIG. 5 is a flowchart of another question and answer interaction method based on picture books provided by this application;
图6为本申请提供的一种问题模板之间转移概率的示意图;FIG. 6 is a schematic diagram of the transition probability between question templates provided by this application;
图7为本申请提供的一种更新实体属性库的流程图;Figure 7 is a flow chart for updating the entity attribute database provided by this application;
图8为本申请提供的另一种更新实体属性库的流程图;Figure 8 is another flow chart for updating the entity attribute database provided by this application;
图9为本申请提供的一种识别指示绘本中位置的示意图;FIG. 9 is a schematic diagram of identifying a position in a picture book provided by this application;
图10为本申请提供的一种问答交互过程示意图;FIG. 10 is a schematic diagram of a question and answer interaction process provided by this application;
图11为本申请提供的另一种问答交互过程示意图;Figure 11 is a schematic diagram of another question and answer interaction process provided by this application;
图12为本申请提供的一种儿童的意图示意图;Figure 12 is a schematic diagram of a child's intention provided in this application;
图13为本申请提供的一种绘本的示意图;FIG. 13 is a schematic diagram of a picture book provided by this application;
图14为本申请提供的一种询问购买商品的方法流程图;Figure 14 is a flow chart of a method for inquiring about purchasing goods provided by this application;
图15为本申请提供的一种电子设备的结构示意图;FIG. 15 is a schematic structural diagram of an electronic device provided by this application;
图16为本申请提供的一种电子设备的结构图。FIG. 16 is a structural diagram of an electronic device provided by this application.
具体实施方式Detailed ways
下面将结合附图对本申请作进一步地详细描述。The application will be further described in detail below in conjunction with the accompanying drawings.
本申请实施例提供一种基于绘本的问答交互方法及电子设备,用以在电子设备阅读绘本的过程中能够智能地与用户进行互动。其中,本申请所述方法和电子设备基于同一发明构思,由于方法及电子设备解决问题的原理相似,因此电子设备与方法的实施可以相互参见,重复之处不再赘述。The embodiment of the present application provides a question and answer interaction method based on a picture book and an electronic device, which are used to intelligently interact with a user during the process of reading the picture book by the electronic device. Among them, the method and the electronic device described in this application are based on the same inventive concept. Since the method and the principle of the electronic device to solve the problem are similar, the implementation of the electronic device and the method can be referred to each other, and the repetition will not be repeated.
图1示出了一种人工智能主体框架示意图,该主体框架描述了人工智能系统总体工作流程,适用于通用的人工智能领域需求。Figure 1 shows a schematic diagram of an artificial intelligence main framework, which describes the overall workflow of the artificial intelligence system and is suitable for general artificial intelligence field requirements.
下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。The following describes the above-mentioned artificial intelligence theme framework from the two dimensions of "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis).
“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。"Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has gone through the condensing process of "data-information-knowledge-wisdom". The "IT value chain" from the underlying infrastructure of human intelligence, information (providing and processing technology realization) to the system's industrial ecological process, reflects the value that artificial intelligence brings to the information technology industry.
(1)基础设施:基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片(CPU、NPU、GPU、ASIC、FPGA等硬件加速芯片)提供;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。(1) Infrastructure: Infrastructure provides computing power support for artificial intelligence systems, realizes communication with the outside world, and realizes support through the basic platform. Communicate with the outside through sensors; computing capabilities are provided by smart chips (CPU, NPU, GPU, ASIC, FPGA and other hardware acceleration chips); the basic platform includes distributed computing framework and network related platform guarantees and support, which can include cloud storage and Computing, interconnection network, etc. For example, sensors communicate with the outside to obtain data, and these data are provided to the smart chip in the distributed computing system provided by the basic platform for calculation.
(2)数据:基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。(2) Data: The data in the upper layer of the infrastructure is used to indicate the data source in the field of artificial intelligence. The data involves graphics, images, voice, and text, as well as IoT data of traditional devices, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
(3)数据处理:数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。(3) Data processing: Data processing usually includes data training, machine learning, deep learning, search, reasoning, and decision-making. Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, training, etc. Reasoning refers to the process of simulating human intelligent reasoning in a computer or intelligent system, using formal information to conduct machine thinking and solving problems based on reasoning control strategies. The typical function is search and matching. Decision-making refers to the decision-making process of intelligent information after reasoning, and usually provides functions such as classification, ranking, and prediction.
(4)通用能力:对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用系统,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。(4) General capabilities: After the data is processed as mentioned above, some general capabilities can be formed based on the results of data processing, such as algorithms or a general system, for example, translation, text analysis, computer vision Processing, speech recognition, image recognition, etc.
(5)智能产品及行业应用:智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能制造、智能交通、智能家居、智能医疗、智能安防、自动驾驶,平安城市,智能终端等。(5) Smart products and industry applications: Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. It is an encapsulation of the overall solution of artificial intelligence, productizing intelligent information decision-making and realizing landing applications. Its application fields Mainly include: smart manufacturing, smart transportation, smart home, smart medical, smart security, autonomous driving, safe city, smart terminal, etc.
人工智能在很多领域都有着广泛的应用,例如人机问答交互等领域。本申请提供的基于绘本的问答交互方法,属于人工智能领域。Artificial intelligence has wide applications in many fields, such as human-computer question answering and interaction. The question and answer interactive method based on picture books provided in this application belongs to the field of artificial intelligence.
本申请实施例提供的基于绘本的问答交互方法,应用于绘本问答系统。应理解,问答为一问一答,这种问答通常包含两种:一种是人问机器答,一种是机器问人答。而本申请 实施例提供的基于绘本的问答交互方法,一般是发生在机器为儿童(即用户)阅读绘本的过程中发生的儿童和机器之间的问答交互。The picture book-based question and answer interaction method provided by the embodiment of the application is applied to a picture book question and answer system. It should be understood that question and answer are one question and one answer, and this type of question and answer usually includes two types: one is for people to ask the machine to answer, and the other is for machines to ask people to answer. However, the question and answer interaction method based on picture books provided by the embodiments of the present application is generally the question and answer interaction between the child and the machine that occurs when the machine is reading the picture book for the child (ie, the user).
图2示出了本申请实施例提供的基于绘本的问答交互方法适用的一种可能应用场景,所述应用场景中可以包括用户和电子设备。其中:FIG. 2 shows a possible application scenario to which the picture book-based question and answer interaction method provided by an embodiment of the present application is applicable, and the application scenario may include a user and an electronic device. among them:
在本申请实施例中,用户一般指需要听绘本阅读的儿童,因此,在本申请实施例中仅以用户为儿童为例进行说明。所述电子设备可以为具有输出语音功能的实体设备,在具体的实施方式中,所述电子设备可以为智能终端,例如图2所示的智能手机、智能终端等;所述电子设备还可以为图2所示的穿戴式终端或者机器人等。当然所述电子设备不仅仅限于图2中所示的示例,还可以为其他电子设备,例如笔记本电脑、平板电脑、车载电脑、个人数字助理(personal digital assistant,PDA)、智能手表、个人计算机((personal computer,PC)、电视机等等。当然所述电子设备不限于上述列举的设备,本申请对此不作限定。In the embodiments of this application, users generally refer to children who need to listen to picture books and read. Therefore, in the embodiments of this application, the user is a child as an example for description. The electronic device may be a physical device with a voice output function. In a specific implementation, the electronic device may be a smart terminal, such as a smart phone or smart terminal shown in FIG. 2; the electronic device may also be The wearable terminal or robot shown in FIG. 2. Of course, the electronic device is not limited to the example shown in FIG. 2, but can also be other electronic devices, such as notebook computers, tablet computers, car computers, personal digital assistants (personal digital assistant, PDA), smart watches, personal computers ( (personal computer, PC), TV, etc. Of course, the electronic device is not limited to the above-listed devices, and this application does not limit it.
所述电子设备至少具有接收声音、语音,以及输出声音、语音的功能。The electronic device has at least the functions of receiving sound and voice, and outputting sound and voice.
一种可选的方式中,所述电子设备除上述功能外,还具有声音或语音分析、语义分析、语音合成等功能,若电子设备可以具备数据存储与数据处理的能力,在该应用场景中只存在用户和所述电子设备即可以完成就绘本的问答交互过程。In an optional manner, in addition to the above-mentioned functions, the electronic device also has functions such as sound or voice analysis, semantic analysis, and speech synthesis. If the electronic device has the capabilities of data storage and data processing, in this application scenario Only the user and the electronic device can complete the question and answer interactive process on the picture book.
在另一种可选的实施方式中,若电子设备不具备数据存储和数据处理能力时,所述电子设备可以通过网络与服务器连接,由服务器完成数据的存储与处理,如图2中所示。In another optional implementation manner, if the electronic device does not have data storage and data processing capabilities, the electronic device can be connected to a server through a network, and the server completes the storage and processing of data, as shown in FIG. 2 .
当然,在所述电子设备具备数据存储与数据处理的能力时,为了减少所述电子设备的能耗,所述电子设备同样可以通过网络与服务器连接,由服务器完成数据的存储与处理,本申请对此不作限定。Of course, when the electronic device has the capability of data storage and data processing, in order to reduce the energy consumption of the electronic device, the electronic device can also be connected to a server via a network, and the server completes the storage and processing of data. There is no restriction on this.
可选的,所述电子设备除了上述功能外,还可以包括摄像头,可以用于拍摄绘本,以实现绘本的阅读,或者拍摄儿童的图像,用于后续的图像分析等等。Optionally, in addition to the above-mentioned functions, the electronic device may also include a camera, which can be used to take picture books for reading picture books, or take pictures of children for subsequent image analysis and so on.
当然所述电子设备在是机器人或者其他具有可活动部件的设备的情况下,所述电子设备还可以通过肢体或者可活动部件与儿童进行更灵活地交互,例如拥抱,指示等等。Of course, when the electronic device is a robot or other device with movable parts, the electronic device can also interact with children more flexibly through limbs or movable parts, such as hugging, giving instructions and so on.
需要说明的是,图2示出的应用场景示意图还可包括其他设备,在此不再示出。It should be noted that the application scenario diagram shown in FIG. 2 may also include other devices, which are not shown here.
由于本申请实施例提供的基于绘本的问答交互方法适用于电子设备,下面对所述电子设备进行简单介绍。图3示出了与本实施例相关的电子设备的部分结构框图。参阅图3所示,所述电子设备300可以包括:通信单元310、电源320、处理器330、存储器340、输入单元350、输出单元360、音频电路370等部件。本领域技术人员可以理解,图3中示出的电子设备的结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Since the picture book-based question and answer interaction method provided by the embodiment of the present application is applicable to electronic equipment, the electronic equipment will be briefly introduced below. Fig. 3 shows a partial structural block diagram of the electronic device related to this embodiment. 3, the electronic device 300 may include: a communication unit 310, a power supply 320, a processor 330, a memory 340, an input unit 350, an output unit 360, an audio circuit 370 and other components. Those skilled in the art can understand that the structure of the electronic device shown in FIG. 3 does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or a combination of certain components, or different component arrangements. .
下面结合图3对电子设备300的各个构成部件进行具体的介绍:Hereinafter, each component of the electronic device 300 will be specifically introduced with reference to FIG. 3:
所述通信单元310可以提供语音或数据的通信能力,可以提供有线或无线通信的接口。可选的,所述通信单元310可以包括射频(radio frequency,RF)收发元件、全球定位系统(global positioning system,GPS)收发元件(例如图3所示的RF电路311)、无线保真(wireless fidelity,WiFi)元件(例如图3所示的WiFi模块312)、其他元件等等中的部分或者全部;所述通信单元310还可以是软件和硬件(例如,天线、调制/解调器、编/解码器、模拟/数字处理电路等)的结合。The communication unit 310 may provide voice or data communication capabilities, and may provide a wired or wireless communication interface. Optionally, the communication unit 310 may include radio frequency (RF) transceiver components, global positioning system (global positioning system, GPS) transceiver components (for example, the RF circuit 311 shown in FIG. 3), and wireless fidelity (wireless fidelity, WiFi) components (for example, the WiFi module 312 shown in FIG. 3), some or all of other components, etc.; the communication unit 310 may also be software and hardware (for example, an antenna, a modulator/demodulator, an /Decoder, analog/digital processing circuit, etc.).
其中,所述RF电路311可用于收发信息或通话过程中,数据的接收和发送。特别地,所述RF电路311在接收到基站的下行数据后,发送给所述处理器330处理;另外,将待 发送的上行数据发送给基站。通常,所述RF电路311包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(low noise amplifier,LNA)、双工器等。此外,所述RF电路311还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(global system of mobile communication,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、长期演进(long term evolution,LTE)、电子邮件、短消息服务(short messaging service,SMS)等。Wherein, the RF circuit 311 can be used for receiving and sending data in the process of sending and receiving information or talking. In particular, after the RF circuit 311 receives the downlink data from the base station, it sends it to the processor 330 for processing; in addition, it sends the uplink data to be sent to the base station. Generally, the RF circuit 311 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 311 can also communicate with the network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (code division multiple access). division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
所述音频电路370、所述扬声器371,所述麦克风372可提供用户与所述电子设备300之间的音频接口。所述音频电路370可将接收到的音频数据转换后的电信号,传输到所述扬声器371,由所述扬声器371转换为声音信号输出;另一方面,所述麦克风372将收集的声音信号转换为电信号,由所述音频电路370接收后转换为音频数据,再将音频数据输出至所述RF电路310以发送给比如另一电子设备,或者将音频数据输出至所述存储器340以便进一步处理。The audio circuit 370, the speaker 371, and the microphone 372 can provide an audio interface between the user and the electronic device 300. The audio circuit 370 can transmit the electrical signal converted from the received audio data to the speaker 371, and the speaker 371 converts it into a sound signal for output; on the other hand, the microphone 372 converts the collected sound signal It is an electrical signal that is received by the audio circuit 370 and converted into audio data, and then the audio data is output to the RF circuit 310 for sending to, for example, another electronic device, or the audio data is output to the memory 340 for further processing .
WiFi属于短距离无线传输技术,所述电子设备300通过所述WiFi模块312可以连接接入点(access point,AP),从而实现数据网络的访问。所述WiFi模块312可用于与其他设备进行通信过程中,数据的接收和发送。WiFi is a short-distance wireless transmission technology. The electronic device 300 can be connected to an access point (AP) through the WiFi module 312, thereby achieving data network access. The WiFi module 312 can be used to receive and send data during communication with other devices.
所述存储器340可用于存储软件程序以及模块。所述处理器330通过运行存储在所述存储器340的软件程序以及模块,从而执行所述电子设备300的各种功能应用以及数据处理。可选的,所述存储器340可以主要包括存储程序区和存储数据区,其中,所述存储程序区可存储操作系统、各种应用程序等;存储数据区可存储根据所述电子设备300的使用所创建的数据等。具体可选的,所述处理器340还可以存储所述处理器330和其他模块上所需的静态数据(例如图像等)和规则等等。例如,在本申请实施例中,所述存储器340可以存储绘本内容以及与绘本相关的数据库等。此外,所述存储器340可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件等。The memory 340 can be used to store software programs and modules. The processor 330 executes various functional applications and data processing of the electronic device 300 by running software programs and modules stored in the memory 340. Optionally, the memory 340 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, various application programs, etc.; the storage data area may store information according to the use of the electronic device 300 Data created, etc. Specifically, optionally, the processor 340 may also store static data (for example, images, etc.), rules, etc. required by the processor 330 and other modules. For example, in the embodiment of the present application, the memory 340 may store the content of a picture book and a database related to the picture book. In addition, the memory 340 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
需要说明的是,上述存储器340的功能可以在如图3所示的电子设备300中体现,还可以在服务器(例如云服务器)等中实现,这里仅以作为电子设备300的一部分示例性说明,但并不作为对存储器的限定。It should be noted that the function of the above-mentioned memory 340 may be embodied in the electronic device 300 as shown in FIG. 3, and may also be implemented in a server (for example, a cloud server), etc., and it is only exemplified here as a part of the electronic device 300. But not as a limitation on memory.
所述输入单元350可用于接收输入的数字、声音或字符信息,以及产生与所述电子设备300的用户设置以及功能控制有关的键信号输入。例如,在本身请实施例中所述输入单元350可以接收输入儿童的语音。具体地,所述输入单元350可以包括触控面板351以及其他输入设备352。The input unit 350 can be used to receive input digital, sound or character information, and generate key signal input related to user settings and function control of the electronic device 300. For example, in this embodiment, the input unit 350 can receive and input a child's voice. Specifically, the input unit 350 may include a touch panel 351 and other input devices 352.
其中,所述触控面板351,也可以称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板351上或在触控面板351附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,所述触控面板351可以包括触摸检测装置和触摸控制器两个部分。其中,所述触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给所述触摸控制器;所述触摸控制器从所述触摸检测装置上接收触摸信息,并将它转换成触点坐标,再传送给所述处理器330,并能接收所述处理器330发来的命令并加以执行。例如,所述用户在所述触控面板351上用 手触摸所述显示面板3611上显示的绘本目录时,所述触摸检测装置检测到此次触摸带来的这个信号,然后将该信号传送给所述触摸控制器,所述触摸控制器再将这个信号转换成坐标发送给所述处理器330,所述处理器330根据该坐标和该信号的类型(触摸)确定对该绘本目录所执行的操作(选择绘本目录中的一个绘本),然后所述处理器330将指示对选择的绘本进行阅读。Wherein, the touch panel 351, which can also be called a touch screen, can collect user touch operations on or near it (for example, the user uses a finger, a stylus, or any other suitable object or accessory on the touch panel 351 or touches it. The operation near the control panel 351), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 351 may include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, and It is converted into contact coordinates, and then transmitted to the processor 330, and can receive and execute the command sent by the processor 330. For example, when the user touches the picture book catalog displayed on the display panel 3611 on the touch panel 351 by hand, the touch detection device detects this signal brought about by this touch, and then transmits the signal to The touch controller, the touch controller then converts this signal into coordinates and sends it to the processor 330, and the processor 330 determines what is executed on the picture book catalog according to the coordinates and the type (touch) of the signal. Operate (select a picture book in the picture book catalog), and then the processor 330 will instruct to read the selected picture book.
此外,所述触控面板351可以采用电阻式、电容式、红外线以及表面声波等多种类型实现。In addition, the touch panel 351 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
可选的,所述其他输入设备352可以但不限于包括物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Optionally, the other input device 352 may include, but is not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick.
所述输出单元360可以用于输出用于用户交互或提供给用户的各种信息。可选的,所述输出单元360可以包括显示单元361,还可以包括震动马达(可用于提供震动反馈)等等。The output unit 360 may be used to output various information for user interaction or provided to the user. Optionally, the output unit 360 may include a display unit 361, a vibration motor (which can be used to provide vibration feedback), and so on.
其中,所述显示单元361可用于显示由用户输入的信息、提供给用户的信息以及所述电子设备300的各种菜单,所述显示单元361即为所述电子设备300的显示系统,用于呈现界面,实现人机交互。例如,所述输入单元350接收到用户的需要人机交互的指令时,将所述指令传输给所述处理器330,然后所述处理器330根据所述指令通过所述显示单元361显示绘本(具体可以通过显示面板3611显示所述绘本),从而使用户看到绘本,进而可以实现人机交互。Wherein, the display unit 361 can be used to display information input by the user, information provided to the user, and various menus of the electronic device 300. The display unit 361 is the display system of the electronic device 300 for The interface is presented to realize human-computer interaction. For example, when the input unit 350 receives a user's instruction requiring human-computer interaction, it transmits the instruction to the processor 330, and then the processor 330 displays the picture book through the display unit 361 according to the instruction ( Specifically, the picture book can be displayed through the display panel 3611, so that the user can see the picture book, and thus human-computer interaction can be realized.
所述显示单元361可以包括显示面板3611,可选的,所述显示面板3611可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)等形式来配置。进一步地,所述触控面板351可覆盖所述显示面板3611,当所述触控面板351检测到在其上或附近的触摸操作后,传送给所述处理器330以确定触摸事件的类型,随后所述处理器330根据触摸事件的类型在所述显示面板3611上提供相应的视觉输出。例如,当所述触控面板351检测用户在其上点击选择了一个绘本后,传送给所述处理器330,所述处理器330确定触摸事件的类型为点击,在所述显示面板3611上显示被选择后对应的绘本内容,比如被选择的绘本中的图画等等,达到绘本显示的目的。The display unit 361 may include a display panel 3611. Optionally, the display panel 3611 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 351 can cover the display panel 3611, and when the touch panel 351 detects a touch operation on or near it, it is transmitted to the processor 330 to determine the type of touch event, Then the processor 330 provides corresponding visual output on the display panel 3611 according to the type of the touch event. For example, when the touch panel 351 detects that the user clicks on it to select a picture book, it transmits it to the processor 330, and the processor 330 determines that the type of the touch event is a click, and displays it on the display panel 3611 The content of the corresponding picture book after being selected, such as the picture in the selected picture book, etc., achieve the purpose of displaying the picture book.
虽然在图3中,所述触控面板351与所述显示面板3611是作为两个独立的部件来实现所述电子设备300的输入和输入功能,但是在某些实施例中,可以将所述触控面板351与所述显示面板3611集成而实现所述电子设备300的输入和输出功能。Although in FIG. 3, the touch panel 351 and the display panel 3611 are used as two independent components to implement the input and input functions of the electronic device 300, but in some embodiments, the The touch panel 351 is integrated with the display panel 3611 to realize the input and output functions of the electronic device 300.
所述处理器330是所述电子设备300的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在所述存储器340内的软件程序和/或模块,以及调用存储在所述存储器340内的数据,执行所述电子设备300的各种功能和处理数据,从而实现基于所述电子设备300的多种业务。可选的,所述处理器330可包括一个或多个处理单元;具体的,所述处理器330可集成应用处理器和调制解调处理器,其中,所述应用处理器主要处理操作系统、用户界面和应用程序等,所述调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到所述处理器330中。例如,在本申请中,所述处理器330中可以包括显示驱动单元,当所述处理器330生成绘本之后,可以通过所述显示驱动单元控制所述显示面板3611呈现所述绘本内容。又例如,所述存储器340中存储了显示驱动程序,所述处理器330可以调用所述存储器340中的驱动程序控制所述显示面板3611呈现绘本内容。The processor 330 is the control center of the electronic device 300, and uses various interfaces and lines to connect various parts of the entire electronic device, and by running or executing software programs and/or modules stored in the memory 340, and calling The data stored in the memory 340 executes various functions of the electronic device 300 and processes data, thereby realizing various services based on the electronic device 300. Optionally, the processor 330 may include one or more processing units; specifically, the processor 330 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, User interface and application programs, etc., the modem processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 330. For example, in this application, the processor 330 may include a display driving unit, and after the processor 330 generates a picture book, the display driving unit may control the display panel 3611 to present the contents of the picture book through the display driving unit. For another example, a display driver program is stored in the memory 340, and the processor 330 may call the driver program in the memory 340 to control the display panel 3611 to present picture book content.
所述电子设备300还包括给各个部件供电的所述电源320(比如电池),可选的,所述电源320可以通过电源管理系统与所述处理器330逻辑相连,从而通过所述电源管理系统实现管理充电、放电、以及功耗等功能。The electronic device 300 also includes the power source 320 (such as a battery) for supplying power to various components. Optionally, the power source 320 may be logically connected to the processor 330 through a power management system, so as to pass through the power management system. Realize the functions of managing charging, discharging, and power consumption.
需要说明的是,尽管图3中未示出,所述电子设备300还可以包括摄像头、蓝牙模块、传感器等,在此不再赘述。It should be noted that, although not shown in FIG. 3, the electronic device 300 may also include a camera, a Bluetooth module, a sensor, etc., which will not be repeated here.
本申请实施例提供的基于绘本的问答交互方法中,主要包括两种交互过程:儿童向电子设备提问,电子设备回答儿童的问题;以及,电子设备主动向儿童提问,儿童回答电子设备的问题,电子设备判断儿童的回答是否正确。当然,还有上述两种过程中儿童和电子设备之间的其他语音交互。具体的在上述问答交互过程中,均需要进行数据处理和数据存储。本实施例中涉及到的存储的数据主要是绘本相关的一个数据库,具体的所述数据库可以包括实体属性库,语法库、字词集合和调用函数库。其中,进一步地,所述语法库中还可以包括问题模板库和答案模板库。示例性的,所述实体属性库用于存储绘本内容相关的多个实体名称以及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,其中,实体是指现实世界中客观存在的并可以相互区分的对象或事物,具体的,实体往往指某类事物的集合,可以是具体的人事物,也可以是抽象的概念、联系等;所述问题模板库用于存储用于生成问题的句式模板,也即所述问题模板库中包含至少一个问题模板,每一个问题模板可以包括多个槽位;所述调用函数库用于存储根据问题获取答案的调用函数,为每一个问题模板设置函数与参数,由函数限定从数据库提取该问题模板的答案所对应的路径和规则。所述问题模板库中的每一个问题模板可以对应所述调用函数库中的一个或多个调用函数;所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应;所述字词集合指示多个关键词与泛化词之间的对应关系,所述泛化词包括实体。所述数据库需要预先建立好,预存在所述电子设备中,由所述电子设备进行数据处理,或者预存在与所述电子设备连接的服务器中,由所述服务器辅助进行数据处理。下面简单介绍所述数据库的预先建立方法:The picture book-based question and answer interaction method provided by the embodiment of the application mainly includes two interactive processes: the child asks the electronic device and the electronic device answers the child's question; and the electronic device actively asks the child and the child answers the electronic device’s question. The electronic device determines whether the child's answer is correct. Of course, there are other voice interactions between the child and the electronic device in the above two processes. Specifically, in the above-mentioned question and answer interaction process, data processing and data storage are required. The stored data involved in this embodiment is mainly a database related to picture books, and the specific database may include an entity attribute library, a grammar library, a word collection, and a calling function library. Wherein, further, the grammar library may also include a question template library and an answer template library. Exemplarily, the entity attribute library is used to store multiple entity names and multiple entity attributes related to the content of the picture book, and the multiple entity names correspond to the multiple entity attributes in a one-to-one correspondence, wherein the entity refers to the real world Objects or things that exist objectively and can be distinguished from each other. Concrete entities often refer to a collection of certain types of things, which can be concrete people, things, abstract concepts, connections, etc.; the problem template library is used to store A sentence template used to generate a question, that is, the question template library contains at least one question template, and each question template may include multiple slots; the calling function library is used to store calling functions for obtaining answers based on questions, Set functions and parameters for each question template, and the function defines the path and rules corresponding to the answer to the question template from the database. Each question template in the question template library may correspond to one or more calling functions in the calling function library; the answer templates in the answer template library correspond to the calling functions in the calling function library one-to-one The word set indicates the correspondence between a plurality of keywords and generalized words, and the generalized words include entities. The database needs to be pre-established, pre-stored in the electronic device, and data processing by the electronic device, or pre-stored in a server connected to the electronic device, and the server assists in data processing. The following briefly introduces the pre-establishment method of the database:
例如,所述问题模板库的建立过程可以如下:For example, the process of establishing the question template library can be as follows:
a1、从数据提供机构等渠道收集问题样例,提取关键字词,组成精简的问题样例。a1. Collect problem samples from data providers and other channels, extract key words, and compose simplified problem samples.
以绘本《母鸡萝丝去散步》为例,收集到的问题样可以为“母鸡是什么颜色的?”,“萝丝什么颜色?”,“母鸡是黄色的?”,“这只母鸡是哪种颜色的呀?”等等。Take the picture book "Rose the Hen Going for a Walk" as an example, the collected questions can be "What color is the hen?", "What color is Rose?", "Is the hen yellow?", "This one What color is the hen?" Wait.
a2、根据问题样例,构建问题模板。a2. Construct a problem template based on the problem sample.
具体的,将表示相同意思的字词放在同一个集合中,对每个集合进行命名;例如,从上述a1示出的问题样例中提取的关键词中,“母鸡”,“萝丝”属于同类词,将这些同类词放在同一个集合中,可以对该集合命名为“实体(Entity)”;“什么”,“哪种”所在的集合可以命名为“普通词(What)”;“颜色”,“红色”,“黄色”等所在的集合可以命名为“颜色(Color)”(其中,颜色是一种具体的实体属性)。其中具体的,Entity、What、Color等可以被称为是泛化词。可以把指示多个关键词与泛化词之间的对应关系的字词集合存储在数据库中。例如,字词集合可以如表1所示:Specifically, put words with the same meaning in the same set, and name each set; for example, among the keywords extracted from the sample question shown in a1 above, "hen", "Rose "Belongs to the same kind of words. Putting these similar words in the same set can be named "Entity"; the set of "What" and "Which" are located can be named "Common word (What)" ; The collection of "color", "red", "yellow", etc. can be named "Color" (where color is a specific entity attribute). Specifically, Entity, What, Color, etc. can be called generalized words. A set of words indicating the correspondence between multiple keywords and generalized words can be stored in the database. For example, the word set can be as shown in Table 1:
表1Table 1
泛化词Generalized words 关键词Key words
EntityEntity 母鸡、萝丝、母鸡萝丝Hen, rose, rose hen
WhatWhat 什么、哪种What, what
ColorColor 颜色、红色、黄色、蓝色Color, red, yellow, blue
然后,利用字词集合中泛化词代替问题样例中具体的字词,得到泛化后的问题样例,即泛化后的问题。其中,泛化是指由具体的、个别的扩大为一般的,例如,母鸡泛化为Entity。Then, the generalized words in the word set are used to replace the specific words in the problem sample to obtain the generalized problem sample, that is, the generalized problem. Among them, generalization refers to the expansion of specific and individual to general, for example, generalization of hens to Entity.
示例性的,上述问题样例泛化后,得到的问题模板可以为(Entity)[是][What](Color),其他的问题模板如(Entity)[在][Where]等等。建立好的问题模板库中的问题模板如表2所示:Exemplarily, after the above question samples are generalized, the question template obtained can be (Entity)[是][What](Color), other question templates such as (Entity)[在][Where] and so on. The problem templates in the established problem template library are shown in Table 2:
表2Table 2
问题模板1Question template 1 (Entity)[是][What](Color)(Entity)[是][What](Color)
问题模板2Question template 2 (Entity)[在][Where](Entity)[在][Where]
其中,所述问题模板由必选词语集合名、必选词语、选填词语集合名、选填词语组合而成,必选词语集合名或必选词语填入()中,选填词语集合名或选填词语填入[]中,其中()、[]中的内容都可以叫做问题模板包括的槽位。Wherein, the question template is a combination of mandatory word set names, mandatory words, optional word set names, and optional words. Fill in the mandatory word set names or mandatory words in (), and fill in the optional word set names Or fill in the optional words in [], where the content in () and [] can be called the slots included in the question template.
例如,所述调用函数库的建立过程可以如下:For example, the process of establishing the calling function library may be as follows:
为每一个问题模板设置一个调用函数。其中,所述调用函数可以包含函数与参数,其中函数限定从实体属性库提取该问题模板的答案所对应的路径和规则,也即函数表示的函数含义,包括提取答案的表名,表中需要提取的字段名等。由函数来表达用户的意图。参数对应问题模板的输出,为函数提供限制条件。例如,上述问题模板1对应的调用函数可以为:Set up a calling function for each question template. Wherein, the calling function may include functions and parameters, where the function defines the path and rules corresponding to the answer to the question template extracted from the entity attribute library, that is, the meaning of the function represented by the function, including the name of the table for extracting the answer. Extracted field names, etc. The function expresses the user's intention. The parameters correspond to the output of the problem template and provide constraints for the function. For example, the calling function corresponding to the above question template 1 can be:
getColor(Entity,What,Color):获取指定实体的颜色。getColor(Entity,What,Color): Get the color of the specified entity.
isExist(Entity,What):判断否存在查询实体。isExist(Entity,What): Determine whether the query entity exists.
isFact(Entity,Color):判断实体颜色是否和事实相符。isFact(Entity,Color): Determine whether the color of the entity matches the facts.
示例性的,所述问题模板1对应的调用函数可以如表3所示:Exemplarily, the calling function corresponding to the question template 1 may be as shown in Table 3:
表3table 3
Figure PCTCN2020086872-appb-000001
Figure PCTCN2020086872-appb-000001
例如,答案模板库的建立过程即为每一个调用函数设置一个答案模板。例如,每个调用函数对应的答案模板可以如表4所示:For example, the establishment process of the answer template library is to set an answer template for each calling function. For example, the answer template corresponding to each calling function can be as shown in Table 4:
表4Table 4
调用函数(函数+参数)Call function (function + parameter) 答案模板Answer template
1、getColor(Entity,What,Color)1.getColor(Entity,What,Color) Entity是Color的Entity is Color
2、isExist(Entity,What)2. isExist(Entity,What) 有EntityEntity
3、isFact(Entity,Color)3. isFact(Entity,Color) Entity是Color的Entity is Color
基于建立的上述数据库中的内容,就可以实现儿童和电子设备之间的问答交互过程中的数据处理,从而实现人机交互。下面以具体的示例介绍本申请实施例提供的基于绘本的问答交互方法。Based on the content in the established database, data processing in the question and answer interaction process between the child and the electronic device can be realized, thereby realizing human-computer interaction. The following uses a specific example to introduce the question and answer interaction method based on a picture book provided by the embodiment of the present application.
实施例一:儿童向电子设备提问,电子设备回答的具体方法流程。其中,所述电子设备可以是图2中示出的或者未示出的能实现本申请实施例提供的基于绘本的问答交互方法 的任一种设备,所述电子设备应用于图3所示的电子设备。参阅图4所示,该方法具体流程可以包括:Embodiment 1: The child asks questions to the electronic device and the electronic device answers the specific method flow. The electronic device may be any device shown in FIG. 2 or not shown that can implement the picture book-based question and answer interaction method provided in the embodiment of the present application, and the electronic device is applied to the device shown in FIG. 3 Electronic equipment. Referring to Figure 4, the specific process of the method may include:
步骤401:电子设备加载与目标绘本相关的数据库。Step 401: The electronic device loads a database related to the target picture book.
其中,所述数据库中包括实体属性库、问题模板库、调用函数库、答案模板库和字词集合,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应,所述字词集合指示多个关键词与泛化词之间的对应关系,所述泛化词包括实体。Wherein, the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set. The entity attribute library includes multiple entity names and multiple entity attributes, and the multiple entity names are related to The multiple entity attributes are in one-to-one correspondence, the question template library includes at least one question template, the call function library includes at least one call function, and each question template in the question template library corresponds to the call function One or more calling functions in the library, each question template in the question template library includes multiple slots, the answer template library includes at least one answer template, and the answer template in the answer template library is consistent with all the The calling functions in the calling function library have a one-to-one correspondence, and the word set indicates the correspondence between a plurality of keywords and generalized words, and the generalized words include entities.
应理解,所述目标绘本为需要为儿童阅读的绘本。It should be understood that the target picture book is a picture book that needs to be read by children.
示例性的,在所述电子设备加载与所述目标绘本相关的数据库之前,所述电子设备基于儿童的指令确定所述目标绘本,具体的,所述电子设备确定所述目标绘本的方法可能有多种:Exemplarily, before the electronic device loads the database related to the target picture book, the electronic device determines the target picture book based on a child's instruction. Specifically, the method for the electronic device to determine the target picture book may include Variety:
在一种实施方式中,所述电子设备向儿童询问儿童想要听的绘本,例如所述电子设备向儿童问“我们读个故事好不好?”,儿童回答“好,我要听母鸡萝丝”,所述电子设备接收到用户的回答后,根据语义分析和匹配确定所述目标绘本为《母鸡萝丝去散步》。In one embodiment, the electronic device asks the child which picture book the child wants to listen to. For example, the electronic device asks the child "Shall we read a story?", and the child answers "OK, I want to listen to the hen "Silk", after receiving the user's answer, the electronic device determines that the target picture book is "Hen Rose Going for a Walk" according to semantic analysis and matching.
可选的,当所述电子设备不能进行数据处理时,所述电子设备将接收到的儿童的回答发送给服务器,由所述服务器进行语义分析和匹配,然后确定所述目标绘本后,将确定的结果通知所述电子设备,然后所述电子设备根据所述确定的结果得知所述目标绘本为《母鸡萝丝去散步》。Optionally, when the electronic device cannot perform data processing, the electronic device sends the child's answer received to the server, and the server performs semantic analysis and matching, and then after determining the target picture book, it will determine The result of notifying the electronic device, and then the electronic device knows that the target picture book is "Rose the Hen Going for a Walk" according to the determined result.
在另一种实施方式中,当所述电子设备具有显示触摸屏时,例如手机,具有显示触摸屏的机器人等时,所述显示触摸屏上可以显示绘本目录,即显示多个绘本供儿童选择,根据儿童点击选择的绘本来确定所述目标绘本。例如,儿童在所述显示触摸屏上点击了《母鸡萝丝去散步》,所述电子设备即确定所述目标绘本为《母鸡萝丝去散步》。In another embodiment, when the electronic device has a display touch screen, such as a mobile phone, a robot with a display touch screen, etc., a picture book catalog can be displayed on the display touch screen, that is, multiple picture books are displayed for children to choose. Click the selected picture book to confirm the target picture book. For example, if the child clicks "Rose the Hen Going for a Walk" on the display touch screen, the electronic device determines that the target picture book is "Rose the Hen Going for a Walk".
在另一种实施方式中,当所述电子设备具有摄像头时,例如所述电子设备是手机,具有显示触摸屏的机器人等时,所述电子设备可以通过所述摄像头采集所述儿童展示的绘本的图像,通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。In another embodiment, when the electronic device has a camera, for example, when the electronic device is a mobile phone, a robot with a touch screen, etc., the electronic device can collect information of the picture book displayed by the child through the camera. Image, the image of the collected picture book is analyzed by image analysis technology to determine the target picture book.
可选的,当所述电子设备不能进行数据处理时,所述电子设备将所述摄像头采集的绘本的图像发送给服务器,由所述服务器通过图像分析技术对采集到的绘本的图像进行分析以,然后确定所述目标绘本后,将确定的结果通知所述电子设备,然后所述电子设备根据所述确定的结果得知所述目标绘本。Optionally, when the electronic device cannot perform data processing, the electronic device sends the image of the picture book collected by the camera to the server, and the server analyzes the collected image of the picture book through image analysis technology. , And then after determining the target picture book, notify the electronic device of the determined result, and then the electronic device learns the target picture book according to the determined result.
当然,所述电子设备确定所述目标绘本的方式还有除上述方式之外的多种方式,此处不再一一列举。Of course, the electronic device may determine the target picture book in multiple ways other than the above methods, which will not be listed here.
在以下的描述中,均以所述目标绘本为《母鸡萝丝去散步》为例进行说明。In the following description, the target picture book is "Rose the Hen Going for a Walk" as an example.
在具体实施时,当数据库存储于所述电子设备中时,所述电子设备可以直接从所述电子设备的存储器或其他模块中加载与所述目标绘本相关的数据库;当所述数据库存储于服务器中时,所述电子设备需要从所述服务器中加载与所述目标绘本相关的数据库。In specific implementation, when the database is stored in the electronic device, the electronic device can directly load the database related to the target picture book from the memory or other modules of the electronic device; when the database is stored in the server In the middle, the electronic device needs to load the database related to the target picture book from the server.
其中,所述电子设备获取的数据库中,包括所述实体属性库。例如,当所述目标绘本为《母鸡萝丝去散步》时,所述电子设备从本地或者从服务器加载的所述实体属性库,可 以如表5所示:Wherein, the database acquired by the electronic device includes the entity attribute database. For example, when the target picture book is "Hen Rose Going for a Walk", the entity attribute library loaded by the electronic device locally or from a server may be as shown in Table 5:
表5table 5
实体(Entity)Entity 实体属性(Color)Entity attributes (Color)
母鸡hen 红色red
小鸟Little bird 黄色yellow
狐狸fox 棕黄色Brownish yellow
……... ……...
其中,表5中实体的实体名称可以为母鸡、小鸟、狐狸……,然后各个实体名称相对应的实体属性为红色、黄色、棕黄色……。Among them, the entity names of the entities in Table 5 can be hen, bird, fox..., and the corresponding entity attributes of each entity name are red, yellow, brown....
在一种实施方式中,所述电子设备加载的与所述目标绘本相关的数据库中包括的所述问题模板库和所述调用函数库,可以如表6所示:In an embodiment, the question template library and the calling function library included in the database related to the target picture book loaded by the electronic device may be as shown in Table 6:
表6Table 6
Figure PCTCN2020086872-appb-000002
Figure PCTCN2020086872-appb-000002
步骤402:所述电子设备接收所述儿童提出的问题。Step 402: The electronic device receives the question raised by the child.
其中,在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到的所述儿童提出的问题时,均默认为所述儿童是基于所述目标绘本提出的,也即所述儿童提出的问题均被认为是与所述目标绘本相关的。Wherein, when the electronic device reads the target picture book, when the electronic device receives the question posed by the child, it defaults that the child asked based on the target picture book, that is, the The children’s questions are considered to be related to the target picture book.
具体的,所述电子设备可以通过输入单元获取到儿童提出的问题后,向所述电子设备的处理器传输所述儿童提出的问题,以使所述处理器分析所述儿童提出的问题;或者所述电子设备的所述处理器将所述儿童提出的问题传输给服务器,使所述服务器分析所述儿童提出问题。Specifically, the electronic device may obtain the child's question through the input unit, and then transmit the child's question to the processor of the electronic device, so that the processor can analyze the child's question; or The processor of the electronic device transmits the question raised by the child to a server, so that the server analyzes the question raised by the child.
例如,儿童通过所述电子设备的麦克风向所述电子设备输入问题“母鸡是什么颜色的?”。For example, the child inputs the question "What color is the hen?" to the electronic device through the microphone of the electronic device.
步骤403:所述电子设备对所述儿童提出的问题进行分词处理得到分词词串,所述分词词串为多个关键词文本序列。Step 403: The electronic device performs word segmentation processing on the question posed by the child to obtain a word segmentation string, and the word segmentation string is a plurality of keyword text sequences.
具体的,所述电子设备对所述儿童提出问题进行分词处理,将所述儿童提出的问题分成“母鸡”“是”“什么”“颜色”“的”5个词语,例如可以得到分词词串“母鸡是什么颜色的”。Specifically, the electronic device performs word segmentation processing on the child's question, and divides the child's question into five words: "hen", "yes", "what", "color", and "of". For example, the word segmentation can be obtained. String "what color is the hen".
步骤404:所述电子设备根据所述分词词串和所述字词集合得到泛化后的问题,所述泛化后的问题为多个泛化词文本序列。Step 404: The electronic device obtains a generalized question according to the word segmentation word string and the word set, and the generalized question is a plurality of generalized word text sequences.
具体的,所述电子设备对所述分词词串问题基于所述字词集合进行泛化。Specifically, the electronic device generalizes the word segmentation word string problem based on the word set.
首先,所述电子设备将所述分词词串中的关键词通过该目标绘本对应的问题模板库构建过程中得到的所述字词集合(例如表1)进行词语匹配。其中“母鸡”在字词集合中有对应的关键词是“母鸡”,“什么”在字词集合中有对应的关键词“什么”,“颜色”在字词 集合中有对应的关键词是“颜色”。例如,表7所示的标注出来的关键词:First, the electronic device matches the keywords in the word segmentation string through the word set (for example, Table 1) obtained during the construction of the question template library corresponding to the target picture book. Among them, "hen" has a corresponding key word in the word set is "hen", "what" has a corresponding key word "what" in the word set, and "color" has a corresponding key in the word set The word is "color". For example, the marked keywords shown in Table 7:
表7Table 7
实体:EntityEntity: Entity 母鸡、萝丝、母鸡萝丝、狐狸、钉耙 Hen , rose, hen rose, fox, rake
属性:ColorProperty: Color 颜色、红色、黄色、蓝色 Color , red, yellow, blue
普通词:WhatCommon words: What 什么、哪种 What , what
然后,所述电子设备根据所述字词集合确定所述分词词串中各个关键词对应的泛化词。例如,“母鸡”对应的泛化词为“Entity”,“什么”对应的泛化词是“What”,“颜色”对应的泛化词是“Color”。Then, the electronic device determines a generalized word corresponding to each keyword in the word segmentation string according to the word set. For example, the generalized word corresponding to "hen" is "Entity", the generalized word corresponding to "What" is "What", and the generalized word corresponding to "Color" is "Color".
通过上述方法,所述电子设备得到所述泛化后的问题即为“Entity是What Color”。Through the above method, the generalized question obtained by the electronic device is "Entity is What Color".
步骤405:所述电子设备从所述泛化后的问题中提取出所述儿童提出的问题所对应的实体名称,所述儿童提出的问题所对应的实体名称为所述泛化后的问题中被泛化成实体的关键词。Step 405: The electronic device extracts the entity name corresponding to the question posed by the child from the generalized question, and the entity name corresponding to the question posed by the child is in the generalized question Keywords that are generalized into entities.
例如,从步骤404中泛化后的问题中提取出所述儿童提出的问题所对应的实体名称为“母鸡”。For example, the entity name corresponding to the question asked by the child is extracted from the generalized question in step 404 as "hen".
步骤406:所述电子设备根据所述泛化后的问题与所述问题模板库中问题模板的文本相似度,从所述问题模板库中获取被提问问题模板。Step 406: The electronic device obtains the question template to be asked from the question template library according to the text similarity between the generalized question and the question template in the question template library.
在一种可选的实施方式中,所述电子设备可以基于编辑距离最小的方法,根据泛化后的问题从所述问题模板库中获取所述被提问问题模板。其中,所述编辑距离最小的方法为:将所述泛化后的问题去修改成一个问题模板时,需要改动的次数最少的问题模板,即为所述被提问问题模板。In an optional implementation manner, the electronic device may obtain the question template to be asked from the question template library according to the generalized question based on the method with the smallest edit distance. Wherein, the method for the smallest edit distance is: when the generalized question is modified into a question template, the question template with the least number of changes is the question template being asked.
当然除上述方法外,所述电子设备还可以采用其他方式从所述问题模板库中获取所述被提问问题模板,例如根据所述泛化后的问题中的关键词去匹配所述问题模板库中的问题模板,匹配率最高的问题模板作为所述被提问问题模板。Of course, in addition to the above method, the electronic device may also obtain the question template to be asked from the question template library in other ways, for example, matching the question template library according to the keywords in the generalized question As the question template in question, the question template with the highest matching rate is used as the question template.
其中,上述方法均是利用泛化后的问题与所述问题模板库中问题模板的文本相似度实现的。Among them, the above methods are all implemented by using the text similarity between the generalized question and the question template in the question template library.
通过上述方法,确定泛化后的问题“Entity是What Color”对应的被提问问题模板为(Entity)[是][What](Color)。Through the above method, it is determined that the question template corresponding to the generalized question "Entity is What Color" is (Entity)[是][What](Color).
步骤407:所述电子设备根据所述被提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取被提问调用函数。Step 407: The electronic device obtains the questioned call function from the call function library according to the matching degree between the slot of the question template and the parameter of the call function in the call function library.
其中,所述被提问调用函数的参数的数量和类型与所述被提问问题模板的槽位的数量和类型的匹配程度最高。Wherein, the number and types of parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template.
在一种可选的实施方式中,当所述调用函数库中包含一个所述被提问问题模板对应的调用函数时,所述电子设备直接将这一个调用函数作为所述被提问调用函数。这里应理解这一个调用函数的参数的数量和类型与所述被提问问题模板的槽位的数量和类型匹配程度最高。In an optional implementation manner, when the calling function library contains a calling function corresponding to the questioned question template, the electronic device directly uses this calling function as the calling function of the questioned. It should be understood here that the number and types of parameters of this calling function match the number and types of slots of the question template to the highest degree.
在另一种可选的实施方式中,当所述调用函数库中包含多个所述被提问问题模板对应的调用函数时,所述电子设备根据所述被提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取被提问调用函数,具体方法可以为:所述电子设备从所述调用函数库中获取参数的数量和类型与所述被提问问题模板中的槽位的数量和类型匹配程度最高的调用函数,则确定了所述被提问问题模板对应的所述被提问调 用函数。In another optional implementation manner, when the calling function library contains multiple calling functions corresponding to the question template, the electronic device compares the slots of the question template with the The matching degree of the parameters of the calling function in the calling function library is obtained, and the calling function in question is obtained from the calling function library. The specific method may be: the electronic device obtains the number and type of parameters from the calling function library and the The calling function with the highest matching degree between the number of slots and the type in the question template being asked determines the call function being questioned corresponding to the question template being asked.
其中,一个调用函数的参数的数量和类型与所述被提问问题模板中的槽位的数量和类型匹配程度最高,具体是指该调用函数和所述被提问问题模板中相同类型的参数与槽位的数量最多。Among them, the number and types of parameters of a calling function match the number and types of slots in the question template to the highest degree, specifically referring to the parameters and slots of the same type in the calling function and the question template. The number of bits is the largest.
例如,调用函数getColor(Entity,What,Color)与所述被提问问题模板(Entity)[是][What](Color)匹配的相同类型的参数与槽位的数量最多(有3个类型的参数与槽位匹配),因此确定该调用函数为所述被提问调用函数。具体的,调用函数中的参数Entity与所述被提问问题模板中的槽位Entity均属于相同类型,调用函数中的参数What与所述被提问问题模板中的槽位What均属于相同类型,调用函数中的参数Color与所述被提问问题模板中的槽位Color均属于相同类型,一共3个相同类型的参数与槽位,比其它调用函数与所述被提问问题模板相同类型的参数与槽位的数量都多。For example, calling the function getColor(Entity,What,Color) matches the question template (Entity)[是][What](Color) with the same type of parameters and the largest number of slots (there are 3 types of parameters) Matches the slot), therefore, it is determined that the calling function is the called function being questioned. Specifically, the parameter Entity in the calling function and the slot Entity in the question template are all of the same type, and the parameter What in the calling function and the slot What in the question template are both of the same type. The parameter Color in the function and the slot Color in the question template are of the same type. There are 3 parameters and slots of the same type, which are the same types of parameters and slots as other calling functions and the question template. The number of bits is large.
步骤408:所述电子设备根据所述被提问调用函数和所述儿童提出的问题所对应的实体名称,从所述实体属性库中获取所述儿童提出的问题所对应的实体名称对应的实体属性。Step 408: The electronic device obtains the entity attribute corresponding to the entity name corresponding to the question posed by the child from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the child .
示例性的,这里可以将所述电子设备获取的所述儿童提出的问题所对应的实体名称及所述儿童提出的问题所对应的实体名称对应的实体属性作为待回答答案关键词。Exemplarily, the entity name corresponding to the question posed by the child and the entity attribute corresponding to the entity name corresponding to the question posed by the child acquired by the electronic device may be used as the answer keywords to be answered.
具体的,所述电子设备根据所述被提问调用函数和所述儿童提出的问题所对应的实体名称,从所述实体属性库中获取所述儿童提出的问题所对应的实体名称对应的实体属性时,需要结合所述被提问调用函数表示的函数含义和所述儿童提出的问题所对应的实体名称,从所述实体属性库中获取所述儿童提出的问题所对应的实体名称对应的实体属性。例如,所述电子设备将所述儿童提出的问题所对应的实体名称代入所述被提问调用函数得到getColor(母鸡,什么,颜色),getColor函数的含义是在实体属性库中查询某个实体的颜色。根据前述实体属性库示例中查询到实体名称“母鸡”的color属性是“红色”,因此获取的所述儿童提出的问题所对应的实体名称对应的实体属性为“红色”,也即待回答答案关键词(实体名称+实体名称对应的实体属性)为“母鸡”“红色”。Specifically, the electronic device obtains the entity attribute corresponding to the entity name corresponding to the question posed by the child from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the child At the time, it is necessary to combine the meaning of the function represented by the function called by the question and the entity name corresponding to the question posed by the child, and obtain the entity attribute corresponding to the entity name corresponding to the question posed by the child from the entity attribute library . For example, the electronic device substitutes the name of the entity corresponding to the question posed by the child into the questioned calling function to obtain getColor (hen, what, color). The meaning of the getColor function is to query an entity in the entity attribute library. s color. According to the aforementioned example of the entity attribute library, the color attribute of the entity name "hen" is "red", so the entity attribute corresponding to the entity name corresponding to the question asked by the child is "red", that is, to be answered The answer key word (entity name + entity attribute corresponding to the entity name) is "hen" and "red".
步骤409:所述电子设备根据所述被提问调用函数从所述答案模板库中获取待回答答案模板,所述待回答答案模板为所述答案模板库中与所述被提问调用函数对应的答案模板。Step 409: The electronic device obtains an answer template to be answered from the answer template library according to the called function of the question, where the answer template to be answered is an answer corresponding to the function of the question called in the answer template library template.
例如,所述电子设备从所述答案模板库中可以获取所述被提问调用函数对应的所述待回答答案模板为Entity是Color的。For example, the electronic device may obtain from the answer template library that the answer template to be answered corresponding to the function called by the question is that the Entity is Color.
步骤410:基于所述待回答答案模板,所述电子设备将所述儿童提出的问题所对应的实体名称及所述用户提出的问题所对应的实体名称对应的实体属性生成待回答答案。Step 410: Based on the answer template, the electronic device generates an answer to be answered by using the entity name corresponding to the question asked by the child and the entity attribute corresponding to the entity name corresponding to the question asked by the user.
其中,所述电子设备将所述儿童提出的问题所对应的实体名称及实体属性生成所述待回答答案,也即所述电子设备将所述待回答答案关键词生成所述待回答答案。Wherein, the electronic device generates the answer to be answered by the entity name and entity attribute corresponding to the question asked by the child, that is, the electronic device generates the answer to be answered by the keyword of the answer to be answered.
例如,所述待回答答案模板为Entity是Color的,所述电子设备将所述儿童提出的问题所对应的实体名称及所述用户提出的问题所对应的实体名称对应的实体属性(也即待回答答案关键词)“母鸡”“红色”根据所述待回答答案模板组合成句子为“母鸡是红色的”,即生成了所述待回答答案。For example, the answer template for the answer to be answered is Entity is Color, and the electronic device converts the entity name corresponding to the question posed by the child and the entity attribute corresponding to the entity name corresponding to the question posed by the user. Answer key word) "hen" and "red" are combined into a sentence "hen is red" according to the answer template to be answered, that is, the answer to be answered is generated.
步骤411:所述电子设备向所述儿童输出所述待回答答案。Step 411: The electronic device outputs the answer to be answered to the child.
在一种可选的实施方式中,所述电子设备先将所述待回答答案合成为语音,通过语音播放所述待回答答案。In an optional implementation manner, the electronic device first synthesizes the answer to be answered into a voice, and plays the answer to be answered through the voice.
具体的,所述电子设备通过扬声器播放所述待回答答案对应的语音。Specifically, the electronic device plays the voice corresponding to the answer to be answered through a speaker.
需要说明的是,所述电子设备执行上述步骤403到步骤410是建立在所述电子设备具备数据存储和数据处理能力的前提下,当所述电子设备不具备数据存储和数据处理能力时,所述电子设备在接收到所述儿童提出的问题后,将所述儿童提出的问题传输给与所述电子设备连接的服务器,所述服务器执行上述步骤403到步骤410中所述电子设备的操作,然后所述服务器将待回答答案传输给所述电子设备,以使所述电子设备直接执行步骤411。It should be noted that the execution of the above steps 403 to 410 by the electronic device is based on the premise that the electronic device has data storage and data processing capabilities. When the electronic device does not have data storage and data processing capabilities, After the electronic device receives the child's question, it transmits the child's question to the server connected to the electronic device, and the server performs the operation of the electronic device in the above steps 403 to 410, Then, the server transmits the answer to be answered to the electronic device, so that the electronic device directly executes step 411.
采用本申请实施例提供的基于绘本的问答交互方法,电子设备或者服务器可以根据儿童提出的问题基于与目标绘本相关的数据库灵活自行确定答案,并不需要机械地预设好问题答案,儿童可以不需要按照预设的问题进行提问,可以灵活提问,电子设备也可以回答更多的问题,从而可以使在绘本阅读过程中电子设备和儿童的交互更加智能,可以提高阅读绘本有效性,提升儿童体验。Using the picture book-based question and answer interactive method provided by the embodiment of the present application, the electronic device or server can flexibly determine the answer based on the database related to the target picture book according to the question asked by the child, and does not need to preset the answer to the question mechanically. You need to ask questions according to preset questions, you can ask questions flexibly, and the electronic device can answer more questions, so that the interaction between the electronic device and the child during the picture book reading process can be more intelligent, which can improve the effectiveness of reading picture books and enhance the children’s experience .
实施例二:电子设备向儿童提问,儿童回答的具体方法流程。其中,所述电子设备可以是图2中示出的或者未示出的能实现本申请实施例提供的基于绘本的问答交互方法的任一种设备,所述电子设备应用于图3所示的电子设备。参阅图5所示,该方法具体流程可以包括:Embodiment 2: The electronic device asks the child a question and the child answers the specific method flow. The electronic device may be any device shown in FIG. 2 or not shown that can implement the picture book-based question and answer interaction method provided in the embodiment of the present application, and the electronic device is applied to the device shown in FIG. 3 Electronic equipment. Referring to Figure 5, the specific process of the method may include:
步骤501:所述电子设备加载与目标绘本相关的数据库。Step 501: The electronic device loads a database related to the target picture book.
其中,所述数据库中包括实体属性库、问题模板库和调用函数库,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位。Wherein, the database includes an entity attribute library, a question template library, and a calling function library. The entity attribute library includes multiple entity names and multiple entity attributes, and the multiple entity names are one-to-one with the multiple entity attributes. Correspondingly, the question template library includes at least one question template, the call function library includes at least one call function, and each question template in the question template library corresponds to one or more calls in the call function library Function, each question template in the question template library includes multiple slots.
具体的,步骤501与上述实施例中步骤401类似,具体可以相互参见,此处不再重复赘述。Specifically, step 501 is similar to step 401 in the foregoing embodiment, and reference may be made to each other for details, and details are not repeated here.
步骤502:所述电子设备根据问题模板信息从所述问题模板库中获取待提问问题模板,其中,述问题模板信息为转移概率集合或问题模板类型,所述转移概率集合包括历史问题模板与所述问题模板库中其他问题模板之间的转移概率,所述历史问题模板为所述电子设备在生成上一次向用户提出的问题的过程中获取的问题模板,所述历史问题模板用于生成上一次向所述用户提出的问题的问题模板,所述问题模板类型与所述用户的年龄相关。Step 502: The electronic device obtains a question template to be asked from the question template library according to the question template information, where the question template information is a transition probability set or a question template type, and the transition probability set includes historical question templates and all questions. The transition probability between other question templates in the question template library, the historical question template is the question template acquired by the electronic device in the process of generating the last question posed to the user, and the historical question template is used to generate the upper A question template of a question posed to the user at a time, and the type of the question template is related to the age of the user.
在现实生活中,在父母为孩子讲故事的过程中,通常讲完一个故事,父母都会问孩子一些问题,以了解孩子对故事的理解程度。基于此,所述电子设备替代父母的角色,在阅读绘本过程中,讲完一段故事或者阅读到精彩片段时,所述电子设备可以识别到需要向儿童提问,则所述电子设备会执行后续的提问过程。In real life, when parents tell a story for their children, usually after telling a story, parents will ask their children some questions to understand the children's understanding of the story. Based on this, the electronic device replaces the role of parents. In the process of reading a picture book, when a story is finished or a highlight is read, the electronic device can recognize that it is necessary to ask the child a question, and the electronic device will execute the subsequent Questioning process.
在所述电子设备第一次向所述儿童提问的过程中,所述电子设备可以随机从所述问题模板库中选择一个问题模板作为所述待提问问题模板。在所述电子设备第二次或者更多次向所述儿童提问的过程中,所述电子设备仍可以随机从所述问题模板库中选择一个问题模板作为所述待提问问题模板,或者所述电子设备通过步骤502中的方法获取所述待提问问题模板。When the electronic device asks the child a question for the first time, the electronic device may randomly select a question template from the question template library as the question template to be asked. In the process of the electronic device asking the child questions for the second or more times, the electronic device may still randomly select a question template from the question template library as the question template to be asked, or the The electronic device obtains the question template to be asked by the method in step 502.
示例1:所述问题模板信息为所述转移概率集合时,所述电子设备根据所述问题模板信息从所述问题模板库中获取待提问问题模板,具体方法可以为:所述电子设备根据预先确定的随机取值从所述转移概率集合中确定目标转移概率;所述电子设备根据所述目标转移概率从所述问题模板库中获取所述待提问问题模板。Example 1: When the question template information is the transition probability set, the electronic device obtains the question template to be asked from the question template library according to the question template information. The specific method may be: the electronic device The determined random value determines the target transition probability from the transition probability set; the electronic device obtains the question template to be asked from the question template library according to the target transition probability.
其中,所述随机取值大于设定阈值。所述随机取值可以是在需要获取所述待提问问题模板时,当前确定的一个随机数;所述随机取值还可以是在预设好的多个数值中随机选取确定的一个数值。当然还可以为其他情况,本申请对此不作限定。Wherein, the random value is greater than a set threshold. The random value may be a random number that is currently determined when the question template to be asked needs to be obtained; the random value may also be a value that is randomly selected and determined from a plurality of preset values. Of course, it can also be in other situations, which are not limited in this application.
示例2:所述问题模板信息为所述问题模板类型时,所述电子设备根据所述问题模板信息从所述问题模板库中获取待提问问题模板,具体方法可以为:所述电子设备根据所述用户的年龄以及年龄与问题模板类型的对应关系确定目标问题模板类型;所述对应关系指示用户的年龄与以下至少一个问题模板类型对应:空间、细节、社会、色彩、数字、文字、自然;所述电子设备从所述问题模板库中获取符合所述目标问题模板类型的问题模板作为所述待提问问题模板。Example 2: When the question template information is the question template type, the electronic device obtains the question template to be asked from the question template library according to the question template information. The specific method may be: State the age of the user and the corresponding relationship between the age and the question template type to determine the target question template type; the correspondence indicates that the user's age corresponds to at least one of the following question template types: space, detail, society, color, number, text, nature; The electronic device obtains a question template that meets the target question template type from the question template library as the question template to be asked.
在上述示例1中,在所述电子设备已经提问过所述儿童问题的场景中,所述电子设备可以根据所述电子设备在生成上一次向所述儿童提出的问题的过程中获取的问题模板获取所述待提问问题模板,这样可以达到多样化提问,避免儿童感到枯燥,提高儿童对绘本阅读的兴趣,从而提升儿童体验。例如,可以通过设置问题模板之间的转移概率实现基于一个问题模板确定另一个问题模板的目的。这样就需要在建立数据库时,预先将问题模板之间的转移概率设置好。其中,可以遵循意思相近的问题模板之间的转移概率较低,意思差异大的问题模板之间的转移概率较高的原则为问题模板之间设置转移概率。其中,可选的,每两个问题模板之间的转移概率可以通过预先人工设置好,还可以基于统计的方法,分析所述儿童提出的问题,根据命中的问题模板的多少,来计算每两个模板之间的转移概率。例如,图6示出的一种问题模板之间的转移概率的示意图。In the above example 1, in a scenario where the electronic device has already asked the child's question, the electronic device may use the question template acquired by the electronic device in the process of generating the last question posed to the child Obtaining the template of the question to be asked can achieve diversified questions, prevent children from feeling bored, and increase children's interest in picture book reading, thereby enhancing children's experience. For example, by setting the transition probability between question templates, the purpose of determining one question template based on another question template can be achieved. In this way, it is necessary to set the transition probability between question templates in advance when building the database. Among them, the transition probability between question templates with similar meanings is lower, and the transition probability between question templates with large meaning differences is higher. Wherein, optionally, the transition probability between every two question templates can be manually set in advance, and it can also be based on statistical methods to analyze the questions asked by the child, and calculate every two according to the number of question templates hit. Probability of transition between templates. For example, FIG. 6 shows a schematic diagram of transition probability between question templates.
例如,若所述电子设备在生成上一次向所述儿童提出的问题的过程中获取的问题模板(即所述历史问题模板)为图6中的问题模板1时,所述电子设备确定一个随机取值为0.34时,所述电子设备可以根据图6示出的与问题模板1之间的转移概率(即所述转移概率集合)中接近0.34的转移概率(即所述目标转移概率)为0.34;然后所述电子设备可以确定与所述问题模板1之间的转移概率为0.34的问题模板,此时由图6可以看出图6中的问题模板2可以作为所述待提问问题模板。For example, if the question template (ie, the historical question template) obtained by the electronic device in the process of generating the last question posed to the child is question template 1 in FIG. 6, the electronic device determines a random When the value is 0.34, the transition probability (that is, the target transition probability) close to 0.34 in the transition probability between the electronic device and the problem template 1 shown in FIG. 6 (that is, the transition probability set) is 0.34 ; Then the electronic device can determine a question template with a transition probability of 0.34 between the question template 1 and at this time, it can be seen from FIG. 6 that the question template 2 in FIG. 6 can be used as the question template to be asked.
当然,上述过程同样可以由与电子设备连接的服务器实现,本申请对此不作限定。Of course, the above process can also be implemented by a server connected to the electronic device, which is not limited in this application.
通过上述方法向儿童提问,可以使提问更具多样性,避免儿童枯燥,调动儿童的积极性,提高儿童对绘本阅读的兴趣。Questioning children through the above methods can make the questions more diverse, avoid children's boringness, mobilize children's enthusiasm, and increase children's interest in picture book reading.
在上述示例2中,在预先建立问题模板库时还可以为问题模板库中的问题模板进行类型设置。由于儿童心理发展过程中的某个时期,相对于其他时期更容易学习某种知识和行为,心理过程的某个方面发展最为迅速,这时期即称为“敏感期”。敏感期的理论由意大利教育家蒙台稄利提出,敏感期不仅是儿童学习的关键期,同时也影响其心灵、人格的发展。例如,0-9岁的儿童经历的31个敏感期中,包括肌肉敏感期:1-3岁;对细微事物感兴趣的敏感期:1.5-4岁;语言敏感期:1.5岁-2.5岁;社会规范敏感期:2岁半-4岁;空间的敏感期:3-4岁;色彩敏感期:3-4岁;数学概念敏感期:4.5岁-7岁;认字敏感期:5岁-7岁;动植物、科学实验、收集敏感期:6岁-7岁;文化敏感期:6岁-9岁,等等。根据儿童的发展阶段提出问题,可以更有效地促进儿童的成长。因此,可以为问题模板设置问题模板类型,并在数据库中存储问题模板类型与儿童年龄(也可以理解为儿童发展阶段或者儿童的年龄段)的匹配表,当儿童处于相应的年龄(发展阶段或者年龄段)时,增加相应的问题类型被选择的概率。In the above example 2, when the question template library is established in advance, the type setting for the question templates in the question template library can also be performed. Because a certain period in the process of children's psychological development is easier to learn certain knowledge and behavior than other periods, a certain aspect of the psychological process develops most rapidly, this period is called the "sensitive period". The sensitive period theory was put forward by the Italian educator Montaigne. The sensitive period is not only a critical period for children's learning, but also affects the development of their soul and personality. For example, the 31 sensitive periods experienced by children aged 0-9 include muscle sensitivity period: 1-3 years old; sensitive period interested in subtle things: 1.5-4 years old; language sensitivity period: 1.5-2.5 years old; society Standard sensitive period: 2 and a half to 4 years old; Space sensitive period: 3-4 years old; Color sensitive period: 3-4 years old; Mathematical concept sensitive period: 4.5 years old to 7 years old; Recognition sensitive period: 5 years old to 7 years old Years old; animals and plants, scientific experiments, collection sensitive period: 6-7 years old; cultural sensitive period: 6-9 years old, etc. Asking questions according to the developmental stage of children can more effectively promote the growth of children. Therefore, the question template type can be set for the question template, and the matching table between the question template type and the child’s age (also understood as the child’s development stage or the child’s age group) is stored in the database. When the child is at the corresponding age (development stage or Age group), increase the probability of the corresponding question type being selected.
例如,表8示出了儿童年龄(发展阶段或者年龄段)与问题模板类型的对应关系示意:For example, Table 8 shows the corresponding relationship between children's age (developmental stage or age group) and question template types:
表8Table 8
年龄(发展阶段或年龄段)Age (developmental stage or age group) 问题模板类型Question template type
11 空间、细节Space, details
22 空间、细节、社会Space, detail, society
33 空间、细节、社会、色彩Space, detail, society, color
44 空间、细节、社会、色彩、数字Space, detail, society, color, number
55 数字、文字Numbers, text
66 数字、文字、自然、文化Numbers, words, nature, culture
77 数字、文字、自然、文化Numbers, words, nature, culture
88 文化culture
99 文化culture
例如,表9示出了问题模板类型、问题模板的示例与问题的示例的对应关系:For example, Table 9 shows the type of question template, the corresponding relationship between examples of question templates and examples of questions:
表9Table 9
问题模板类型Question template type 问题模板的示例Example of question template 问题的示例Examples of problems
空间space (Entity)[在][Where](Entity)[在][Where] 母鸡在哪里?Where is the hen?
细节detail (Entity)(position)有[What](Entity)(position) has [What] 母鸡后面有什么?What's behind the hen?
社会society (Entity)[和][Entity][是][What](Relation)(Entity)[and][Entity][是][What](Relation) 佩奇和乔治是什么关系?What is the relationship between Page and George?
色彩color (Entity)[是][What](Color)(Entity)[是][What](Color) 狐狸是什么颜色?What color is a fox?
数字digital 有[数量词](Entity)Have [quantifier] (Entity) 有几只小猪?How many little pigs are there?
文字Text [这是][What][This is][What] 这是什么字?What is this word?
自然natural [这是][What][Entity][This is][What][Entity] 这是什么动物?What kind of animal is this?
文化culture [你知道](Entity)[的历史吗][Do you know the history of](Entity)[] 你知道长城的历史吗?Do you know the history of the Great Wall?
可选的,可以通过所述电子设备上的设置软件(如在手机上控制机器人的App)设置儿童的年龄(或年龄段),从而确定相应的问题模板类型。也可以提供问题模板类型的设置人机接口,使父母可以直接在软件上设置问题模板类型。Optionally, the age (or age group) of the child can be set through the setting software on the electronic device (for example, an App that controls the robot on a mobile phone) to determine the corresponding question template type. A man-machine interface for setting the problem template type can also be provided, so that parents can directly set the problem template type on the software.
可选的,也可以通过人机对话历史,对一段时间内儿童向电子设备提出的问题打标签,确定儿童当前的年龄(发展阶段或年龄段),不断进行统计儿童对每一类问题的提问比例,从而确定儿童当前适合的问题模板类型。Optionally, you can also use the history of human-machine conversations to tag the questions that children posed to electronic devices over a period of time, determine the child’s current age (developmental stage or age group), and continuously count the children’s questions on each type of question Ratio to determine the type of question template that the child currently fits.
另外,除上述设置问题模板类型之外,一些儿童的敏感期并不对应特定的问题模板类型,而可以对应电子设备提问的频率,如1.5岁-2.5岁的语言敏感期,可以提高每一页或每一本绘本提问的频率。具体的,根据频率确定问题模板的方法与根据问题模板类型确定问题模板的方法类似,此处不再详细描述。In addition, in addition to the above-mentioned setting question template types, some children’s sensitive periods do not correspond to specific question template types, but can correspond to the frequency of questions asked by electronic devices, such as the language sensitive period of 1.5-2.5 years old, which can improve every page Or the frequency of questions in each picture book. Specifically, the method of determining the question template based on the frequency is similar to the method of determining the question template based on the type of the question template, and will not be described in detail here.
通过上述方法,根据儿童的年龄(发展阶段或年龄段)选择合适的问题模板,可以使提问更具针对性,可以使儿童的阅读更加有效。Through the above methods, selecting an appropriate question template according to the child's age (developmental stage or age group) can make the questioning more targeted and make the child's reading more effective.
步骤503:所述电子设备根据所述待提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取待提问调用函数。Step 503: The electronic device obtains the calling function to be asked from the calling function library according to the matching degree between the slot of the question template to be asked and the parameter of the calling function in the calling function library.
其中,所述待提问调用函数的参数的数量和类型与所述待提问问题模板的槽位的数量和类型的匹配程度最高。Wherein, the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked.
在一种可选的实施方式中,当所述调用函数库中包含一个所述待提问问题模板对应的调用函数时,所述电子设备直接将这一个调用函数作为所述待提问调用函数。这里应理解这一个调用函数的参数的数量和类型与所述待提问问题模板的槽位的数量和类型匹配程度最高。In an optional implementation manner, when the calling function library contains a calling function corresponding to the question template to be asked, the electronic device directly uses this calling function as the calling function to be asked. It should be understood here that the number and types of parameters of this calling function match the number and types of slots of the question template to be asked to the highest degree.
在另一种可选的实施方式中,当所述调用函数库中包含多个所述待提问问题模板对应的调用函数时,所述电子设备根据所述待提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取待提问调用函数,具体方法可以为:所述电子设备从所述调用函数库中获取参数的数量和类型与所述待提问问题模板中的槽位的数量和类型匹配程度最高的调用函数,则确定了所述待提问问题模板对应的所述待提问调用函数。In another optional implementation manner, when the calling function library contains multiple calling functions corresponding to the question template to be asked, the electronic device compares the slots of the question template with the The matching degree of the parameters of the calling function in the calling function library is obtained, and the calling function to be questioned is obtained from the calling function library. The specific method may be: the electronic device obtains the number and type of parameters from the calling function library and the The calling function with the highest matching degree between the number of slots and the type in the question template to be asked is determined, the calling function to be asked corresponding to the question template to be asked is determined.
其中,一个调用函数的参数的数量和类型与所述待提问问题模板中的参数的数量和类型匹配程度最高的具体实现方法,与上述步骤407中一个调用函数的参数的数量和类型与被提问问题模板中的参数的数量和类型匹配程度最高的具体实现方法类似,可以相互参见,此处不再详细描述。Among them, the specific implementation method with the highest degree of matching between the number and type of parameters of a calling function and the number and types of parameters in the question template to be asked is the same as the number and types of parameters of a calling function in step 407 above. The number and type of the parameters in the question template have the highest degree of matching. The specific implementation methods are similar, and can be referred to each other, and will not be described in detail here.
步骤504:所述电子设备根据所述待提问调用函数从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性。Step 504: The electronic device obtains the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked.
其中,所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性可以理解为问题关键词。Wherein, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked can be understood as question keywords.
具体的,所述电子设备根据所述待提问调用函数从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性时,需要结合所述待提问调用函数表示的函数含义,从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性。Specifically, when the electronic device obtains the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked, it needs to Combining the meaning of the function represented by the calling function to be asked, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked are obtained from the entity attribute library.
例如,当所述待提问问题模板为(Entity)[在][Where]时,需要获取所述待提问问题模板所对应的实体名称;当所述待提问问题模板为(Entity)[是][What](Color)时,需要获取所述待提问问题模板所对应的实体名称及所述待提问问题模板所对应的实体属性;当所述待提问问题模板为(Color)[有][What]时,需要获取所述待提问问题模板所对应的实体属性。For example, when the question template to be asked is (Entity)[在][Where], it is necessary to obtain the entity name corresponding to the question template to be asked; when the question template to be asked is (Entity)[是][ What] (Color), it is necessary to obtain the entity name corresponding to the question template to be asked and the entity attribute corresponding to the question template to be asked; when the question template to be asked is (Color)[有][What] At this time, the entity attribute corresponding to the question template to be asked needs to be obtained.
步骤505:基于所述待提问问题模板,所述电子设备将所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性生成待提问问题。Step 505: Based on the question template to be asked, the electronic device generates the question to be asked by the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked.
也即所述电子设备基于所述待提问问题模板将所述问题关键词生成所述待提问问题。That is, the electronic device generates the question to be asked based on the question key word template based on the question to be asked template.
例如,所述电子设备基于所述待提问问题模板将所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性(也即所述问题关键词)生成的所述待提问问题可以如表10中的问题所示:For example, the electronic device generates, based on the question template to be asked, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked (that is, the question keywords) The questions to be asked can be as shown in the questions in Table 10:
表10Table 10
(母鸡)[在][哪里](Hen) [at] [where] 只有实体名称Entity name only
(小鸟)[在][哪里](Little bird) [At] [Where] 只有实体名称Entity name only
(老虎)[在][哪里](Tiger) [at] [where] 只有实体名称Entity name only
(母鸡)[是][什么](颜色)(Hen) (is) (what) (color) 有实体名称和实体属性Has entity name and entity attributes
(小鸟)[是][什么](颜色)(Little bird) [Yes] [What] (Color) 有实体名称和实体属性Has entity name and entity attributes
(老虎)[是][什么](颜色)(Tiger) (yes) (what) (color) 有实体名称和实体属性Has entity name and entity attributes
(眉毛)[是][什么样子](Eyebrows) [Yes] [What is it like] 只有实体名称Entity name only
(玩具)[被抢走了](Toy) [stolen] 只有实体名称Entity name only
(辫子)[有][什么变化](Braid) [Yes] [What changes] 只有实体名称Entity name only
(红色的)[有][什么](Red) [Yes] [What] 只有实体属性Only entity attributes
(喷出来的)[是][什么](Squirting out) [is] [what] 只有实体属性Only entity attributes
[什么](颜色)[最多][What] (Color) [Max] 只有实体属性Only entity attributes
[这个](屋子)(温暖)[么][This] (house) (warm) [what] 有实体名称和实体属性Has entity name and entity attributes
(菲菲)[的](心情)[怎么样](Feifei) [of] (mood) [how] 有实体名称和实体属性Has entity name and entity attributes
(菲菲)[的](咆哮)[威力大么](Fei Fei) [的] (Roaring) [Is it powerful?] 有实体名称和实体属性Has entity name and entity attributes
(熊猫)[叫][什么](Panda) [Call] [What] 只有实体名称Entity name only
[这是][什么](树)[This is] [What] (Tree) 只有实体名称Entity name only
(果实)[是][什么](Fruit) [is] [what] 只有实体名称Entity name only
(狐狸)[怎么][不穿](衣服)(Fox) (How) (Don't wear) (Clothes) 有实体名称和实体属性Has entity name and entity attributes
(猴子)[是][什么](表情)(Monkey) (yes) (what) (emoji) 有实体名称和实体属性Has entity name and entity attributes
步骤506:所述电子设备向所述儿童输出所述待提问问题,即所述电子设备向儿童提问。Step 506: The electronic device outputs the question to be asked to the child, that is, the electronic device asks the child a question.
在一种可选的实施方式中,所述电子设备先将所述待提问问题合成为语音,通过语音播放所述待提问问题。In an optional implementation manner, the electronic device first synthesizes the question to be asked into a voice, and plays the question to be asked through the voice.
具体的,所述电子设备通过扬声器播放所述待提问问题对应的语音。Specifically, the electronic device plays the voice corresponding to the question to be asked through a speaker.
步骤507:所述电子设备从所述待提问问题中提取所述待提问问题所对应的实体名称和/或所述待提问问题所对应的实体属性。Step 507: The electronic device extracts the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the question to be asked from the question to be asked.
例如,所述电子设备可以根据上述表10中的待提问问题提取所述待提问问题所对应的实体名称和/或所述待提问问题所对应的实体属性。例如,待提问问题为“(母鸡)[在][哪里]”时,可以提取待提问问题所对应的实体名称“母鸡”。又例如,待提问问题为“(红色的)[有][什么]”时,可以提取到待提问问题所对应的实体属性“红色的”。又例如,待提问问题为“(母鸡)[是][什么](颜色)”时,可以提取待提问问题所对应的实体名称“母鸡”。又例如,待提问问题为“(狐狸)[怎么][不穿](衣服)”时,可以提取待提问问题所对应的实体名称“狐狸”和待提问问题所对应的实体属性“衣服”。For example, the electronic device may extract the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the question to be asked according to the question to be asked in the above table 10. For example, when the question to be asked is "(hen)[at][where]", the entity name "hen" corresponding to the question to be asked can be extracted. For another example, when the question to be asked is "(red)[Yes][what]", the entity attribute "red" corresponding to the question to be asked can be extracted. For another example, when the question to be asked is "(hen) [Yes] [what] (color)", the entity name "hen" corresponding to the question to be asked can be extracted. For another example, when the question to be asked is "(fox)[how][do not wear] (clothes)", the entity name "fox" corresponding to the question to be asked and the entity attribute "clothes" corresponding to the question to be asked can be extracted.
步骤508:所述电子设备根据所述待提问调用函数和所述待提问问题所对应的实体名称,从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性,或者,所述电子设备根据所述待提问调用函数和所述待提问问题所对应的实体属性,从所述实体属性库中获取所述待提问问题所对应的实体属性对应的实体名称。Step 508: The electronic device obtains the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library according to the calling function to be asked and the entity name corresponding to the question to be asked, or The electronic device obtains the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library according to the calling function to be asked and the entity attribute corresponding to the question to be asked.
例如,当待提问问题为“(母鸡)[是][什么](颜色)”,提取待提问问题所对应的实体名称“母鸡”时,所述电子设备可以从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性“红色”。又例如,待提问问题为“(红色的)[有][什么]”,提取到待提问问题所对应的实体属性“红色的”时,所述电子设备可以从所述实体属性库中获取所述待提问问题所对应的实体属性对应的实体名称“母鸡”。又例如,待提问问题为“(狐狸)[怎么][不穿](衣服)”,提取待提问问题所对应的实体名称“狐狸”和待提问问题所对应的实体属性“衣服”时,所述电子设备可以从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性“全身毛绒绒的”。For example, when the question to be asked is "(hen) [yes] [what] (color)", the entity name "hen" corresponding to the question to be asked is extracted, the electronic device may retrieve from the entity attribute database Obtain the entity attribute "red" corresponding to the entity name corresponding to the question to be asked. For another example, when the question to be asked is "(red) [Yes] [what]", when the entity attribute "red" corresponding to the question to be asked is extracted, the electronic device can obtain all the attributes from the entity attribute database. State the entity name "hen" corresponding to the entity attribute corresponding to the question to be asked. For another example, when the question to be asked is "(fox)[how][do not wear](clothes)", the entity name "fox" corresponding to the question to be asked and the entity attribute "clothes" corresponding to the question to be asked are extracted. The electronic device may obtain the entity attribute "full body plush" corresponding to the entity name corresponding to the question to be asked from the entity attribute database.
步骤509:所述电子设备根据所述待提问调用函数从答案模板库中获取待确定答案模 板,所述待确定答案模板为所述答案模板库中与所述待提问调用函数对应的答案模板。Step 509: The electronic device obtains an answer template to be determined from an answer template library according to the calling function to be asked, where the answer template to be determined is an answer template corresponding to the calling function to be asked in the answer template library.
其中,所述数据库还包括答案模板库,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应。Wherein, the database further includes an answer template library, the answer template library includes at least one answer template, and the answer templates in the answer template library correspond to the calling functions in the calling function library in a one-to-one correspondence.
步骤510:基于所述待确定答案模板,所述电子设备将待确定答案关键词生成待确定答案。Step 510: Based on the to-be-determined answer template, the electronic device generates the to-be-determined answer key word.
其中,所述待确定答案关键词为以下任一项:所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体名称和所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体属性、所述待提问问题所对应的实体属性和所述待提问问题所对应的实体属性对应的实体名称。Wherein, the key of the answer to be determined is any one of the following: the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity name corresponding to the question to be asked, and the entity corresponding to the question to be asked The entity attribute corresponding to the name, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the entity name corresponding to the entity attribute corresponding to the question to be asked.
例如,当所述待提问问题是“(母鸡)[是][什么](颜色)”时,所述电子设备将所述待提问问题所对应的实体名称“母鸡”和所述待提问问题所对应的实体名称对应的实体属性“红色”生成待确定答案“母鸡是红色的”。又例如,当所述待提问问题为“(红色的)[有][什么]”时,所述电子设备将所述待提问问题所对应的实体属性对应的实体名称“母鸡”生成待确定答案“母鸡”,或者所述电子设备将所述待提问问题所对应的实体属性对应的实体名称“母鸡”和所述待提问问题所对应的实体属性“红色的”生成待确定答案“红色的有母鸡”。For example, when the question to be asked is "(hen) [yes] [what] (color)", the electronic device will send the entity name "hen" corresponding to the question to be asked and the name of the entity to be asked The entity attribute “red” corresponding to the entity name corresponding to the question generates the answer to be determined “the hen is red”. For another example, when the question to be asked is "(red) [Yes] [what]", the electronic device generates the entity name "hen" corresponding to the entity attribute corresponding to the question to be asked to be determined The answer is "hen", or the electronic device generates the entity name "hen" corresponding to the entity attribute corresponding to the question to be asked and the entity attribute "red" corresponding to the question to be asked to generate the answer to be determined" The red ones have hens".
步骤511:所述电子设备接收所述儿童针对所述待提问问题的回答。Step 511: The electronic device receives the child's answer to the question to be asked.
步骤512:所述电子设备将所述儿童针对所述待提问问题的回答与所述待确定答案进行对比分析以得到所述儿童的回答是否正确的判断结果。Step 512: The electronic device compares and analyzes the child's answer to the question to be asked and the answer to be determined to obtain a judgment result of whether the child's answer is correct.
具体的,所述电子设备将所述儿童的回答中的关键词,与所述待确定答案中的关键词进行对比,就对比结果判断所述儿童的回答是否正确,得到判断结果正确或者错误。Specifically, the electronic device compares the keywords in the child's answer with the keywords in the answer to be determined, and judges whether the child's answer is correct based on the comparison result, and obtains whether the judgment result is correct or incorrect.
步骤513:所述电子设备根据所述判断结果向所述儿童做出相应的操作。Step 513: The electronic device performs a corresponding operation on the child according to the judgment result.
具体的,所述电子设备可以通过扬声器播放所述判断结果,例如当所述判断结果为正确时,所述电子设备可以播放“回答正确”,或者还可播放相同表达含义的语音,如“太好了,你答对了”等等。Specifically, the electronic device may play the judgment result through a loudspeaker. For example, when the judgment result is correct, the electronic device may play "correct answer", or it may also play a voice with the same meaning, such as "Too Okay, you got it right" Wait.
同样的,所述电子设备执行上述步骤502-步骤505、步骤507-步骤510和步骤512是建立在所述电子设备具备数据存储和数据处理能力的前提下,当所述电子设备不具备数据存储和数据处理能力时,所述电子设备在确定需要向儿童提问时,触发服务器执行步骤502-步骤505、步骤507-步骤510中的操作,所述服务器将确定的待提问问题传输给所述电子设备,然后所述电子设备向儿童提问,收到儿童的回答后,将所述儿童的回答传输给所述服务器,使所述服务器执行步骤512中的判断过程,然后所述服务器将所述判断结果传输给所述电子设备,所述电子设备继续执行步骤513。Similarly, the electronic device performing the above steps 502-505, 507-510, and 512 is based on the premise that the electronic device has data storage and data processing capabilities, when the electronic device does not have data storage And data processing capabilities, when the electronic device determines that it needs to ask a child a question, it triggers the server to perform the operations in step 502-step 505 and step 507-step 510, and the server transmits the determined question to be asked to the electronic device. Device, and then the electronic device asks the child a question. After receiving the child’s answer, it transmits the child’s answer to the server so that the server executes the judgment process in step 512, and then the server sends the judgment The result is transmitted to the electronic device, and the electronic device continues to perform step 513.
采用本申请实施例提供的基于绘本的问答交互方法,电子设备或者服务器可以根据与目标绘本相关的数据库自行生成需要提问的问题和答案,并不需要机械地预设好问题答案对,电子设备不用机械地按照预设好的问题向用户提问,可以使在绘本阅读过程中电子设备提问及用户回答更加灵活,从而可以使在绘本阅读过程中电子设备和儿童的交互更加智能,可以提高阅读有效性,提升儿童体验。Using the picture book-based question and answer interaction method provided by the embodiment of this application, the electronic device or server can generate the questions and answers to be asked according to the database related to the target picture book, and there is no need to preset the question and answer pairs mechanically, and the electronic device does not Ask the user mechanically according to the preset questions, which can make the electronic device ask questions and the user's answer more flexibly during the picture book reading process, thereby making the interaction between the electronic device and the child smarter during the picture book reading process, and can improve the effectiveness of reading , To enhance children's experience.
基于上述实施例,上述实施例中描述的问答交互过程,可以适用于一个电子设备和一个儿童之间的问答交互。但是在实际应用中,在阅读绘本场景中,可能会存在父母或老师、儿童、电子设备三者。在一种可选的实施方式中,在存在三者的绘本阅读场景中,所述电 子设备可以具有声纹识别模块,可以在电子设备的设置软件中,提供用户声纹识别的人机接口,通过不同的用户输入语音,用户通过人机接口指定不同的语音对应什么角色的用户,确定声纹与角色的对应关系,如家长、老师、儿童等角色。Based on the above embodiment, the question and answer interaction process described in the above embodiment can be applied to the question and answer interaction between an electronic device and a child. However, in practical applications, there may be parents or teachers, children, and electronic devices in the scene of reading picture books. In an optional implementation, in a picture book reading scene where there are three of them, the electronic device may have a voiceprint recognition module, and a human-machine interface for user voiceprint recognition may be provided in the setting software of the electronic device. Through the input of voices by different users, the user specifies the user in which role the different voice corresponds to through the man-machine interface, and determines the corresponding relationship between the voiceprint and the role, such as the roles of parents, teachers, and children.
对于图5所示的实施例电子设备提问的场景,可以待家长或老师角色发出指令(例如,电子设备(也可以是其他代名词),你问个问题吧!)后,再开始电子设备向儿童提问的流程。For the scenario of the electronic device in the embodiment shown in FIG. 5, you can wait for the parent or teacher role to issue an instruction (for example, electronic device (it can also be other pronouns), you can ask a question!), then start the electronic device to the child The process of asking questions.
可以理解的是,在问题模板的使用过程中,电子设备可以记录一段预设时间内的对话历史,对于家长或老师已经问过的问题,就不再选择对应的问题模板。It is understandable that in the process of using the question template, the electronic device can record a conversation history within a preset period of time. For questions that the parent or teacher has already asked, the corresponding question template is no longer selected.
对于图4所示实施例中电子设备回答问题的场景,所述电子设备可以先持续检测用户的语音输入,通过声纹识别和语义分析,电子设备可以判断儿童的提问是否都得到了家长或老师的有效回答,如果儿童的提问在超过一定时间阈值后,还没有得到家长或老师的有效回答(答错了,或者没回答),则电子设备再执行回答用户问题的后续流程。For the scenario where the electronic device answers questions in the embodiment shown in FIG. 4, the electronic device can first continuously detect the user's voice input. Through voiceprint recognition and semantic analysis, the electronic device can determine whether the child’s questions have been answered by the parent or teacher. If the child’s question exceeds a certain time threshold and the parent or teacher has not received a valid answer (wrong answer or no answer), the electronic device will then execute the follow-up process of answering the user’s question.
需要说明的是,上述实施例中涉及的问答交互流程一般是建立在存储的绘本的实体属性库是固定的场景下。可选的,所述电子设备还可以根据在所述电子设备阅读目标绘本的过程中,所述电子设备和儿童的交互历史信息中包含的(至少一个)实体名称及(至少一个)实体属性更新所述实体属性库。例如,所述电子设备根据所述交互历史信息中包含的实体名称及实体属性更新所述实体属性库,可以分为以下两种情况:第一种情况,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述儿童输入的话语信息;第二种情况,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述儿童的动作信息。It should be noted that the question and answer interaction process involved in the foregoing embodiment is generally established in a scenario where the entity attribute library of the stored picture book is fixed. Optionally, the electronic device may also update the (at least one) entity name and (at least one) entity attribute contained in the interaction history information between the electronic device and the child during the process of reading the target picture book by the electronic device The entity attribute library. For example, the electronic device updates the entity attribute database according to the entity name and entity attribute contained in the interaction history information, which can be divided into the following two cases: In the first case, the interaction history information is in the electronic When the device reads the target picture book, the electronic device receives the speech information input by the child; in the second case, the interaction history information is that the electronic device reads the target picture book during the process of reading the target picture book. The electronic device receives the action information of the child.
具体的,在上述第一种情况中,参阅图7所示,更新实体属性库的具体方法流程可以包括如下步骤:Specifically, in the first case described above, referring to FIG. 7, the specific method flow for updating the entity attribute database may include the following steps:
步骤701:所述电子设备获取在所述电子设备阅读所述目标绘本的过程中,接收到的所述儿童的话语信息,并提取出所述话语信息中的实体名称(至少一个)及实体(至少一个)属性。Step 701: The electronic device obtains the child's speech information received during the process of reading the target picture book by the electronic device, and extracts the entity name (at least one) and the entity ( At least one) attribute.
例如,所述电子设备在与儿童问答交互过程中,识别到儿童说过一句话:“彤彤家的兔子叫小贝”。通过语义分析,所述电子设备可以判断到该句话中有一个实体名称是“兔子”,以及该实体名称的同义词“小贝”。For example, in the process of interacting with the child’s question and answer, the electronic device recognizes that the child has said a sentence: “The rabbit of Tongtong’s family is called Xiaobei”. Through semantic analysis, the electronic device can determine that an entity name in the sentence is "rabbit" and the synonym of the entity name is "小贝".
步骤702:所述电子设备判断已有的实体属性库中是否有相应实体名称,若有,则执行步骤703,否则执行步骤704。Step 702: The electronic device judges whether there is a corresponding entity name in the existing entity attribute library, if there is a corresponding entity name, step 703 is executed, otherwise, step 704 is executed.
例如,所述电子设备判断已有的实体属性库中,存在实体名称“兔子”,且其具有一个Food属性为“青菜”,例如,表11所示,此时可以判断所述已有的实体属性库中存在确定的实体名称。For example, the electronic device judges that there is an entity name "rabbit" in the existing entity attribute database, and it has a Food attribute of "green vegetables", for example, as shown in Table 11, the existing entity can be judged at this time A certain entity name exists in the property library.
表11Table 11
实体(Entity)Entity 实体属性:FoodEntity attribute: Food
兔子rabbit 青菜vegetables
步骤703:所述电子设备判断所述已有的实体属性库中是否有该实体名称对应的实体属性,若有则结束,否则执行步骤705。Step 703: The electronic device judges whether there is an entity attribute corresponding to the entity name in the existing entity attribute database, if there is an entity attribute corresponding to the entity name, it ends, otherwise, step 705 is executed.
步骤704:所述电子设备将所述实体名称及实体属性更新到已有的实体属性库中,得到更新的实体属性库。Step 704: The electronic device updates the entity name and entity attributes to the existing entity attribute database to obtain the updated entity attribute database.
例如,所述电子设备将实体名称“兔子”和实体属性(别名alias)“小贝”更新到已有的实体属性库中,更新后的实体属性库可以如表12所示:For example, the electronic device updates the entity name "rabbit" and entity attribute (alias alias) "Xiaobei" into the existing entity attribute database. The updated entity attribute database may be as shown in Table 12:
表12Table 12
实体(Entity)Entity 实体属性:aliasEntity attributes: alias
兔子rabbit 小贝Beckham
步骤705:所述电子设备将所述实体属性更新到已有的实体属性库中,得到更新的实体属性库。Step 705: The electronic device updates the entity attribute to the existing entity attribute database to obtain the updated entity attribute database.
例如,所述电子设备从表11中可以得出所述已有的实体属性库中并没有该实体属性(别名alias)“小贝”,则将所述实体属性更新到已有的实体属性库中,更新后的实体属性库如表13所示:For example, the electronic device can obtain from Table 11 that the entity attribute (alias) "Xiaobei" does not exist in the existing entity attribute database, and the entity attribute is updated to the existing entity attribute database. In, the updated entity attribute library is shown in Table 13:
表13Table 13
实体(Entity)Entity 实体属性:FoodEntity attribute: Food 实体属性:aliasEntity attributes: alias
兔子rabbit 青菜vegetables 小贝Beckham
基于上述方法更新后的实体属性库,所述电子设备再向儿童提问时,可以生成个性化的问题。例如,问题模板(Entity)[吃][What](Food),如果使用已有实体属性库,生成的问题应为“兔子吃什么”,而采用更新后的实体属性库,生成的问题就可以是“小贝吃什么”。应用上述方法生成的问题,与儿童的问答互动过程相结合,可以有效加强儿童对问题的接受度。Based on the entity attribute database updated by the above method, when the electronic device asks the child again, it can generate a personalized question. For example, the question template (Entity)[吃][What](Food), if the existing entity attribute library is used, the generated question should be "What does the rabbit eat", and the updated entity attribute library is used to generate the question. It is "what does Beckham eat". The questions generated by the above methods, combined with the children’s question and answer interaction process, can effectively strengthen the children’s acceptance of the questions.
具体的,在上述第二种情况中,所述电子设备可以是具有摄像头和显示屏的电子设备。因为有一些儿童在听绘本阅读的过程中,伴随着形体动作(比如,手指着绘本内容)。所述电子设备可以获取儿童用手指在绘本上的指示位置,从而获取实体在绘本上的位置属性。通过这个过程,所述电子设备可以建立实体与其在绘本中位置的对应关系,从而更新实体属性库。参阅图8所示,更新实体属性库的具体方法流程可以包括如下步骤:Specifically, in the second case described above, the electronic device may be an electronic device having a camera and a display screen. Because some children are accompanied by physical movements (for example, pointing their fingers at the content of the picture book) when they listen to the picture book and read. The electronic device can obtain the indicated position of the child's finger on the picture book, thereby obtaining the position attribute of the entity on the picture book. Through this process, the electronic device can establish the corresponding relationship between the entity and its position in the picture book, thereby updating the entity attribute database. Referring to Figure 8, the specific method flow for updating the entity attribute database may include the following steps:
步骤801:所述电子设备在阅读所述目标绘本过程中,接收儿童的语音输入,并将语音转化成文本。Step 801: In the process of reading the target picture book, the electronic device receives the child's voice input and converts the voice into text.
例如,儿童在听所述目标绘本的过程中,看到电子设备的显示屏中显示的所述目标绘本内容中有一只蜻蜓,则所述儿童会向电子设备输入语音“这儿有只蜻蜓”。For example, when a child is listening to the target picture book and sees a dragonfly in the target picture book displayed on the display screen of the electronic device, the child will input the voice "here is a dragonfly" into the electronic device.
步骤802:所述电子设备从文本中提取实体名称及实体属性。Step 802: The electronic device extracts the entity name and entity attributes from the text.
例如,所述电子设备从“这儿有只蜻蜓”中提取一个实体名称“蜻蜓”和实体属性“这儿”。For example, the electronic device extracts an entity name "Dragonfly" and an entity attribute "here" from "Here is a dragonfly".
步骤803:所述电子设备判断所述实体属性是否为方位代词,若是则执行步骤804,否则结束。Step 803: The electronic device judges whether the entity attribute is a location pronoun, if it is, execute step 804, otherwise it ends.
步骤804:所述电子设备识别儿童手指指向绘本中的位置,也即所述电子设备接收到所述儿童的动作信息。Step 804: The electronic device recognizes the position where the child's finger points in the picture book, that is, the electronic device receives the child's action information.
例如,所述电子设备可以通过摄像头获取的图像,采用边缘检测和封闭图形检测的方法,确定绘本书页的范围(例如图9中的左图),将书页建立象限,可以得到书页的上边、下边、左边、右边、左上、右上、左下、右下等方位(例如图9中的中图)。通过图像识别,还可以确定儿童的手指和书页上对应的物体(如图9中的右图所示的是一只蜻蜓)。For example, the electronic device can use the method of edge detection and closed figure detection to determine the range of drawing the pages of the book (for example, the left picture in Fig. 9), and establish the quadrants of the book pages to obtain the upper and lower edges of the book pages. , Left, right, top left, top right, bottom left, bottom right, etc. (for example, the middle image in Figure 9). Through image recognition, you can also determine the child's finger and the corresponding object on the book page (the right image in Figure 9 shows a dragonfly).
通过上述方法,所述电子设备可以确定儿童指向绘本中的绘本下方,也即绘本下方有一只蜻蜓。Through the above method, the electronic device can determine that the child is pointing below the picture book in the picture book, that is, there is a dragonfly under the picture book.
步骤805:所述电子设备将确定的绘本中的位置,作为实体的方位属性,更新到已有的实体属性库中,得到更新后的实体属性库。Step 805: The electronic device updates the determined position in the picture book as the orientation attribute of the entity to the existing entity attribute database to obtain the updated entity attribute database.
例如,所述电子设备得到实体名称“蜻蜓”与“绘本下方”的对应关系,则将“绘本下方”作为方位属性更新到已有的实体属性库中,例如,更新后的实体属性库可以如表14所示:For example, the electronic device obtains the corresponding relationship between the entity name "Dragonfly" and "under the picture book", and then updates "under the picture book" as the orientation attribute to the existing entity attribute database. For example, the updated entity attribute database can be as Table 14 shows:
表14Table 14
实体“Entity”Entity "Entity" 实体属性:positionEntity attribute: position
蜻蜓dragonfly 绘本下方Below the picture book
基于上述方法得到更新后的实体属性库中后,在后续电子设备向儿童提问时,可以灵活提问,例如,当所述电子设备识别带有方位属性的实体后,可以根据问题模板[让我们看看](where)[有](what)生成问题“让我们看看下边有什么?”。这样,可以更多地利用绘本中的信息,使阅读更加深入。After obtaining the updated entity attribute database based on the above method, the subsequent electronic device can ask children questions flexibly. For example, after the electronic device recognizes the entity with the orientation attribute, it can be based on the question template [Let’s see See](where)[有](what) generates the question "Let's see what's below?". In this way, you can make more use of the information in the picture book and make reading more in-depth.
需要说明的是,上述步骤701-步骤705均可以由与所述电子设备连接的服务器实现;以及图8所示的实施例中电子设备接收到用户的语音后,可以将语音传输给服务器,以及将获取的儿童指向绘本的图像传输给服务器,由服务器完成数据处理过程实现实体属性库的更新。It should be noted that all of the above steps 701 to 705 can be implemented by a server connected to the electronic device; and the electronic device in the embodiment shown in FIG. 8 can transmit the voice to the server after receiving the user's voice, and The acquired images of children pointing to the picture book are transmitted to the server, and the server completes the data processing process to update the entity attribute database.
基于上述实施例中更新的实体属性库,所述电子设备还可以更具儿童的生活经历进一步更新实体属性库。例如,在所述电子设备具有摄像头时,可以通过权限设置,使所述电子设备的设置软件可以获取其所安装的电子设备图库中的图像/视频,通过图像分析、图像携带的地理位置等信息,或者获取电子设备笔记类软件(如印象笔记)中育儿笔记相关的笔记本(可以由用户设置)等等,分析儿童去过的地点、所见到的事物,并与问题模板进行对应。Based on the updated entity attribute database in the above embodiment, the electronic device can further update the entity attribute database according to the life experience of the child. For example, when the electronic device has a camera, permission settings can be used to enable the setting software of the electronic device to obtain images/videos in the installed electronic device gallery, through image analysis, geographic location information carried by the image, etc. , Or get the notebooks related to parenting notes in electronic device note-taking software (such as Evernote) (which can be set by the user), etc., analyze the places that children have visited, what they have seen, and correspond to the question template.
例如,电子设备通过今日图库(当然也可以为其他名称,这里仅仅是示例)中的照片中携带的地理位置确定儿童去了xx科技馆,并进一步通过图像分析确定儿童与恐龙(模型)合影。从而可以更新实体属性库如表15所示:For example, the electronic device determines that the child has gone to the xx science and technology museum based on the geographic location carried in the photo in the today's gallery (of course it can be another name, here is just an example), and further determines that the child takes a photo with the dinosaur (model) through image analysis. This can update the entity attribute database as shown in Table 15:
表15Table 15
实体(Entity)Entity 实体属性:experience(Place)Entity attribute: experience(Place) 实体属性:experience(Entity)Entity attributes: experience(Entity)
恐龙dinosaur XX科技馆XX Science and Technology Museum 腕龙Brachiosaurus
进一步的,例如,在所述电子设备阅读绘本《恐龙大陆》时,所述电子设备(或者服务器)就可以根据更新后的实体属性库,在步骤503中,选择experience属性相关的问题模板,[宝宝去过](Entity.position),[也看到过](Entity),[是][What](Entity)?,进而向儿童提问“宝宝也去过xx科技馆,也看到过恐龙,是哪一种呢?”。当阅读绘本与儿童自身的生活经历相结合时,由于儿童有切身的体会,儿童的理解会更加有效。Further, for example, when the electronic device reads the picture book "Dinosaur Land", the electronic device (or server) can select the problem template related to the experience attribute in step 503 according to the updated entity attribute library, [ The baby has been to](Entity.position), [also seen](Entity), [is][What](Entity)? , And then asked the children, "The baby has also been to the xx science and technology museum and has seen dinosaurs. Which one is it?". When reading picture books are combined with children’s own life experiences, children’s understanding will be more effective because they have personal experience.
上述实施例中,仅简单的介绍了电子设备仅基于语音输出的示例。在实际应用中,电子设备有些具备显示功能,例如具有显示屏的电子设备(手机等),此时,在所述电子设备语音输出的同时可以通过显示屏一起输出语音对应的文本(也即所述电子设备通过显示屏显示所述待回答答案);还有些电子设备具有可活动部件,例如具有肢体的机器人,此时,所述电子设备语音输出的同时还可以加上可活动部件动作输出(也即所述电子设备控制可活动部件执行输出所述待回答答案的动作);还有些电子设备既具备显示功能又具备可活动部件,例如,具备显示屏的机器人,此时所述电子设备语音输出的同时还可结合显 示和可活动部件动作一起输出。In the foregoing embodiments, only an example in which the electronic device is only output based on voice is briefly introduced. In practical applications, some electronic devices have display functions, such as electronic devices with display screens (mobile phones, etc.). At this time, while the electronic device is outputting voice, the text corresponding to the voice (that is, all the The electronic device displays the answer to be answered through the display screen); some electronic devices have movable parts, such as robots with limbs. In this case, the electronic device’s voice output can also add the action output of the movable parts ( That is, the electronic device controls the movable part to perform the action of outputting the answer to be answered); there are also some electronic devices that have both a display function and a movable part, for example, a robot with a display screen. At this time, the electronic device voices The output can also be combined with the display and the actions of movable parts.
上述多种输出可以通过电子设备的处理器控制实现,还可以通过建立调用函数库中的调用函数的显示/动作控制指令函数实现。The above-mentioned various outputs can be realized by the processor control of the electronic device, and can also be realized by establishing the display/action control instruction function of the calling function in the calling function library.
例如,通过调用函数实现时,具体的问题模板和调用函数的对应关系可以如表16所示:For example, when implemented by calling a function, the corresponding relationship between the specific question template and the calling function can be as shown in Table 16:
表16Table 16
Figure PCTCN2020086872-appb-000003
Figure PCTCN2020086872-appb-000003
从表16中可以看出,调用函数中包含显示/动作控制指令。As can be seen from Table 16, the calling function contains display/action control instructions.
例如,上表16所示,在用于回答颜色的调用函数getColor(Entity,What,Color)中,进一步包括显示颜色的控制指令display(Entity,Color),数据库中可以进一步存储图像/视频,预先为这些图像/视频设置实体名称与实体属性标签,则电子设备可以在屏幕上显示该实体名称与该实体属性相关的图片。For example, as shown in Table 16, the call function getColor(Entity,What,Color) used to answer the color further includes the control command display(Entity,Color) to display the color. The database can further store images/videos. By setting the entity name and entity attribute tags for these images/videos, the electronic device can display pictures related to the entity name and the entity attribute on the screen.
例如,图10所示的问答交互过程示意图中,儿童提问问题“北极熊是什么颜色的?”,经过图4所示的实施例中描述的确定待回答答案的过程,电子设备得到待回答答案“北极熊是白色的”,同时根据确定对应的实体名称是“北极熊”,以及确定该实体属性是“白色”,在数据库存储的图像/视频中查询相应的实体名称和实体属性标签得到图10中所示的图片,显示在电子设备的显示屏上。For example, in the schematic diagram of the question and answer interaction process shown in FIG. 10, the child asks the question "What color is the polar bear?". After the process of determining the answer to be answered described in the embodiment shown in FIG. 4, the electronic device obtains the answer to be answered. The polar bear is white", and the corresponding entity name is determined to be "polar bear", and the entity attribute is determined to be "white", and the corresponding entity name and entity attribute label are searched in the image/video stored in the database to obtain the result shown in Figure 10. The picture shown is displayed on the display screen of the electronic device.
又例如,如上表16示出的,在用于回答位置的调用函数(Entity)[在][Where]中,进一步包括动作控制指令raise_hand()point_to(Entity.position),这些控制指令对应电子设备(例如机器人)的可活动部件动作(如肢体动作),如抬手,指向(某处)等。根据更新后的实体属性库中描述的带有方位属性的实体属性库,电子设备可以确定实体名称的位置,并用肢体指向该位置。For another example, as shown in Table 16 above, the call function (Entity)[在][Where] used to answer the position further includes the action control instruction raise_hand()point_to(Entity.position), which corresponds to the electronic device Movements of movable parts (such as robots) (such as body movements), such as raising hands, pointing (somewhere), etc. According to the entity attribute library with the orientation attribute described in the updated entity attribute library, the electronic device can determine the location of the entity name and point to the location with a limb.
例如,在图11所示的示例中,儿童提问问题“蜻蜓在哪呢?”,经过图4所示的实施例中描述的确定待回答答案的过程,以及根据确定对应的实体名称是“蜻蜓”,根据确定问题模板(Entity)[在][Where],以及根据更新的实体属性库中描述的带有方位属性的实体属性库,确定实体名称的位置是“下边”,再根据用于回答位置的调用函数(Entity)[在][Where]中包括的动作控制指令,电子设备(机器人)执行“抬手”“指向(绘本下方)”的控制指令,将可活动部件(可活动的肢体上的手/手指)指向绘本上的蜻蜓所在的位置。For example, in the example shown in Figure 11, the child asks the question "Where is the dragonfly?", after the process of determining the answer to be answered described in the embodiment shown in Figure 4, and according to the determination that the corresponding entity name is "Dragonfly ", according to the confirmation question template (Entity) [in][Where], and according to the entity attribute library with orientation attribute described in the updated entity attribute library, the position of the entity name is determined to be "below", and then according to the answer The position call function (Entity)[in][Where] includes the action control instructions, the electronic device (robot) executes the control instructions of "raise hand" and "point to (below the picture book)" to move the movable parts (movable limbs) Point to the position of the dragonfly on the picture book.
通过上述方法,通过显示、动作类的回答方式,可以更充分地利用电子设备可以提供的功能,使回答更加多样化,增强产品的吸引力。Through the above methods, through display and action response methods, the functions that electronic devices can provide can be fully utilized, the responses are more diversified, and the attractiveness of the product is enhanced.
基于以上实施例,机器人还可以与其他App联动,如,在电子设备的设置软件中提供与电商App的接口,可以调用商品搜索和购买功能。对于具备摄像头和图像分析能力的电 子设备,可以通过图像识别匹配商品。例如,很多绘本的封底都会有同系列其他书籍、同作者作品、同一出版社书籍等推荐,儿童在听电子设备阅读绘本过程中,如果用手指向其中一本书籍,或者用语音表达“我想要这一本《我可以自己睡觉》”,则认为儿童产生了购买意图,例如,图12所示儿童的意图示意图,通过商品匹配确定书籍的名称,通过电商App提供的商品搜索接口搜索该商品,从而询问用户是否要购买。又例如,如图13所示的绘本,封面上是一个特定的动画形象,通过图像识别可以确定该形象是“超级飞侠”,识别儿童的语音输入“我想要一个超级飞侠玩具”,则认为儿童产生了购买意图,通过商品匹配确定商品的名称,通过电商App提供的商品搜索接口搜索该商品,从而询问用户是否要购买。Based on the above embodiments, the robot can also be linked with other apps. For example, an interface with an e-commerce app can be provided in the setting software of an electronic device to call product search and purchase functions. For electronic devices with cameras and image analysis capabilities, products can be matched through image recognition. For example, the back cover of many picture books will have recommendations of other books in the same series, works by the same author, books from the same publisher, etc. When children are listening to electronic devices to read picture books, if they point their fingers to one of the books, or express "I want to For this "I can sleep by myself"", it is considered that the child has a purchase intention. For example, as shown in Figure 12, the child’s intention diagram is to determine the name of the book through product matching, and search for it through the product search interface provided by the e-commerce App Commodities, thus asking the user if they want to buy. For another example, in the picture book shown in Figure 13, there is a specific animated image on the cover. Through image recognition, it can be determined that the image is "Super Pan", and children’s voice input "I want a Super Pan toy" can be recognized. It is considered that the child has a purchase intention, the name of the product is determined through product matching, and the product is searched through the product search interface provided by the e-commerce App, thereby asking the user whether to buy.
具体的,参阅图14所示上述过程实现的方法具体可以包括以下步骤:Specifically, referring to the method implemented in the foregoing process shown in FIG. 14, the method may specifically include the following steps:
步骤1401:确定购买意图。Step 1401: Determine the purchase intention.
具体的,获取儿童的输入,分析常用购买指令中出现的关键词和以及词的组合,构建并在数据库中存储购买相关的语法模板,如用户输入里出现“我要买[Entity]”、“我想买[Entity]”、“我想要一个[Entity]”、“可以给我买一个[Entity]吗”这样的句式,则确定儿童有购买意图。Specifically, get children’s input, analyze the keywords and word combinations that appear in common purchase instructions, construct and store purchase-related grammar templates in the database, such as "I want to buy [Entity]" and "I want to buy [Entity]" and "I want to buy [Entity]" appear in the user input. Sentences such as "Want to buy [Entity]", "I want an [Entity]", and "Can you buy me an [Entity]" confirm that the child has a purchase intention.
步骤1402:确定商品搜索关键字。Step 1402: Determine the product search keywords.
具体的,儿童输入中的[Entity]可以直接做为搜索关键字,如上例中的“我想要一个超级飞侠玩具”,则确定“超级飞侠玩具”为商品搜索关键字。Specifically, [Entity] in children's input can be directly used as a search keyword. For example, in the above example, "I want a Super Flying Man toy", then "Super Flying Man toy" is determined as the product search key.
例如,对于具有摄像头的电子设备,还可以摄像头获取图像,进行图像分析,确定图像中出现的对象,如图12和图13所示的两张图中虚线框所示的书籍、人物、动画形象,也可以是动物、植物、物品等。并通过图像识别确定儿童手指的位置,是否指向上述对象。通过此步骤可以进一步增强商品关键字的准确性。For example, for an electronic device with a camera, the camera can also obtain images, perform image analysis, and determine the objects that appear in the image. Books, characters, and animated images shown in dashed boxes in the two figures shown in Figure 12 and Figure 13 can also be It can be animals, plants, objects, etc. And through image recognition to determine the location of the child's finger, whether it points to the above object. This step can further enhance the accuracy of product keywords.
步骤1403:搜索商品,向儿童返回搜索结果,并询问儿童是否要购买。Step 1403: Search for the product, return the search result to the child, and ask the child if he wants to buy it.
在此步骤中,可以是电子设备同时提供商品购买功能,直接搜索商品,或者电子设备调用电商App的商品搜索接口来搜索。In this step, it may be that the electronic device also provides a product purchase function to directly search for the product, or the electronic device calls the product search interface of the e-commerce App to search.
需要说明的是,本申请实施例中均以儿童为进行说明,可以理解的是,儿童仅作为一个用户,并不限于是儿童。It should be noted that, in the embodiments of the present application, children are used for description. It is understandable that a child is only a user and is not limited to a child.
基于以上实施例,本申请实施例还提供了一种电子设备。该电子设备用于实现本申请实施例提供的基于绘本的问答交互方法。参阅图15所示,该电子设备1500可以包括:处理单元1501、输入单元1502和输出单元1503。Based on the above embodiments, an embodiment of the present application also provides an electronic device. The electronic device is used to implement the picture book-based question and answer interaction method provided by the embodiment of the present application. Referring to FIG. 15, the electronic device 1500 may include: a processing unit 1501, an input unit 1502, and an output unit 1503.
在一个实施例中,图15所示的电子设备可以用于执行图4所示的基于绘本的问答交互方法中电子设备的操作。具体的:In one embodiment, the electronic device shown in FIG. 15 may be used to perform operations of the electronic device in the picture book-based question and answer interaction method shown in FIG. 4. specific:
所述处理单元1501,用于加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库、调用函数库、答案模板库和字词集合,所述实体属性库包含多个实体名称及实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应,所述字词集合指示多个关键词与泛化词之间的对应关系,所述泛化词包括实体;The processing unit 1501 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set. The entity attribute library contains multiple Entity names and entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, the call function library includes at least one call function, the Each question template in the question template library corresponds to one or more call functions in the call function library, each question template in the question template library includes multiple slots, and the answer template library includes at least one The answer template, the answer template in the answer template library corresponds to the call function in the call function library one-to-one, the word set indicates the correspondence between multiple keywords and generalized words, and the general Anagrams include entities;
所述输入单元1502,用于接收用户提出的问题;The input unit 1502 is used to receive questions raised by users;
所述处理单元1501,还用于对所述用户提出的问题进行分词处理得到分词词串,所述分词词串为多个关键词文本序列;The processing unit 1501 is further configured to perform word segmentation processing on the question posed by the user to obtain a word segmentation string, the word segmentation string being a plurality of keyword text sequences;
根据所述分词词串和所述字词集合得到泛化后的问题,所述泛化后的问题为多个泛化词文本序列;Obtaining a generalized question according to the word segmentation string and the word set, and the generalized question is a plurality of generalized word text sequences;
从所述泛化后的问题中提取出所述用户提出的问题所对应的实体名称,所述用户提出的问题所对应的实体名称为所述泛化后的问题中被泛化成实体的关键词;The entity name corresponding to the question posed by the user is extracted from the generalized question, and the entity name corresponding to the question posed by the user is the keyword that is generalized to the entity in the generalized question ;
根据所述泛化后的问题与所述问题模板库中问题模板的文本相似度,从所述问题模板库中获取被提问问题模板;Acquiring the question template to be asked from the question template library according to the text similarity between the generalized question and the question template in the question template library;
根据所述被提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取被提问调用函数;Obtaining the questioned calling function from the calling function library according to the matching degree between the slot of the question template being asked and the parameters of the calling function in the calling function library;
根据所述被提问调用函数和所述用户提出的问题所对应的实体名称,从所述实体属性库中获取所述用户提出的问题所对应的实体名称对应的实体属性;Obtaining the entity attribute corresponding to the entity name corresponding to the question posed by the user from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the user;
根据所述被提问调用函数从所述答案模板库中获取待回答答案模板,所述待回答答案模板为所述答案模板库中与所述被提问调用函数对应的答案模板;Acquiring an answer template to be answered from the answer template library according to the called function being asked, where the answer template to be answered is an answer template corresponding to the calling function of the question in the answer template library;
基于所述待回答答案模板,将所述用户提出的问题所对应的实体名称及所述用户提出的问题所对应的实体名称对应的实体属性生成待回答答案;Based on the answer template, generating the answer to be answered by the entity name corresponding to the question asked by the user and the entity attribute corresponding to the entity name corresponding to the question asked by the user;
所述输出单元1503,用于向所述用户输出所述待回答答案。The output unit 1503 is configured to output the answer to be answered to the user.
基于上述电子设备,可以根据用户的问题基于与目标绘本相关的数据库灵活自行确定答案,并不需要机械地预设好问题和答案,用户可以不需要按照预设的问题进行提问,可以灵活提问,电子设备也可以回答更多的问题,从而可以使在绘本阅读过程中电子设备和用户的交互更加智能,可以提高阅读有效性。Based on the above electronic equipment, the user can flexibly determine the answer based on the database related to the target picture book according to the user’s question. There is no need to mechanically preset the question and answer. The user does not need to ask the question according to the preset question, and can ask the question flexibly. The electronic device can also answer more questions, so that the interaction between the electronic device and the user during the picture book reading process can be more intelligent, and the effectiveness of reading can be improved.
在一种可选的实施方式中,所述被提问调用函数的参数的数量和类型与所述被提问问题模板的槽位的数量和类型的匹配程度最高。In an optional implementation manner, the number and types of parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template.
在一种可选的实施方式中,所述处理单元1501,还用于:根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。In an optional implementation manner, the processing unit 1501 is further configured to: update the entity attribute database according to the entity name and entity attribute contained in the interaction history information; wherein, the interaction history information is In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
在一种可选的实施方式中,所述电子设备还包括摄像头,用于采集所述用户展示的绘本的图像,所述处理单元1501,还用于:在加载与所述目标绘本相关的数据库之前,通过所述摄像头采集所述用户展示的绘本的图像,并通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。In an optional implementation manner, the electronic device further includes a camera for collecting images of the picture book displayed by the user, and the processing unit 1501 is further used for loading a database related to the target picture book Previously, the image of the picture book displayed by the user was collected through the camera, and the image of the collected picture book was analyzed by image analysis technology to determine the target picture book.
在一种可选的实施方式中,所述电子设备还包含显示屏,所述处理单元1501,还用于:在所述输出单元1503向所述用户输出所述待回答答案时,通过所述显示屏显示所述待回答答案。In an optional implementation manner, the electronic device further includes a display screen, and the processing unit 1501 is further configured to: when the output unit 1503 outputs the answer to be answered to the user, pass the The display screen displays the answer to be answered.
在一种可选的实施方式中,所述电子设备还包含可活动部件,所述处理单元1501,还用于:在所述输出单元1503向所述用户输出所述待回答答案时,控制所述可活动部件执行输出所述待回答答案的动作。In an optional implementation manner, the electronic device further includes movable parts, and the processing unit 1501 is further configured to: when the output unit 1503 outputs the answer to be answered to the user, control the The movable component performs an action of outputting the answer to be answered.
在另一个实施例中,图15所示的电子设备可以用于执行图5所示的基于绘本的问答交互方法中电子设备的操作。具体的:In another embodiment, the electronic device shown in FIG. 15 may be used to perform operations of the electronic device in the picture book-based question and answer interaction method shown in FIG. 5. specific:
所述处理单元1501,用于加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库和调用函数库,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位;The processing unit 1501 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, and a calling function library, and the entity attribute library includes multiple entity names and multiple entity attributes , The multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, the call function library includes at least one call function, and each question template library One question template corresponds to one or more call functions in the call function library, and each question template in the question template library includes multiple slots;
根据问题模板信息从所述问题模板库中获取待提问问题模板,所述问题模板信息为转移概率集合或问题模板类型,所述转移概率集合包括历史问题模板与所述问题模板库中其他问题模板之间的转移概率,所述历史问题模板为所述电子设备在生成上一次向用户提出的问题的过程中获取的问题模板,所述问题模板类型与所述用户的年龄相关;Acquire a question template to be asked from the question template library according to question template information, where the question template information is a transition probability set or a question template type, and the transition probability set includes historical question templates and other question templates in the question template library The historical question template is a question template obtained by the electronic device in the process of generating the question posed to the user last time, and the question template type is related to the age of the user;
根据所述待提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取待提问调用函数;Obtaining the calling function to be asked from the calling function library according to the degree of matching between the slot of the question template to be asked and the parameter of the calling function in the calling function library;
根据所述待提问调用函数从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性;Obtaining the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked;
基于所述待提问问题模板,将所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性生成待提问问题;Based on the question template to be asked, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked are generated to generate the question to be asked;
所述输出单元1503,用于向所述用户输出所述待提问问题。The output unit 1503 is configured to output the question to be asked to the user.
在一种可选的实施方式中,所述数据库还包括答案模板库,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应;所述处理单元1501,还用于:In an optional implementation manner, the database further includes an answer template library, the answer template library includes at least one answer template, the answer template in the answer template library and the call function in the call function library The numbers correspond to each other; the processing unit 1501 is also used for:
从所述待提问问题中提取所述待提问问题所对应的实体名称和/或所述待提问问题模板所对应的实体属性;Extracting the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the template of the question to be asked from the question to be asked;
根据所述待提问调用函数和所述待提问问题所对应的实体名称,从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性,或者,根据所述待提问调用函数和所述待提问问题所对应的实体属性,从所述实体属性库中获取所述待提问问题所对应的实体属性对应的实体名称;According to the call function to be asked and the entity name corresponding to the question to be asked, obtain the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library, or call according to the question to be asked Function and the entity attribute corresponding to the question to be asked, obtaining the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library;
根据所述待提问调用函数从所述答案模板库中获取待确定答案模板,所述待确定答案模板为所述答案模板库中与所述待提问调用函数对应的答案模板;Obtaining an answer template to be determined from the answer template library according to the calling function to be asked, where the answer template to be determined is an answer template corresponding to the calling function to be asked in the answer template library;
基于所述待确定答案模板,将待确定答案关键词生成待确定答案,所述待确定答案关键词为以下任一项:所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体名称和所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体属性、所述待提问问题所对应的实体属性和所述待提问问题所对应的实体属性对应的实体名称。Based on the to-be-determined answer template, the to-be-determined answer keyword is generated to generate a to-be-determined answer, and the to-be-determined answer keyword is any of the following: the entity attribute corresponding to the entity name corresponding to the question The entity name corresponding to the question to be asked and the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the question to be asked The entity name corresponding to the corresponding entity attribute.
在一种示例中,所述电子设备还包括:In an example, the electronic device further includes:
输入单元1502,用于接收所述用户针对所述待提问问题的回答;The input unit 1502 is configured to receive the user's answer to the question to be asked;
所述处理单元1501,还用于:将所述用户针对所述待提问问题的回答与所述待确定答案进行对比分析以得到所述用户的回答是否正确的判断结果;根据所述判断结果向所述用户做出相应的操作。The processing unit 1501 is further configured to: compare and analyze the user's answer to the question to be asked and the answer to be determined to obtain a judgment result of whether the user's answer is correct; The user makes the corresponding operation.
一种实现方式中,所述待提问调用函数的参数的数量和类型与所述待提问问题模板的槽位的数量和类型的匹配程度最高。In an implementation manner, the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked.
一种示例性的方式,所述问题模板信息为所述转移概率集合时,所述处理单元1501,在根据所述问题模板信息从所述问题模板库中获取待提问问题模板时,具体用于:In an exemplary manner, when the question template information is the transition probability set, the processing unit 1501 is specifically configured to obtain the question template to be asked from the question template library according to the question template information :
根据预先确定的随机取值从所述转移概率集合中确定目标转移概率;Determining the target transition probability from the transition probability set according to a predetermined random value;
根据所述目标转移概率从所述问题模板库中获取所述待提问问题模板。Acquire the question template to be asked from the question template library according to the target transition probability.
另一种示例性的方式,所述问题模板信息为所述问题模板类型时,所述处理单元1501,在根据所述问题模板信息从所述问题模板库中获取待提问问题模板时,具体用于:In another exemplary manner, when the question template information is the question template type, the processing unit 1501 specifically uses the question template to be asked from the question template library according to the question template information. in:
根据所述用户的年龄以及年龄与问题模板类型的对应关系确定目标问题模板类型;所述对应关系指示用户的年龄与以下至少一个问题模板类型对应:空间、细节、社会、色彩、数字、文字、自然;Determine the target question template type according to the user’s age and the corresponding relationship between the age and the question template type; the corresponding relationship indicates that the user’s age corresponds to at least one of the following question template types: space, detail, society, color, number, text, natural;
从所述问题模板库中获取符合所述目标问题模板类型的问题模板作为所述待提问问题模板。Obtain a question template that meets the target question template type from the question template library as the question template to be asked.
一种可选的实施方式中,所述处理单元1501,还用于:根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。In an optional implementation manner, the processing unit 1501 is further configured to: update the entity attribute database according to the entity name and entity attributes contained in the interaction history information; wherein, the interaction history information is in the In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
一种可能的方式中,所述电子设备还包括:摄像头,用于采集所述用户展示的绘本的图像;In a possible manner, the electronic device further includes: a camera for collecting images of the picture book displayed by the user;
所述处理单元1501,还用于在加载与所述目标绘本相关的数据库之前,通过摄像头采集所述用户展示的绘本的图像;通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。The processing unit 1501 is further configured to collect an image of the picture book displayed by the user through a camera before loading the database related to the target picture book; analyze the collected image of the picture book by image analysis technology to determine the Target picture book.
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。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 technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including a number of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .
基于以上实施例,本申请实施例还提供了一种在电子设备,该电子设备可以实现本申请实施例提供的基于绘本的问答交互方法。可以参阅图16所示,所述电子设备1600包括:通信单元1601和处理器1602,可选的还可以包括存储器1603,其中:Based on the above embodiments, the embodiments of the present application also provide an electronic device that can implement the picture book-based question and answer interaction method provided in the embodiments of the present application. As shown in FIG. 16, the electronic device 1600 includes a communication unit 1601 and a processor 1602, and optionally may also include a memory 1603, where:
其中,处理器1602可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合等等。处理器1602还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列 (field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。处理器1602在实现上述功能时,可以通过硬件实现,当然也可以通过硬件执行相应的软件实现。The processor 1602 may be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP, and so on. The processor 1602 may further include a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. When the processor 1602 realizes the above functions, it may be realized by hardware, and of course, it may also be realized by hardware executing corresponding software.
通信单元1601和处理器1602之间相互连接。可选的,通信单元1601和处理器1602通过总线1604相互连接;总线1604可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图16中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication unit 1601 and the processor 1602 are connected to each other. Optionally, the communication unit 1601 and the processor 1602 are connected to each other through a bus 1604; the bus 1604 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. . The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in FIG. 16, but it does not mean that there is only one bus or one type of bus.
在一种可选的实施方式中,存储器1603,与处理器1602耦合,用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括计算机操作指令。存储器1603可能包括RAM,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。处理器1602执行存储器1603所存放的应用程序,实现上述功能,从而实现电子设备的功能,即实现基于绘本的问答交互方法。In an optional implementation manner, the memory 1603 is coupled with the processor 1602 for storing programs and the like. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory 1603 may include RAM, or may also include non-volatile memory, such as at least one disk memory. The processor 1602 executes the application program stored in the memory 1603 to realize the above-mentioned functions, thereby realizing the function of the electronic device, that is, realizing the question and answer interactive method based on the picture book.
在一个实施例中,图16所示的电子设备可用于执行上述图4所示的实施例中的电子设备的操作。具体的:In one embodiment, the electronic device shown in FIG. 16 may be used to perform operations of the electronic device in the embodiment shown in FIG. 4 above. specific:
所述处理器1602,用于加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库、调用函数库、答案模板库和字词集合,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应,所述字词集合指示多个关键词与泛化词之间的对应关系,所述泛化词包括实体;The processor 1602 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set. The entity attribute library includes multiple Entity names and multiple entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, and the calling function library includes at least one calling function, Each question template in the question template library corresponds to one or more call functions in the call function library, each question template in the question template library includes a plurality of slots, and the answer template library contains At least one answer template, the answer templates in the answer template library correspond to the calling functions in the calling function library, and the word set indicates the correspondence between multiple keywords and generalized words, so The generalized words include entities;
所述通信单元1601,用于接收所述用户提出的问题;The communication unit 1601 is configured to receive questions raised by the user;
所述处理器1602,还用于对所述用户提出的问题进行分词处理得到分词词串,所述分词词串为多个关键词文本序列;The processor 1602 is further configured to perform word segmentation processing on the question posed by the user to obtain a word segmentation string, where the word segmentation string is a plurality of keyword text sequences;
根据所述分词词串和所述字词集合得到泛化后的问题,所述泛化后的问题为多个泛化词文本序列;Obtaining a generalized question according to the word segmentation string and the word set, and the generalized question is a plurality of generalized word text sequences;
从所述泛化后的问题中提取出所述用户提出的问题所对应的实体名称,所述用户提出的问题所对应的实体名称为所述泛化后的问题中被泛化成实体的关键词;The entity name corresponding to the question posed by the user is extracted from the generalized question, and the entity name corresponding to the question posed by the user is the keyword that is generalized to the entity in the generalized question ;
根据所述泛化后的问题与所述问题模板库中问题模板的文本相似度,从所述问题模板库中获取被提问问题模板;Acquiring the question template to be asked from the question template library according to the text similarity between the generalized question and the question template in the question template library;
根据所述被提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取被提问调用函数;Obtaining the questioned calling function from the calling function library according to the matching degree between the slot of the question template being asked and the parameters of the calling function in the calling function library;
根据所述被提问调用函数和所述用户提出的问题所对应的实体名称,从所述实体属性库中获取所述用户提出的问题所对应的实体名称对应的实体属性;Obtaining the entity attribute corresponding to the entity name corresponding to the question posed by the user from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the user;
根据所述被提问调用函数从所述答案模板库中获取待回答答案模板,所述待回答答案模板为所述答案模板库中与所述被提问调用函数对应的答案模板;Acquiring an answer template to be answered from the answer template library according to the called function being asked, where the answer template to be answered is an answer template corresponding to the calling function of the question in the answer template library;
基于所述待回答答案模板,将所述用户提出的问题所对应的实体名称及所述用户提出的问题所对应的实体名称对应的实体属性生成待回答答案;Based on the answer template, generating the answer to be answered by the entity name corresponding to the question asked by the user and the entity attribute corresponding to the entity name corresponding to the question asked by the user;
所述通信单元1601,还用于向所述用户输出所述待回答答案。The communication unit 1601 is also used to output the answer to be answered to the user.
基于上述电子设备,可以根据用户的问题基于与目标绘本相关的数据库灵活自行确定答案,并不需要机械地预设好问题和答案,用户可以不需要按照预设的问题进行提问,可以灵活提问,电子设备也可以回答更多的问题,从而可以使在绘本阅读过程中电子设备和用户的交互更加智能,可以提高阅读绘本有效性。Based on the above electronic equipment, the user can flexibly determine the answer based on the database related to the target picture book according to the user’s question. There is no need to mechanically preset the question and answer. The user does not need to ask the question according to the preset question, and can ask the question flexibly. The electronic device can also answer more questions, so that the interaction between the electronic device and the user during the picture book reading process can be more intelligent, and the effectiveness of reading picture books can be improved.
在一种可选的实施方式中,所述被提问调用函数的参数的数量和类型与所述被提问问题模板的槽位的数量和类型的匹配程度最高。In an optional implementation manner, the number and types of parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template.
在一种可选的实施方式中,所述处理器1602,还用于:根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。In an optional implementation manner, the processor 1602 is further configured to: update the entity attribute database according to the entity name and entity attribute contained in the interaction history information; wherein, the interaction history information is In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
在一种可选的实施方式中,所述电子设备1600还包含摄像头,用于采集所述用户展示的绘本的图像,所述处理器1602,还用于:在加载与所述目标绘本相关的数据库之前,通过所述摄像头采集所述用户展示的绘本的图像,并通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。In an optional implementation manner, the electronic device 1600 further includes a camera for collecting images of the picture book displayed by the user, and the processor 1602 is further used for loading a picture book related to the target Before the database, the image of the picture book displayed by the user is collected through the camera, and the collected image of the picture book is analyzed by image analysis technology to determine the target picture book.
在一种可选的实施方式中,所述电子设备1600还包含显示屏,所述处理器1602,还用于:在所述通信单元1601向所述用户输出所述待回答答案时,通过所述显示屏显示所述待回答答案。In an optional implementation manner, the electronic device 1600 further includes a display screen, and the processor 1602 is further configured to: when the communication unit 1601 outputs the answer to be answered to the user, pass the The display screen displays the answer to be answered.
在一种可选的实施方式中,所述电子设备1600还包含可活动部件,所述处理器1602,还用于:在所述通信单元1601向所述用户输出所述待回答答案时,控制所述可活动部件执行输出所述待回答答案的动作。In an optional implementation manner, the electronic device 1600 further includes movable components, and the processor 1602 is further configured to: when the communication unit 1601 outputs the answer to be answered to the user, control The movable part performs an action of outputting the answer to be answered.
在另一个实施例中,图16所示的电子设备可以用于执行图5所示的基于绘本的问答交互方法中电子设备的操作。具体的:In another embodiment, the electronic device shown in FIG. 16 may be used to perform operations of the electronic device in the picture book-based question and answer interaction method shown in FIG. 5. specific:
所述处理器1602,用于加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库和调用函数库,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位;The processor 1602 is configured to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, and a calling function library, and the entity attribute library includes multiple entity names and multiple entity attributes , The multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, the call function library includes at least one call function, and each question template library One question template corresponds to one or more call functions in the call function library, and each question template in the question template library includes multiple slots;
根据问题模板信息从所述问题模板库中获取待提问问题模板,所述问题模板信息为转移概率集合或问题模板类型,所述转移概率集合包括历史问题模板与所述问题模板库中其他问题模板之间的转移概率,所述历史问题模板为所述电子设备在生成上一次向用户提出的问题的过程中获取的问题模板,所述问题模板类型与所述用户的年龄相关;Acquire a question template to be asked from the question template library according to question template information, where the question template information is a transition probability set or a question template type, and the transition probability set includes historical question templates and other question templates in the question template library The historical question template is a question template obtained by the electronic device in the process of generating the question posed to the user last time, and the question template type is related to the age of the user;
根据所述待提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取待提问调用函数;Acquiring the calling function to be asked from the calling function library according to the degree of matching between the slot of the question template to be asked and the parameter of the calling function in the calling function library;
根据所述待提问调用函数从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性;Obtaining the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked;
基于所述待提问问题模板,将所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性生成待提问问题;Based on the question template to be asked, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked are generated to generate the question to be asked;
所述通信单元1601,用于向所述用户输出所述待提问问题。The communication unit 1601 is configured to output the question to be asked to the user.
在一种可选的实施方式中,所述数据库还包括答案模板库,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应;所述处理器1602,还用于:In an optional implementation manner, the database further includes an answer template library, the answer template library includes at least one answer template, the answer template in the answer template library and the call function in the call function library The numbers correspond to each other; the processor 1602 is also used for:
从所述待提问问题中提取所述待提问问题所对应的实体名称和/或所述待提问问题模板所对应的实体属性;Extracting the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the template of the question to be asked from the question to be asked;
根据所述待提问调用函数和所述待提问问题所对应的实体名称,从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性,或者,根据所述待提问调用函数和所述待提问问题所对应的实体属性,从所述实体属性库中获取所述待提问问题所对应的实体属性对应的实体名称;According to the call function to be asked and the entity name corresponding to the question to be asked, obtain the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library, or call according to the question to be asked Function and the entity attribute corresponding to the question to be asked, obtaining the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library;
根据所述待提问调用函数从所述答案模板库中获取待确定答案模板,所述待确定答案模板为所述答案模板库中与所述待提问调用函数对应的答案模板;Obtaining an answer template to be determined from the answer template library according to the calling function to be asked, where the answer template to be determined is an answer template corresponding to the calling function to be asked in the answer template library;
基于所述待确定答案模板,将待确定答案关键词生成待确定答案,所述待确定答案关键词为以下任一项:所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体名称和所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体属性、所述待提问问题所对应的实体属性和所述待提问问题所对应的实体属性对应的实体名称。Based on the to-be-determined answer template, the to-be-determined answer keyword is generated to generate a to-be-determined answer, and the to-be-determined answer keyword is any of the following: the entity attribute corresponding to the entity name corresponding to the question The entity name corresponding to the question to be asked and the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the question to be asked The entity name corresponding to the corresponding entity attribute.
在一种示例中,所述通信单元1601,还用于接收所述用户针对所述待提问问题的回答;In an example, the communication unit 1601 is further configured to receive the user's answer to the question to be asked;
所述处理器1602,还用于:将所述用户针对所述待提问问题的回答与所述待确定答案进行对比分析以得到所述用户的回答是否正确的判断结果;根据所述判断结果向所述用户做出相应的操作。The processor 1602 is further configured to: compare and analyze the user's answer to the question to be asked with the answer to be determined to obtain a judgment result of whether the user's answer is correct; The user makes the corresponding operation.
一种实现方式中,所述待提问调用函数的参数的数量和类型与所述待提问问题模板的槽位的数量和类型的匹配程度最高。In an implementation manner, the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the template of the question to be asked.
一种示例性的方式,所述问题模板信息为所述转移概率集合时,所述处理器1602,在根据所述问题模板信息从所述问题模板库中获取待提问问题模板时,具体用于:In an exemplary manner, when the question template information is the set of transition probabilities, the processor 1602 is specifically configured to obtain the question template to be asked from the question template library according to the question template information. :
根据预先确定的随机取值从所述转移概率集合中确定目标转移概率;Determining the target transition probability from the transition probability set according to a predetermined random value;
根据所述目标转移概率从所述问题模板库中获取所述待提问问题模板。Acquire the question template to be asked from the question template library according to the target transition probability.
另一种示例性的方式,所述问题模板信息为所述问题模板类型时,所述处理器1602,在根据所述问题模板信息从所述问题模板库中获取待提问问题模板时,具体用于:In another exemplary manner, when the question template information is the question template type, the processor 1602 specifically uses the question template to be asked from the question template library according to the question template information. in:
根据所述用户的年龄以及年龄与问题模板类型的对应关系确定目标问题模板类型;所述对应关系指示用户的年龄与以下至少一个问题模板类型对应:空间、细节、社会、色彩、数字、文字、自然;Determine the target question template type according to the user’s age and the corresponding relationship between the age and the question template type; the corresponding relationship indicates that the user’s age corresponds to at least one of the following question template types: space, detail, society, color, number, text, natural;
从所述问题模板库中获取符合所述目标问题模板类型的问题模板作为所述待提问问题模板。Obtain a question template that meets the target question template type from the question template library as the question template to be asked.
一种可选的实施方式中,所述处理器1602,还用于:根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。In an optional implementation manner, the processor 1602 is further configured to: update the entity attribute database according to the entity name and entity attribute contained in the interaction history information; wherein, the interaction history information is in the In the process of the electronic device reading the target picture book, the electronic device receives speech information input by the user or action information of the user.
一种可能的方式中,所述电子设备1600还包括:摄像头,用于采集所述用户展示的绘本的图像;所述处理器1602,还用于在加载与所述目标绘本相关的数据库之前,通过摄像头采集所述用户展示的绘本的图像;通过图像分析技术对采集到的绘本的图像进行分析 以确定所述目标绘本。In a possible manner, the electronic device 1600 further includes: a camera for collecting images of the picture book displayed by the user; and the processor 1602 is also used for loading a database related to the target picture book, The image of the picture book displayed by the user is collected by a camera; the image of the collected picture book is analyzed by image analysis technology to determine the target picture book.
综上所述,通过本申请实施例提供一种基于绘本的问答交互方法及电子设备,以使在绘本阅读过程中电子设备和用户的交互更加智能,可以提高效率,提升用户体验。In summary, the embodiments of the present application provide a picture book-based question and answer interaction method and electronic device, so that the interaction between the electronic device and the user during the picture book reading process is more intelligent, which can improve efficiency and enhance user experience.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, equipment (systems), and computer program products according to the embodiments of this application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the embodiments of the present application. In this way, if these modifications and variations of the embodiments of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims (25)

  1. 一种基于绘本的问答交互方法,其特征在于,包括:A question and answer interactive method based on picture books, which is characterized in that it includes:
    电子设备加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库、调用函数库、答案模板库和字词集合,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应,所述字词集合指示多个关键词与泛化词之间的对应关系,所述泛化词包括实体;The electronic device loads a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set. The entity attribute library includes multiple entity names and multiple Entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, the question template library contains at least one question template, the calling function library contains at least one calling function, and the question template library contains Each question template corresponds to one or more call functions in the call function library, each question template in the question template library includes multiple slots, and the answer template library includes at least one answer template, so The answer templates in the answer template library correspond to the call functions in the call function library one-to-one, the word set indicates the correspondence between multiple keywords and generalized words, and the generalized words include entities ;
    所述电子设备接收用户提出的问题;The electronic device receives the question raised by the user;
    所述电子设备对所述用户提出的问题进行分词处理得到分词词串,所述分词词串为多个关键词文本序列;The electronic device performs word segmentation processing on the question posed by the user to obtain a word segmentation string, and the word segmentation string is a plurality of keyword text sequences;
    所述电子设备根据所述分词词串和所述字词集合得到泛化后的问题,所述泛化后的问题为多个泛化词文本序列;The electronic device obtains a generalized question according to the word segmentation string and the word set, and the generalized question is a plurality of generalized word text sequences;
    所述电子设备从所述泛化后的问题中提取出所述用户提出的问题所对应的实体名称,所述用户提出的问题所对应的实体名称为所述泛化后的问题中被泛化成实体的关键词;The electronic device extracts the entity name corresponding to the question posed by the user from the generalized question, and the entity name corresponding to the question posed by the user is the generalized question which is generalized to Entity keywords;
    所述电子设备根据所述泛化后的问题与所述问题模板库中问题模板的文本相似度,从所述问题模板库中获取被提问问题模板;The electronic device obtains the question template to be asked from the question template library according to the text similarity between the generalized question and the question template in the question template library;
    所述电子设备根据所述被提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取被提问调用函数;The electronic device obtains the questioned call function from the call function library according to the degree of matching between the slot of the question template and the parameter of the call function in the call function library;
    所述电子设备根据所述被提问调用函数和所述用户提出的问题所对应的实体名称,从所述实体属性库中获取所述用户提出的问题所对应的实体名称对应的实体属性;The electronic device obtains the entity attribute corresponding to the entity name corresponding to the question posed by the user from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the user;
    所述电子设备根据所述被提问调用函数从所述答案模板库中获取待回答答案模板,所述待回答答案模板为所述答案模板库中与所述被提问调用函数对应的答案模板;The electronic device obtains an answer template to be answered from the answer template library according to the called function being asked, where the answer template to be answered is an answer template corresponding to the called function being asked in the answer template library;
    基于所述待回答答案模板,所述电子设备将所述用户提出的问题所对应的实体名称及所述用户提出的问题所对应的实体名称对应的实体属性生成待回答答案;Based on the answer template, the electronic device generates the answer to be answered by the entity name corresponding to the question asked by the user and the entity attribute corresponding to the entity name corresponding to the question asked by the user;
    所述电子设备向所述用户输出所述待回答答案。The electronic device outputs the answer to be answered to the user.
  2. 如权利要求1所述的方法,其特征在于,所述被提问调用函数的参数的数量和类型与所述被提问问题模板的槽位的数量和类型的匹配程度最高。The method according to claim 1, wherein the number and types of parameters of the function called by the question have the highest matching degree with the number and types of slots of the question template.
  3. 如权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:
    所述电子设备根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;The electronic device updates the entity attribute database according to the entity name and entity attribute contained in the interaction history information;
    其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。Wherein, the interaction history information is the speech information input by the user or the action information of the user received by the electronic device during the process of reading the target picture book by the electronic device.
  4. 如权利要求1-3任一项所述的方法,其特征在于,在所述电子设备加载与所述目标绘本相关的数据库之前,所述方法还包括:The method according to any one of claims 1 to 3, wherein before the electronic device loads the database related to the target picture book, the method further comprises:
    所述电子设备通过摄像头采集所述用户展示的绘本的图像;The electronic device collects an image of the picture book displayed by the user through a camera;
    所述电子设备通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。The electronic device analyzes the collected image of the picture book by image analysis technology to determine the target picture book.
  5. 一种基于绘本的问答交互方法,其特征在于,包括:A question and answer interactive method based on picture books, which is characterized in that it includes:
    电子设备加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库和调用函数库,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位;The electronic device loads a database related to the target picture book, where the database includes an entity attribute library, a question template library, and a calling function library. The entity attribute library includes multiple entity names and multiple entity attributes, and the multiple entities The name corresponds to the multiple entity attributes one-to-one, the question template library contains at least one question template, the calling function library contains at least one calling function, and each question template in the question template library corresponds to the Calling one or more calling functions in the function library, and each question template in the question template library includes multiple slots;
    所述电子设备根据问题模板信息从所述问题模板库中获取待提问问题模板,所述问题模板信息为转移概率集合或问题模板类型,所述转移概率集合包括历史问题模板与所述问题模板库中其他问题模板之间的转移概率,所述历史问题模板为所述电子设备在生成上一次向用户提出的问题的过程中获取的问题模板,所述问题模板类型与所述用户的年龄相关;The electronic device obtains a question template to be asked from the question template library according to question template information, the question template information is a transition probability set or a question template type, and the transition probability set includes a historical question template and the question template library The transition probability between other question templates in the above, the historical question template is a question template obtained by the electronic device in the process of generating the last question posed to the user, and the question template type is related to the age of the user;
    所述电子设备根据所述待提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取待提问调用函数;The electronic device obtains the calling function to be asked from the calling function library according to the matching degree between the slot of the question template to be asked and the parameter of the calling function in the calling function library;
    所述电子设备根据所述待提问调用函数从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性;The electronic device obtains the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked;
    基于所述待提问问题模板,所述电子设备将所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性生成待提问问题;Based on the question template to be asked, the electronic device generates the question to be asked by the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked;
    所述电子设备向所述用户输出所述待提问问题。The electronic device outputs the question to be asked to the user.
  6. 如权利要求5所述的方法,其特征在于,所述数据库还包括答案模板库,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应;所述方法还包括:The method according to claim 5, wherein the database further comprises an answer template library, the answer template library contains at least one answer template, and the answer template in the answer template library and the calling function library are The calling function of is one-to-one correspondence; the method further includes:
    所述电子设备从所述待提问问题中提取所述待提问问题所对应的实体名称和/或所述待提问问题所对应的实体属性;The electronic device extracts the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the question to be asked from the question to be asked;
    所述电子设备根据所述待提问调用函数和所述待提问问题所对应的实体名称,从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性,或者,所述电子设备根据所述待提问调用函数和所述待提问问题所对应的实体属性,从所述实体属性库中获取所述待提问问题所对应的实体属性对应的实体名称;The electronic device obtains the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library according to the calling function to be asked and the entity name corresponding to the question to be asked, or the The electronic device obtains the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library according to the calling function to be asked and the entity attribute corresponding to the question to be asked;
    所述电子设备根据所述待提问调用函数从所述答案模板库中获取待确定答案模板,所述待确定答案模板为所述答案模板库中与所述待提问调用函数对应的答案模板;The electronic device obtains an answer template to be determined from the answer template library according to the call function to be asked, where the answer template to be determined is an answer template in the answer template library that corresponds to the call function to be asked;
    基于所述待确定答案模板,所述电子设备将待确定答案关键词生成待确定答案,所述待确定答案关键词为以下任一项:所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体名称和所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体属性、所述待提问问题所对应的实体属性和所述待提问问题所对应的实体属性对应的实体名称。Based on the to-be-determined answer template, the electronic device generates a to-be-determined answer keyword to be determined, and the to-be-determined answer keyword is any one of the following: the entity attribute corresponding to the entity name corresponding to the question to be asked , The entity name corresponding to the question to be asked and the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the State the entity name corresponding to the entity attribute corresponding to the question to be asked.
  7. 如权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6, wherein the method further comprises:
    所述电子设备接收所述用户针对所述待提问问题的回答;Receiving, by the electronic device, the user's answer to the question to be asked;
    所述电子设备将所述用户针对所述待提问问题的回答与所述待确定答案进行对比分析以得到所述用户的回答是否正确的判断结果;The electronic device compares and analyzes the user's answer to the question to be asked and the answer to be determined to obtain a judgment result of whether the user's answer is correct;
    所述电子设备根据所述判断结果向所述用户做出相应的操作。The electronic device makes a corresponding operation to the user according to the judgment result.
  8. 如权利要求5-7任一项所述的方法,其特征在于,所述待提问调用函数的参数的数量和类型与所述待提问问题模板的槽位的数量和类型的匹配程度最高。The method according to any one of claims 5-7, wherein the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the question template to be asked.
  9. 如权利要求5-8任一项所述的方法,其特征在于,所述问题模板信息为所述转移概率集合时,所述电子设备根据所述问题模板信息从所述问题模板库中获取待提问问题模板,包括:The method according to any one of claims 5-8, wherein when the question template information is the set of transition probabilities, the electronic device obtains the pending question from the question template library according to the question template information. Question template, including:
    所述电子设备根据预先确定的随机取值从所述转移概率集合中确定目标转移概率;The electronic device determines the target transition probability from the transition probability set according to a predetermined random value;
    所述电子设备根据所述目标转移概率从所述问题模板库中获取所述待提问问题模板。The electronic device obtains the question template to be asked from the question template library according to the target transition probability.
  10. 如权利要求5-8任一项所述的方法,其特征在于,所述问题模板信息为所述问题模板类型时,所述电子设备根据所述问题模板信息从所述问题模板库中获取待提问问题模板,包括:The method according to any one of claims 5-8, wherein when the question template information is the question template type, the electronic device obtains the pending question from the question template library according to the question template information. Question template, including:
    所述电子设备根据所述用户的年龄以及年龄与问题模板类型的对应关系确定目标问题模板类型;所述对应关系指示用户的年龄与以下至少一个问题模板类型对应:空间、细节、社会、色彩、数字、文字、自然;The electronic device determines the target question template type according to the age of the user and the corresponding relationship between the age and the question template type; the corresponding relationship indicates that the user’s age corresponds to at least one of the following question template types: space, detail, society, color, Numbers, words, nature;
    所述电子设备从所述问题模板库中获取符合所述目标问题模板类型的问题模板作为所述待提问问题模板。The electronic device obtains a question template that meets the target question template type from the question template library as the question template to be asked.
  11. 如权利要求5-10任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 5-10, wherein the method further comprises:
    所述电子设备根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;The electronic device updates the entity attribute database according to the entity name and entity attribute contained in the interaction history information;
    其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。Wherein, the interaction history information is the speech information input by the user or the action information of the user received by the electronic device during the process of reading the target picture book by the electronic device.
  12. 如权利要求5-11任一项所述的方法,其特征在于,在所述电子设备加载与所述目标绘本相关的数据库之前,所述方法还包括:The method according to any one of claims 5-11, wherein before the electronic device loads the database related to the target picture book, the method further comprises:
    所述电子设备通过摄像头采集所述用户展示的绘本的图像;The electronic device collects an image of the picture book displayed by the user through a camera;
    所述电子设备通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。The electronic device analyzes the collected image of the picture book by image analysis technology to determine the target picture book.
  13. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理单元,用于加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库、调用函数库、答案模板库和字词集合,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应,所述字词集合指示多个关键词与泛化词之间的对应关系,所述泛化词包括实体;The processing unit is used to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, a calling function library, an answer template library, and a word set, and the entity attribute library contains multiple entity names And multiple entity attributes, the multiple entity names correspond to the multiple entity attributes one-to-one, the question template library includes at least one question template, the calling function library includes at least one calling function, the question Each question template in the template library corresponds to one or more call functions in the call function library, each question template in the question template library includes multiple slots, and the answer template library includes at least one answer Template, the answer template in the answer template library corresponds to the call function in the call function library one-to-one, the word set indicates the correspondence between multiple keywords and generalized words, and the generalized Words include entities;
    输入单元,用于接收用户提出的问题;Input unit for receiving questions raised by users;
    所述处理单元,还用于对所述用户提出的问题进行分词处理得到分词词串,所述分词词串为多个关键词文本序列;The processing unit is further configured to perform word segmentation processing on the question posed by the user to obtain a word segmentation string, and the word segmentation string is a plurality of keyword text sequences;
    根据所述分词词串和所述字词集合得到泛化后的问题,所述泛化后的问题为多个泛化词文本序列;Obtaining a generalized question according to the word segmentation string and the word set, and the generalized question is a plurality of generalized word text sequences;
    从所述泛化后的问题中提取出所述用户提出的问题所对应的实体名称,所述用户提出的问题所对应的实体名称为所述泛化后的问题中被泛化成实体的关键词;The entity name corresponding to the question posed by the user is extracted from the generalized question, and the entity name corresponding to the question posed by the user is the keyword that is generalized to the entity in the generalized question ;
    根据所述泛化后的问题与所述问题模板库中问题模板的文本相似度,从所述问题模板库中获取被提问问题模板;Acquiring the question template to be asked from the question template library according to the text similarity between the generalized question and the question template in the question template library;
    根据所述被提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取被提问调用函数;Obtaining the questioned calling function from the calling function library according to the matching degree between the slot of the question template being asked and the parameters of the calling function in the calling function library;
    根据所述被提问调用函数和所述用户提出的问题所对应的实体名称,从所述实体属性库中获取所述用户提出的问题所对应的实体名称对应的实体属性;Obtaining the entity attribute corresponding to the entity name corresponding to the question posed by the user from the entity attribute library according to the called function being asked and the entity name corresponding to the question posed by the user;
    根据所述被提问调用函数从所述答案模板库中获取待回答答案模板,所述待回答答案模板为所述答案模板库中与所述被提问调用函数对应的答案模板;Acquiring an answer template to be answered from the answer template library according to the called function being asked, where the answer template to be answered is an answer template corresponding to the calling function of the question in the answer template library;
    基于所述待回答答案模板,将所述用户提出的问题所对应的实体名称及所述用户提出的问题所对应的实体名称对应的实体属性生成待回答答案;Based on the answer template, generating the answer to be answered by the entity name corresponding to the question asked by the user and the entity attribute corresponding to the entity name corresponding to the question asked by the user;
    输出单元,用于向所述用户输出所述待回答答案。The output unit is used to output the answer to be answered to the user.
  14. 如权利要求13所述的电子设备,其特征在于,所述被提问调用函数的参数的数量和类型与所述被提问问题模板的槽位的数量和类型的匹配程度最高。The electronic device according to claim 13, wherein the number and types of parameters of the questioned calling function have the highest matching degree with the number and types of slots of the question template.
  15. 如权利要求13或14所述的电子设备,其特征在于,所述处理单元,还用于:The electronic device according to claim 13 or 14, wherein the processing unit is further configured to:
    根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;Update the entity attribute database according to the entity name and entity attribute contained in the interaction history information;
    其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。Wherein, the interaction history information is the speech information input by the user or the action information of the user received by the electronic device during the process of reading the target picture book by the electronic device.
  16. 如权利要求13-15任一项所述的电子设备,其特征在于,所述电子设备还包括:15. The electronic device according to any one of claims 13-15, wherein the electronic device further comprises:
    摄像头,用于采集所述用户展示的绘本的图像;A camera for collecting images of the picture book displayed by the user;
    所述处理单元,还用于在加载与所述目标绘本相关的数据库之前,通过摄像头采集所述用户展示的绘本的图像;The processing unit is further configured to collect an image of the picture book displayed by the user through a camera before loading the database related to the target picture book;
    通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。The image of the collected picture book is analyzed by image analysis technology to determine the target picture book.
  17. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理单元,用于加载与目标绘本相关的数据库,其中,所述数据库中包括实体属性库、问题模板库和调用函数库,所述实体属性库包含多个实体名称及多个实体属性,所述多个实体名称与所述多个实体属性一一对应,所述问题模板库中包含至少一个问题模板,所述调用函数库中包含至少一个调用函数,所述问题模板库中的每一个问题模板对应所述调用函数库中的一个或者多个调用函数,所述问题模板库中的每一个问题模板包括多个槽位;The processing unit is used to load a database related to the target picture book, wherein the database includes an entity attribute library, a question template library, and a calling function library, and the entity attribute library includes multiple entity names and multiple entity attributes. The multiple entity names correspond to the multiple entity attributes one-to-one, the question template library contains at least one question template, the calling function library contains at least one calling function, and each question template in the question template library Corresponding to one or more calling functions in the calling function library, each question template in the question template library includes multiple slots;
    根据问题模板信息从所述问题模板库中获取待提问问题模板,所述问题模板信息为转移概率集合或问题模板类型,所述转移概率集合包括历史问题模板与所述问题模板库中其他问题模板之间的转移概率,所述历史问题模板为所述电子设备在生成上一次向用户提出的问题的过程中获取的问题模板,所述问题模板类型与所述用户的年龄相关;Acquire a question template to be asked from the question template library according to question template information, where the question template information is a transition probability set or a question template type, and the transition probability set includes historical question templates and other question templates in the question template library The historical question template is a question template obtained by the electronic device in the process of generating the question posed to the user last time, and the question template type is related to the age of the user;
    根据所述待提问问题模板的槽位与所述调用函数库中调用函数的参数的匹配程度,从所述调用函数库中获取待提问调用函数;Acquiring the calling function to be asked from the calling function library according to the degree of matching between the slot of the question template to be asked and the parameter of the calling function in the calling function library;
    根据所述待提问调用函数从所述实体属性库中获取所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性;Obtaining the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked from the entity attribute library according to the calling function to be asked;
    基于所述待提问问题模板,将所述待提问问题模板所对应的实体名称和/或所述待提问问题模板所对应的实体属性生成待提问问题;Based on the question template to be asked, the entity name corresponding to the question template to be asked and/or the entity attribute corresponding to the question template to be asked are generated to generate the question to be asked;
    输出单元,用于向所述用户输出所述待提问问题。The output unit is configured to output the question to be asked to the user.
  18. 如权利要求17所述的电子设备,其特征在于,所述数据库还包括答案模板库,所述答案模板库中包含至少一个答案模板,所述答案模板库中的答案模板与所述调用函数库中的调用函数一一对应;所述处理单元,还用于:The electronic device of claim 17, wherein the database further comprises an answer template library, the answer template library contains at least one answer template, the answer template in the answer template library and the calling function library The calling functions in the one-to-one correspondence; the processing unit is also used for:
    从所述待提问问题中提取所述待提问问题所对应的实体名称和/或所述待提问问题模板所对应的实体属性;Extracting the entity name corresponding to the question to be asked and/or the entity attribute corresponding to the template of the question to be asked from the question to be asked;
    根据所述待提问调用函数和所述待提问问题所对应的实体名称,从所述实体属性库中获取所述待提问问题所对应的实体名称对应的实体属性,或者,根据所述待提问调用函数和所述待提问问题所对应的实体属性,从所述实体属性库中获取所述待提问问题所对应的实体属性对应的实体名称;According to the call function to be asked and the entity name corresponding to the question to be asked, obtain the entity attribute corresponding to the entity name corresponding to the question to be asked from the entity attribute library, or call according to the question to be asked Function and the entity attribute corresponding to the question to be asked, obtaining the entity name corresponding to the entity attribute corresponding to the question to be asked from the entity attribute library;
    根据所述待提问调用函数从所述答案模板库中获取待确定答案模板,所述待确定答案模板为所述答案模板库中与所述待提问调用函数对应的答案模板;Obtaining an answer template to be determined from the answer template library according to the calling function to be asked, where the answer template to be determined is an answer template corresponding to the calling function to be asked in the answer template library;
    基于所述待确定答案模板,将待确定答案关键词生成待确定答案,所述待确定答案关键词为以下任一项:所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体名称和所述待提问问题所对应的实体名称对应的实体属性、所述待提问问题所对应的实体属性、所述待提问问题所对应的实体属性和所述待提问问题所对应的实体属性对应的实体名称。Based on the to-be-determined answer template, the to-be-determined answer keyword is generated to generate a to-be-determined answer, and the to-be-determined answer keyword is any of the following: the entity attribute corresponding to the entity name corresponding to the question The entity name corresponding to the question to be asked and the entity attribute corresponding to the entity name corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, the entity attribute corresponding to the question to be asked, and the question to be asked The entity name corresponding to the corresponding entity attribute.
  19. 如权利要求18所述的电子设备,其特征在于,所述电子设备还包括:The electronic device of claim 18, wherein the electronic device further comprises:
    输入单元,用于接收所述用户针对所述待提问问题的回答;An input unit, configured to receive the user's answer to the question to be asked;
    所述处理单元,还用于:The processing unit is also used for:
    将所述用户针对所述待提问问题的回答与所述待确定答案进行对比分析以得到所述用户的回答是否正确的判断结果;Comparing and analyzing the user's answer to the question to be asked and the answer to be determined to obtain a judgment result of whether the user's answer is correct;
    根据所述判断结果向所述用户做出相应的操作。Make a corresponding operation to the user according to the judgment result.
  20. 如权利要求17-19任一项所述的电子设备,其特征在于,所述待提问调用函数的参数的数量和类型与所述待提问问题模板的槽位的数量和类型的匹配程度最高。20. The electronic device according to any one of claims 17-19, wherein the number and types of parameters of the calling function to be asked have the highest matching degree with the number and types of slots of the question template to be asked.
  21. 如权利要求17-20任一项所述的电子设备,其特征在于,所述问题模板信息为所述转移概率集合时,所述处理单元,在根据所述问题模板信息从所述问题模板库中获取待提问问题模板时,具体用于:The electronic device according to any one of claims 17-20, wherein when the question template information is the set of transition probabilities, the processing unit obtains information from the question template library according to the question template information. When obtaining the template of the question to be asked, it is specifically used for:
    根据预先确定的随机取值从所述转移概率集合中确定目标转移概率;Determining the target transition probability from the transition probability set according to a predetermined random value;
    根据所述目标转移概率从所述问题模板库中获取所述待提问问题模板。Acquire the question template to be asked from the question template library according to the target transition probability.
  22. 如权利要求17-20任一项所述的电子设备,其特征在于,所述问题模板信息为所述问题模板类型时,所述处理单元,在根据所述问题模板信息从所述问题模板库中获取待提问问题模板时,具体用于:The electronic device according to any one of claims 17-20, wherein when the question template information is the question template type, the processing unit obtains information from the question template library according to the question template information. When obtaining the template of the question to be asked, it is specifically used for:
    根据所述用户的年龄以及年龄与问题模板类型的对应关系确定目标问题模板类型;所述对应关系指示用户的年龄与以下至少一个问题模板类型对应:空间、细节、社会、色彩、数字、文字、自然;Determine the target question template type according to the user’s age and the corresponding relationship between the age and the question template type; the corresponding relationship indicates that the user’s age corresponds to at least one of the following question template types: space, detail, society, color, number, text, natural;
    从所述问题模板库中获取符合所述目标问题模板类型的问题模板作为所述待提问问题模板。Obtain a question template that meets the target question template type from the question template library as the question template to be asked.
  23. 如权利要求17-22任一项所述的电子设备,其特征在于,所述处理单元,还用于:The electronic device according to any one of claims 17-22, wherein the processing unit is further configured to:
    根据交互历史信息中包含的实体名称及实体属性,更新所述实体属性库;Update the entity attribute database according to the entity name and entity attribute contained in the interaction history information;
    其中,所述交互历史信息为在所述电子设备阅读所述目标绘本的过程中,所述电子设备接收到所述用户输入的话语信息或者所述用户的动作信息。Wherein, the interaction history information is the speech information input by the user or the action information of the user received by the electronic device in the process of reading the target picture book by the electronic device.
  24. 如权利要求17-23任一项所述的电子设备,其特征在于,所述电子设备还包括:The electronic device according to any one of claims 17-23, wherein the electronic device further comprises:
    摄像头,用于采集所述用户展示的绘本的图像;A camera for collecting images of the picture book displayed by the user;
    所述处理单元,还用于在加载与所述目标绘本相关的数据库之前,通过摄像头采集所述用户展示的绘本的图像;The processing unit is further configured to collect an image of the picture book displayed by the user through a camera before loading the database related to the target picture book;
    通过图像分析技术对采集到的绘本的图像进行分析以确定所述目标绘本。The image of the collected picture book is analyzed by image analysis technology to determine the target picture book.
  25. 一种计算机可读存储介质,其特征在于,包括指令,当所述指令在计算机上运行时,使得所述计算机执行如权利要求1-12中任一项所述的方法。A computer-readable storage medium, characterized by comprising instructions, which when run on a computer, cause the computer to execute the method according to any one of claims 1-12.
PCT/CN2020/086872 2019-04-28 2020-04-24 Picture book-based question and answer interaction method and electronic device WO2020221142A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910349961.6A CN111858861B (en) 2019-04-28 2019-04-28 Question-answer interaction method based on picture book and electronic equipment
CN201910349961.6 2019-04-28

Publications (1)

Publication Number Publication Date
WO2020221142A1 true WO2020221142A1 (en) 2020-11-05

Family

ID=72965813

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/086872 WO2020221142A1 (en) 2019-04-28 2020-04-24 Picture book-based question and answer interaction method and electronic device

Country Status (2)

Country Link
CN (1) CN111858861B (en)
WO (1) WO2020221142A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420125A (en) * 2021-06-25 2021-09-21 深圳索信达数据技术有限公司 Question-answer pair determining method, system, storage medium and equipment based on industry types
CN115292471A (en) * 2022-09-30 2022-11-04 深圳市人马互动科技有限公司 Knowledge product service pushing method for children and related device
CN117876036A (en) * 2024-03-12 2024-04-12 成都信通信息技术有限公司 Method and system for managing on-line questioning and answering point rewards of trade questions

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326367B (en) * 2021-06-30 2023-06-16 四川启睿克科技有限公司 Task type dialogue method and system based on end-to-end text generation
CN116009748B (en) * 2023-03-28 2023-06-06 深圳市人马互动科技有限公司 Picture information interaction method and device in children interaction story
CN117194792B (en) * 2023-09-18 2024-03-01 广州道然信息科技有限公司 Child drawing recommendation method and system based on role prediction

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010056868A1 (en) * 2008-11-12 2010-05-20 Scti Holdings, Inc. System and method for automatic speach to text conversion
CN105701253A (en) * 2016-03-04 2016-06-22 南京大学 Chinese natural language interrogative sentence semantization knowledge base automatic question-answering method
CN107885844A (en) * 2017-11-10 2018-04-06 南京大学 Automatic question-answering method and system based on systematic searching
CN107958091A (en) * 2017-12-28 2018-04-24 北京贝塔智投科技有限公司 A kind of NLP artificial intelligence approaches and interactive system based on financial vertical knowledge mapping
CN109657041A (en) * 2018-12-04 2019-04-19 南京理工大学 The problem of based on deep learning automatic generation method

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3638145B2 (en) * 2001-09-28 2005-04-13 伊吉子 斉藤 Hole filling problem creating apparatus, computer program for filling hole filling problem, and recording medium recording the program
CN1794233A (en) * 2005-12-28 2006-06-28 刘文印 Network user interactive asking answering method and its system
CN104850539B (en) * 2015-05-28 2017-08-25 宁波薄言信息技术有限公司 A kind of natural language understanding method and the tourism question answering system based on this method
US10262062B2 (en) * 2015-12-21 2019-04-16 Adobe Inc. Natural language system question classifier, semantic representations, and logical form templates
CN107766511A (en) * 2017-10-23 2018-03-06 深圳市前海众兴电子商务有限公司 Intelligent answer method, terminal and storage medium
CN108509136A (en) * 2018-04-12 2018-09-07 山东音为爱智能科技有限公司 A kind of children based on artificial intelligence paint this aid reading method
CN109492077B (en) * 2018-09-29 2020-09-29 北京智通云联科技有限公司 Knowledge graph-based petrochemical field question-answering method and system
CN109522835A (en) * 2018-11-13 2019-03-26 北京光年无限科技有限公司 Children's book based on intelligent robot is read and exchange method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010056868A1 (en) * 2008-11-12 2010-05-20 Scti Holdings, Inc. System and method for automatic speach to text conversion
CN105701253A (en) * 2016-03-04 2016-06-22 南京大学 Chinese natural language interrogative sentence semantization knowledge base automatic question-answering method
CN107885844A (en) * 2017-11-10 2018-04-06 南京大学 Automatic question-answering method and system based on systematic searching
CN107958091A (en) * 2017-12-28 2018-04-24 北京贝塔智投科技有限公司 A kind of NLP artificial intelligence approaches and interactive system based on financial vertical knowledge mapping
CN109657041A (en) * 2018-12-04 2019-04-19 南京理工大学 The problem of based on deep learning automatic generation method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420125A (en) * 2021-06-25 2021-09-21 深圳索信达数据技术有限公司 Question-answer pair determining method, system, storage medium and equipment based on industry types
CN113420125B (en) * 2021-06-25 2023-09-19 深圳索信达数据技术有限公司 Question-answer pair determining method, system, storage medium and equipment based on industry type
CN115292471A (en) * 2022-09-30 2022-11-04 深圳市人马互动科技有限公司 Knowledge product service pushing method for children and related device
CN115292471B (en) * 2022-09-30 2022-12-20 深圳市人马互动科技有限公司 Knowledge product service pushing method for children and related device
CN117876036A (en) * 2024-03-12 2024-04-12 成都信通信息技术有限公司 Method and system for managing on-line questioning and answering point rewards of trade questions
CN117876036B (en) * 2024-03-12 2024-05-07 成都信通信息技术有限公司 Method and system for managing on-line questioning and answering point rewards of trade questions

Also Published As

Publication number Publication date
CN111858861B (en) 2022-07-19
CN111858861A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2020221142A1 (en) Picture book-based question and answer interaction method and electronic device
US11379529B2 (en) Composing rich content messages
WO2021139701A1 (en) Application recommendation method and apparatus, storage medium and electronic device
US10909441B2 (en) Modeling an action completion conversation using a knowledge graph
US11157490B2 (en) Conversational virtual assistant
JP2022040183A (en) Selection of synthetic speech for agent by computer
US9305050B2 (en) Aggregator, filter and delivery system for online context dependent interaction, systems and methods
CN111553162B (en) Intention recognition method and related device
TWI684148B (en) Grouping processing method and device of contact person
US20190012373A1 (en) Conversational/multi-turn question understanding using web intelligence
CN109729627A (en) System and method for controlling intelligent lamp
US10853716B2 (en) Systems and methods for a mathematical chat bot
CN112703494A (en) Electronic device and method of controlling the same
CN111565143B (en) Instant messaging method, equipment and computer readable storage medium
CN107490971A (en) Intelligent automation assistant in home environment
KR20180124310A (en) Modular Robot System for Coding Education Using Artificial Intelligence
CN110209778A (en) A kind of method and relevant apparatus of dialogue generation
CN114328852A (en) Text processing method, related device and equipment
CN111515970B (en) Interaction method, mimicry robot and related device
CN112214605A (en) Text classification method and related device
KR20230144505A (en) Data generation method based on deep learning model, and training method and apparatus
CN112232066A (en) Teaching outline generation method and device, storage medium and electronic equipment
WO2021147421A1 (en) Automatic question answering method and apparatus for man-machine interaction, and intelligent device
US20200257954A1 (en) Techniques for generating digital personas
CN111553163A (en) Text relevance determining method and device, storage medium and electronic equipment

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: 20798698

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: 20798698

Country of ref document: EP

Kind code of ref document: A1