CN117095677A - Semantic understanding template generation method and device, storage medium and electronic device - Google Patents

Semantic understanding template generation method and device, storage medium and electronic device Download PDF

Info

Publication number
CN117095677A
CN117095677A CN202310640899.2A CN202310640899A CN117095677A CN 117095677 A CN117095677 A CN 117095677A CN 202310640899 A CN202310640899 A CN 202310640899A CN 117095677 A CN117095677 A CN 117095677A
Authority
CN
China
Prior art keywords
data
service
business
interaction
semantic understanding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310640899.2A
Other languages
Chinese (zh)
Inventor
马志芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310640899.2A priority Critical patent/CN117095677A/en
Publication of CN117095677A publication Critical patent/CN117095677A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/08Speech classification or search
    • G10L15/18Speech classification or search using natural language modelling
    • G10L15/1822Parsing for meaning understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a method and a device for generating a semantic understanding template, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the method for generating the semantic understanding template comprises the following steps: pre-collecting voice interaction data to obtain service data; grouping the service data according to the service source of the service data to obtain a plurality of groups of target data; the method comprises the steps of determining the preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to carry out semantic processing on received voice interaction data based on the semantic understanding templates.

Description

Semantic understanding template generation method and device, storage medium and electronic device
Technical Field
The application relates to the technical field of smart families, in particular to a method and a device for generating a semantic understanding template, a storage medium and an electronic device.
Background
At present, more and more intelligent devices start to be equipped with a voice interaction function, and the interaction intention of a user is determined by analyzing key words of voice data of the user, for example, the user data such as "what the weather of Beijing tomorrow is" what the key words are "Beijing" can be determined as the place and time "tomorrow" is "what the user wants to know" the weather of Beijing tomorrow ", and then the interaction intention of the user is" weather checking "is obtained by using a data template. However, the data templates used by the method are often written manually, which is time-consuming and labor-consuming, and has low writing efficiency and low efficiency.
Therefore, in the related art, there is a technical problem how to solve the problem that the generation efficiency of the semantic understanding template is low.
Aiming at the technical problem of low generation efficiency of semantic understanding templates in the related art, no effective solution has been proposed yet.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a semantic understanding template, a storage medium and an electronic device, which are used for at least solving the technical problem of low generation efficiency of the semantic understanding template in the related technology.
According to an embodiment of the present application, there is provided a method for generating a semantic understanding template, including: pre-collecting voice interaction data to obtain service data; grouping the service data according to the service source of the service data to obtain a plurality of groups of target data; and determining a preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to perform semantic processing on the received voice interaction data based on the semantic understanding template.
In an exemplary embodiment, classifying the service data according to a service source of the service data to obtain multiple sets of target data includes: determining whether the service type of the service data belongs to a preset service type; acquiring a plurality of service sources corresponding to the service data under the condition that the service type of the service data belongs to the preset service type; and classifying the service data according to the multiple service sources to obtain multiple groups of target data.
In an exemplary embodiment, obtaining multiple service sources corresponding to the service data includes: acquiring a data identifier carried by the service data, wherein the data identifier corresponds to different service sources of the service data; under the condition that the data identifier indicates that the service data is service time, determining that a service source of the service data is service execution time; determining a service source of the service data as a service execution location under the condition that the data identifier indicates the service data as a service location; and under the condition that the data identifier indicates that the service data is a service environment, determining that a service source of the service data is a service execution environment.
In an exemplary embodiment, classifying the service data according to the multiple service sources to obtain multiple sets of target data includes: aiming at first-type service data belonging to any one of the multiple service sources, acquiring multiple service interaction sentences in the first-type service data; determining a first business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same first business entity word as first business data, and obtaining a plurality of groups of first business data corresponding to the first type of business data; acquiring a plurality of business interaction sentences in second-class business data aiming at second-class business data belonging to other business sources, wherein the other business sources represent business sources except any business source in the plurality of business sources; determining a second business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same second business entity word as second business data, and obtaining a plurality of groups of second business data corresponding to the first type of business data; and determining the plurality of sets of target data according to the plurality of sets of first service data and the plurality of sets of second service data.
In an exemplary embodiment, before setting the business interaction statement having the same first business entity word as the first business data, the method further comprises: acquiring a character string corresponding to any one of a plurality of business interaction sentences in the first type of business data, wherein elements in the character string are used for indicating fields in any one business interaction sentence; determining the first times of any field of the character string in a plurality of business interaction sentences in the first type of business data; determining a group of interactive sentences with any field under the condition that the first time number of the any field in a plurality of business interactive sentences in the first type of business data is larger than a preset number of times, wherein the preset number of times is not larger than the number of the plurality of business interactive sentences in the first type of business data; and determining business interaction sentences with the same first business entity words from the group of interaction sentences.
In an exemplary embodiment, generating the semantic understanding template corresponding to each set of target data according to the preset vocabulary includes: acquiring a group of interaction information with association relation with the preset vocabulary from a preset interaction database; determining the second times of occurrence of each interaction information in the group of interaction information in the preset interaction database; and determining the interaction information with the highest second times in the group of interaction information as target interaction information, and generating the semantic understanding template according to the target interaction information.
In an exemplary embodiment, generating the semantic understanding template according to the target interaction information includes: determining entity words in the target interaction information; acquiring an entity word label corresponding to the entity word from an entity word library; and replacing the entity word in the target interaction information by using the entity word label to generate the semantic understanding template.
According to another embodiment of the present application, there is also provided a device for generating a semantic understanding template, including: the acquisition module is used for pre-collecting the voice interaction data to obtain service data; the grouping module is used for grouping the service data according to the service source of the service data to obtain a plurality of groups of target data; the generation module is used for determining preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to carry out semantic processing on the received voice interaction data based on the semantic understanding template.
According to a further aspect of embodiments of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described method of generating a semantic understanding template at run-time.
According to still another aspect of the embodiment of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the method for generating the semantic understanding template through the computer program.
In the embodiment of the application, voice interaction data are pre-collected to obtain service data; grouping the service data according to the service source of the service data to obtain a plurality of groups of target data; determining a preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to perform semantic processing on the received voice interaction data based on the semantic understanding template; by adopting the technical scheme, the technical problem of low generation efficiency of the semantic understanding template is solved, and the generation efficiency of the semantic understanding template is further improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of a method for generating a semantic understanding template according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of generating a semantic understanding template according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a method of generating a semantic understanding template according to an embodiment of the present application;
FIG. 4 is a block diagram (I) of a semantic understanding template generating apparatus according to an embodiment of the present application;
fig. 5 is a block diagram (two) of a semantic understanding template generating apparatus according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of an embodiment of the present application, there is provided a method for generating a semantic understanding template. The generation method of the semantic understanding template is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described method for generating the semantic understanding template may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a method for generating a semantic understanding template is provided and applied to the terminal device, and fig. 2 is a flowchart of a method for generating a semantic understanding template according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, pre-collecting voice interaction data to obtain service data;
optionally, the pre-collected voice interaction data may be from voice data uploaded by the voice device or from background operation data, but is not limited thereto.
The pre-collecting of the voice interaction data may be understood as collecting the voice interaction data when the target object performs voice interaction with the intelligent device.
Step S204, grouping the service data according to the service source of the service data to obtain a plurality of groups of target data;
it should be noted that, the data similarity between each set of target data of the plurality of sets of target data is greater than a preset threshold. The data similarity may be understood as a quotient of the number of the same fields between any two sets of target data and the number of all fields contained in any two sets of target data, where the number of all fields contained in any two sets of target data is consistent.
Step S206, determining a preset vocabulary of each set of target data of the plurality of sets of target data, and generating a semantic understanding template corresponding to each set of target data according to the preset vocabulary so as to perform semantic processing on the received voice interaction data based on the semantic understanding template.
Through the steps, voice interaction data are pre-collected, and business data are obtained; grouping the service data according to the service source of the service data to obtain a plurality of groups of target data; the method comprises the steps of determining preset vocabulary of each group of target data of multiple groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to carry out semantic processing on received voice interaction data based on the semantic understanding templates, so that the technical problem of low generation efficiency of the semantic understanding templates in the related technology is solved, and the generation efficiency of the semantic understanding templates is further improved.
In an exemplary embodiment, for the process of classifying the service data according to the service source of the service data to obtain multiple sets of target data in the step S204, the following implementation steps are provided: step S11, determining whether the service type of the service data belongs to a preset service type; step S12, under the condition that the service type of the service data belongs to the preset service type, acquiring a plurality of service sources corresponding to the service data; and step S13, classifying the service data according to the multiple service sources to obtain multiple groups of target data.
In an exemplary embodiment, the method specifically may obtain multiple service sources corresponding to the service data through the following technical scheme, including the following steps: acquiring a data identifier carried by the service data, wherein the data identifier corresponds to different service sources of the service data; under the condition that the data identifier indicates that the service data is service time, determining that a service source of the service data is service execution time; determining a service source of the service data as a service execution location under the condition that the data identifier indicates the service data as a service location; and under the condition that the data identifier indicates that the service data is a service environment, determining that a service source of the service data is a service execution environment.
For the service data whose service source is the service execution time, for example, "air conditioner is turned on today". The service source may be service data of a service execution place, for example, "kitchen hood is opened". The service data whose service source is the service execution environment may be, for example, "monitoring the outdoor operating temperature of the outdoor air conditioner".
In an exemplary embodiment, further, a technical solution for classifying the service data according to the multiple service sources to obtain multiple sets of target data is further provided, and the specific steps include: step S21, a plurality of business interaction sentences in the first type of business data are acquired aiming at the first type of business data belonging to any one of the plurality of business sources; step S2, determining a first business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same first business entity word as first business data, and obtaining a plurality of groups of first business data corresponding to the first type of business data; step S23, a plurality of business interaction sentences in the second type of business data are acquired aiming at the second type of business data belonging to other business sources, wherein the other business sources represent business sources except any business source in the plurality of business sources; step S24, determining a second business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same second business entity word as second business data, and obtaining a plurality of groups of second business data corresponding to the first type of business data; step S25, determining the multiple sets of target data according to the multiple sets of first service data and the multiple sets of second service data.
Further, in an embodiment, a character string corresponding to any one of a plurality of service interaction sentences in the second class of service data may be further obtained, where an element in the character string is used to indicate a field in the any one service interaction sentence; determining the second times of occurrence of any field of the character string in a plurality of business interaction sentences in the second type of business data; determining a group of interactive sentences with any field under the condition that the second times of the any field in the plurality of business interactive sentences in the second type of business data is larger than the preset times, wherein the preset times are not larger than the number of the plurality of business interactive sentences in the second type of business data; and determining the business interaction sentences with the same second business entity words from the group of interaction sentences.
In an exemplary embodiment, before setting the business interaction sentence with the same first business entity word as the first business data, further, the business interaction sentence with the same first business entity word may be determined by: acquiring a character string corresponding to any one of a plurality of business interaction sentences in the first type of business data, wherein elements in the character string are used for indicating fields in any one business interaction sentence; determining the first times of any field of the character string in a plurality of business interaction sentences in the first type of business data; determining a group of interactive sentences with any field under the condition that the first time number of the any field in a plurality of business interactive sentences in the first type of business data is larger than a preset number of times, wherein the preset number of times is not larger than the number of the plurality of business interactive sentences in the first type of business data; and determining business interaction sentences with the same first business entity words from the group of interaction sentences.
In an exemplary embodiment, in order to better understand how to generate the semantic understanding templates corresponding to each set of target data according to the preset vocabulary in the step S206, the following technical solutions are provided: acquiring a group of interaction information with association relation with the preset vocabulary from a preset interaction database; determining the second times of occurrence of each interaction information in the group of interaction information in the preset interaction database; and determining the interaction information with the highest second times in the group of interaction information as target interaction information, and generating the semantic understanding template according to the target interaction information.
The above-mentioned association relation may be preset manually or determined by an association mining model, which is not limited in the present application. Through the embodiment, the generalization of the preset vocabulary to a group of interaction information can be realized, so that the target interaction information for generating the semantic understanding template is provided.
In an exemplary embodiment, further, for the process of generating the semantic understanding template according to the target interaction information, the method specifically includes the following implementation steps: step S31, determining entity words in the target interaction information; step S32, obtaining entity word labels corresponding to the entity words from an entity word lexicon; and step S33, replacing the entity words in the target interaction information by using the entity word labels to generate the semantic understanding template.
In order to better understand the process of the method for generating the semantic understanding template, the following describes the flow of the implementation method for generating the semantic understanding template in combination with the alternative embodiment, but is not used for limiting the technical scheme of the embodiment of the application.
In this embodiment, a method for generating a semantic understanding template is provided, and fig. 3 is a schematic diagram of a method for generating a semantic understanding template according to an embodiment of the present application, as shown in fig. 3, specifically includes the following steps:
step S301: and collecting interaction data when the user performs service interaction with the intelligent equipment to obtain service data, wherein the collection process can be automatically capturing a history record by a program or manually collecting the history record, and the application is not limited to the process.
The business data may include, for example, weather business data (i.e., the business environment described above), time business data (i.e., the business time described above), calendar business data (i.e., the business time described above), and the like, but is not limited thereto.
Taking service time as service data as an example, the collected service data is, for example:
m1: the number of the tomorrow is counted;
m2: today's numbers;
mi: now, i is a positive integer.
Step S302: and grouping each group of business data mi by adopting a similarity algorithm, and grouping similar data together so as to generate a semantic understanding template conveniently.
Taking time service data as an example, grouping according to the similarity, and since the same field 'number' (which can be understood as the service entity word) is contained between m1 and m2, the 'tomorrow number' can be obtained; the two sets of data are now numbered "and" now numbered ".
Step S303: the core words (namely the entity words) contained in the time service data are grouped again according to the arrangement sequence of the core words. For example, for "tomorrow's day number; the number of the users is today, and the users can be adjusted to the number of the users according to the time sequence; the "tomorrow number" and "the present number" remain unchanged.
Step S304: and replacing the core words by using labels corresponding to the core words, and generating a semantic understanding template.
For example, a semantic understanding template is generated based on "today's several numbers": { date } (i.e., the entity word tag described above) { number };
generating a semantic understanding template based on the "tomorrow number": { date } { number };
generating a semantic understanding template based on "now several points": { date } { several points }.
Step S305: the user calculates quality scores for a plurality of semantic understanding templates using the objective function and selects a semantic understanding template having a largest quality score from the plurality of semantic understanding templates.
The objective function may be, for example, l=a·fit (t i )+b·gen(t i )-c·len(t i );
t i Representing the ith semantic understanding template, fit (t i ) Representing the fitness of the ith semantic understanding template, gen (t i ) Representing the generalization degree of the ith semantic understanding template, len (t i ) The length of the ith semantic understanding template is represented, a is a first weight corresponding to the applicability of the ith business data template, b is a second weight corresponding to the generalization degree of the ith semantic understanding template, c is a third weight corresponding to the length of the ith semantic understanding template, and i, a, b and c are all positive integers.
Wherein for any t i If any t exists in the voice interaction data i Determining a first amount of the first set of voice interaction data having the template field and determining a quotient of the first amount and a second amount of the plurality of sets of voice interaction data as any t i Is suitable for the application of the system.
Acquiring any t from multiple groups of voice interaction data i A third quantity of the second group of voice interaction data is obtained according to the second group of voice interaction data corresponding to the label type of the template label; determining the quotient of the third quantity and the second quantity of the plurality of groups of voice interaction data as any one t i Is a generalization of (1).
The sum of the number of tags of each semantic understanding template and the number of characters of each semantic understanding template is determined as the length of each semantic understanding template.
Through the scheme, the automatic generation of the semantic understanding template can be realized, the manual writing workload is reduced, and the generation efficiency of the semantic understanding template is improved.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present application.
FIG. 4 is a block diagram (I) of a semantic understanding template generating apparatus according to an embodiment of the present application; as shown in fig. 4, includes:
the collection module 42 is configured to pre-collect voice interaction data to obtain service data;
a grouping module 44, configured to group the service data according to a service source of the service data, so as to obtain multiple groups of target data;
it should be noted that, the data similarity between each set of target data of the plurality of sets of target data is greater than a preset threshold. The data similarity may be understood as a quotient of the number of the same fields between any two sets of target data and the number of all fields contained in any two sets of target data, where the number of all fields contained in any two sets of target data is consistent.
The generating module 46 is configured to determine a preset vocabulary of each set of target data of the plurality of sets of target data, and generate a semantic understanding template corresponding to each set of target data according to the preset vocabulary, where the data template is used to determine an interaction instruction of the target object.
By the device, voice interaction data are pre-collected to obtain service data; grouping the service data according to the service source of the service data to obtain a plurality of groups of target data; the method comprises the steps of determining preset vocabulary of each group of target data of multiple groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to carry out semantic processing on received voice interaction data based on the semantic understanding templates, so that the technical problem of low generation efficiency of the semantic understanding templates in the related technology is solved, and the generation efficiency of the semantic understanding templates is further improved.
In an exemplary embodiment, the grouping module 44 is further configured to perform the following implementation steps: step S11, determining whether the service type of the service data belongs to a preset service type; step S12, under the condition that the service type of the service data belongs to the preset service type, acquiring a plurality of service sources corresponding to the service data; and step S13, classifying the service data according to the multiple service sources to obtain multiple groups of target data.
In an exemplary embodiment, the grouping module 44 further includes an obtaining unit, configured to obtain a data identifier carried by the service data, where the data identifier corresponds to different service sources of the service data; under the condition that the data identifier indicates that the service data is service time, determining that a service source of the service data is service execution time; determining a service source of the service data as a service execution location under the condition that the data identifier indicates the service data as a service location; and under the condition that the data identifier indicates that the service data is a service environment, determining that a service source of the service data is a service execution environment.
For the service data whose service source is the service execution time, for example, "air conditioner is turned on today". The service source may be service data of a service execution place, for example, "kitchen hood is opened". The service data whose service source is the service execution environment may be, for example, "monitoring the outdoor operating temperature of the outdoor air conditioner".
In an exemplary embodiment, further, the grouping module 44 further includes an obtaining unit configured to perform the following steps: step S21, a plurality of business interaction sentences in the first type of business data are acquired aiming at the first type of business data belonging to any one of the plurality of business sources; step S2, determining a first business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same first business entity word as first business data, and obtaining a plurality of groups of first business data corresponding to the first type of business data; step S23, a plurality of business interaction sentences in the second type of business data are acquired aiming at the second type of business data belonging to other business sources, wherein the other business sources represent business sources except any business source in the plurality of business sources; step S24, determining a second business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same second business entity word as second business data, and obtaining a plurality of groups of second business data corresponding to the first type of business data; step S25, determining the multiple sets of target data according to the multiple sets of first service data and the multiple sets of second service data.
In an exemplary embodiment, before setting the business interaction sentence with the same first business entity word as the first business data, the obtaining unit is further configured to determine the business interaction sentence with the same first business entity word by: acquiring a character string corresponding to any one of a plurality of business interaction sentences in the first type of business data, wherein elements in the character string are used for indicating fields in any one business interaction sentence; determining the first times of any field of the character string in a plurality of business interaction sentences in the first type of business data; determining a group of interactive sentences with any field under the condition that the first time number of the any field in a plurality of business interactive sentences in the first type of business data is larger than a preset number of times, wherein the preset number of times is not larger than the number of the plurality of business interactive sentences in the first type of business data; and determining business interaction sentences with the same first business entity words from the group of interaction sentences.
Further, in an embodiment, the obtaining unit is further configured to obtain a character string corresponding to any one of a plurality of service interaction sentences in the second class service data, where an element in the character string is used to indicate a field in the any one service interaction sentence; determining the second times of occurrence of any field of the character string in a plurality of business interaction sentences in the second type of business data; determining a group of interactive sentences with any field under the condition that the second times of the any field in the plurality of business interactive sentences in the second type of business data is larger than the preset times, wherein the preset times are not larger than the number of the plurality of business interactive sentences in the second type of business data; and determining the business interaction sentences with the same second business entity words from the group of interaction sentences.
In an exemplary embodiment, the generating module 46 is further configured to obtain a set of interaction information having an association relationship with the preset vocabulary from a preset interaction database; determining the second times of occurrence of each interaction information in the group of interaction information in the preset interaction database; and determining the interaction information with the highest second times in the group of interaction information as target interaction information, and generating the semantic understanding template according to the target interaction information.
FIG. 5 is a block diagram (II) of a semantic understanding template generating apparatus according to an embodiment of the present application; as shown in fig. 5, in an exemplary embodiment, the generating module 46 further includes a generating unit 52, configured to implement the following steps:
step S31, determining entity words in the target interaction information; step S32, obtaining entity word labels corresponding to the entity words from an entity word lexicon; and step S33, replacing the entity words in the target interaction information by using the entity word labels to generate the semantic understanding template.
An embodiment of the present application also provides a storage medium including a stored program, wherein the program executes the method of any one of the above.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, pre-collecting voice interaction data to obtain service data;
s2, grouping the service data according to the service source of the service data to obtain a plurality of groups of target data;
s3, determining preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to perform semantic processing on the received voice interaction data based on the semantic understanding template.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, pre-collecting voice interaction data to obtain service data;
s2, grouping the service data according to the service source of the service data to obtain a plurality of groups of target data;
s3, determining preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to perform semantic processing on the received voice interaction data based on the semantic understanding template.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for generating a semantic understanding template, comprising:
pre-collecting voice interaction data to obtain service data;
grouping the service data according to the service source of the service data to obtain a plurality of groups of target data;
and determining a preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to perform semantic processing on the received voice interaction data based on the semantic understanding template.
2. The method for generating a semantic understanding template according to claim 1, wherein classifying the service data according to a service source of the service data to obtain a plurality of sets of target data comprises:
determining whether the service type of the service data belongs to a preset service type;
acquiring a plurality of service sources corresponding to the service data under the condition that the service type of the service data belongs to the preset service type;
and classifying the service data according to the multiple service sources to obtain multiple groups of target data.
3. The method for generating a semantic understanding template according to claim 2, wherein obtaining a plurality of service sources corresponding to the service data comprises:
acquiring a data identifier carried by the service data, wherein the data identifier corresponds to different service sources of the service data;
under the condition that the data identifier indicates that the service data is service time, determining that a service source of the service data is service execution time;
determining a service source of the service data as a service execution location under the condition that the data identifier indicates the service data as a service location;
and under the condition that the data identifier indicates that the service data is a service environment, determining that a service source of the service data is a service execution environment.
4. The method for generating a semantic understanding template according to claim 2, wherein classifying the service data according to the plurality of service sources to obtain a plurality of sets of target data comprises:
aiming at first-type service data belonging to any one of the multiple service sources, acquiring multiple service interaction sentences in the first-type service data;
determining a first business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same first business entity word as first business data, and obtaining a plurality of groups of first business data corresponding to the first type of business data;
acquiring a plurality of business interaction sentences in second-class business data aiming at second-class business data belonging to other business sources, wherein the other business sources represent business sources except any business source in the plurality of business sources;
determining a second business entity word of each business interaction sentence in the plurality of business interaction sentences, setting the business interaction sentences with the same second business entity word as second business data, and obtaining a plurality of groups of second business data corresponding to the first type of business data;
and determining the plurality of sets of target data according to the plurality of sets of first service data and the plurality of sets of second service data.
5. The method for generating a semantic understanding template according to claim 4, wherein before setting a business interaction sentence having the same first business entity word as the first business data, the method further comprises: acquiring a character string corresponding to any one of a plurality of business interaction sentences in the first type of business data, wherein elements in the character string are used for indicating fields in any one business interaction sentence;
determining the first times of any field of the character string in a plurality of business interaction sentences in the first type of business data;
determining a group of interactive sentences with any field under the condition that the first time number of the any field in a plurality of business interactive sentences in the first type of business data is larger than a preset number of times, wherein the preset number of times is not larger than the number of the plurality of business interactive sentences in the first type of business data;
and determining business interaction sentences with the same first business entity words from the group of interaction sentences.
6. The method for generating a semantic understanding template according to claim 1, wherein generating the semantic understanding template corresponding to each set of target data according to the preset vocabulary comprises:
acquiring a group of interaction information with association relation with the preset vocabulary from a preset interaction database; determining the second times of occurrence of each interaction information in the group of interaction information in the preset interaction database;
and determining the interaction information with the highest second times in the group of interaction information as target interaction information, and generating the semantic understanding template according to the target interaction information.
7. The method for generating a semantic understanding template according to claim 6, wherein generating the semantic understanding template according to the target interaction information comprises:
determining entity words in the target interaction information;
acquiring an entity word label corresponding to the entity word from an entity word library;
and replacing the entity word in the target interaction information by using the entity word label to generate the semantic understanding template.
8. A semantic understanding template generating apparatus, comprising:
the acquisition module is used for pre-collecting the voice interaction data to obtain service data;
the grouping module is used for grouping the service data according to the service source of the service data to obtain a plurality of groups of target data;
the generation module is used for determining preset vocabulary of each group of target data of the plurality of groups of target data, and generating a semantic understanding template corresponding to each group of target data according to the preset vocabulary so as to carry out semantic processing on the received voice interaction data based on the semantic understanding template.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202310640899.2A 2023-05-31 2023-05-31 Semantic understanding template generation method and device, storage medium and electronic device Pending CN117095677A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310640899.2A CN117095677A (en) 2023-05-31 2023-05-31 Semantic understanding template generation method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310640899.2A CN117095677A (en) 2023-05-31 2023-05-31 Semantic understanding template generation method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117095677A true CN117095677A (en) 2023-11-21

Family

ID=88778431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310640899.2A Pending CN117095677A (en) 2023-05-31 2023-05-31 Semantic understanding template generation method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117095677A (en)

Similar Documents

Publication Publication Date Title
US7539934B2 (en) Computer-implemented method, system, and program product for developing a content annotation lexicon
CN108804299A (en) Application exception processing method and processing device
CN112311612B (en) Information construction method and device and storage medium
CN112712902B (en) Infectious disease infection probability prediction method and device, storage medium, and electronic device
JP3737714B2 (en) Method and apparatus for identifying end-user transactions
CN109684320B (en) Method and equipment for online cleaning of monitoring data
CN109978624A (en) Information processing method, electronic equipment and computer readable storage medium
CN115358395A (en) Knowledge graph updating method and device, storage medium and electronic device
CN113194155A (en) Method and device for intelligently recommending scenes in Internet of things
CN111538881B (en) Activity analysis method, equipment and storage medium based on behavior data
CN116881752A (en) Data clustering method and device, storage medium and electronic equipment
CN117095677A (en) Semantic understanding template generation method and device, storage medium and electronic device
CN114915514B (en) Method and device for processing intention, storage medium and electronic device
CN116540556A (en) Equipment control method and device based on user habit
CN114861678A (en) Method and apparatus for determining time information, storage medium, and electronic apparatus
CN111383032B (en) Method and device for detecting authenticity of house source information
CN111382343B (en) Label system generation method and device
CN116682422A (en) Method and device for determining semantic understanding template, storage medium and electronic device
CN116540998A (en) Statistical data determining method and device, storage medium and electronic device
CN114818709A (en) Method and device for acquiring field names of data table, storage medium and electronic device
CN117749548A (en) Method and device for controlling initiation of interactive service, storage medium and electronic device
CN116521164A (en) Layout method and device of function entrance, storage medium and electronic device
CN115269926A (en) Family map determination method and device, storage medium and electronic device
CN116932846A (en) Method and device for determining data asset, storage medium and electronic device
CN117725995A (en) Knowledge graph construction method, device and medium based on large model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination