Summary of the invention
In view of this, the embodiment of the present application provides a kind of method and device that problem of implementation generates, to solve the prior art
The middle technical problem to user's recommendation inaccuracy.
To solve the above problems, technical solution provided by the embodiments of the present application is as follows:
A kind of method that problem of implementation generates, which comprises
Obtain the text string of input;
Identify the corresponding intention classification of the text string;
Obtain the corresponding slot position information for being intended to classification and including of the text string;
Finding from the slot position information that the intention classification includes with the text string includes segmenting the target to match
Slot position information, and the corresponding slot position value of the target slot position information is obtained from the text string;
According to the target slot position information and the corresponding slot position value of the target slot position information, question text is generated.
In one possible implementation, before the corresponding intention classification of the identification text string, the side
Method further include:
Determine that the text string meets preset condition.
In one possible implementation, the determination text string meets preset condition, comprising:
Determine that the byte number that the text string includes reaches default value, and/or, determine that the text string includes to put question to meaning
Figure.
In one possible implementation, the method also includes:
The problem of correlation for calculating described problem text and the text string is more than preset threshold to correlation text
Originally it is shown.
In one possible implementation, the method also includes:
In response to the answer retrieval request to described problem text, the answer text of described problem text is obtained.
In one possible implementation, it is described from it is described intention classification include slot position information in find with it is described
Text string includes the target slot position information that matches of participle, and it is corresponding to obtain from the text string target slot position information
Slot position value, comprising:
The text string is segmented, for each participle, executes following step respectively:
When existing in the slot position information that the intention classification includes with the slot position information for segmenting and matching, institute is extracted
Slot position information is stated as target slot position information, and by the participle as the corresponding slot position value of the target slot position information.
In one possible implementation, described according to the target slot position information and the target slot position information pair
The slot position value answered generates question text, comprising:
Obtain template the problem of including the target slot position information;
It is filled into the target slot position information corresponding slot position value in described problem template, generates question text.
In one possible implementation, the corresponding intention classification of the identification text string, comprising:
By text string input text intent classifier model trained in advance, the corresponding intention class of the text string is obtained
Not.
A kind of device that problem of implementation generates, described device include:
First acquisition unit, for obtaining the text string of input;
Recognition unit, for identification corresponding intention classification of the text string;
Second acquisition unit, for obtaining the corresponding slot position information for being intended to classification and including of the text string;
Searching unit includes participle for finding from the slot position information that the intention classification includes with the text string
The target slot position information to match, and the corresponding slot position value of the target slot position information is obtained from the text string;
Generation unit, for according to the target slot position information and the corresponding slot position value of the target slot position information, life
Problematic text.
In one possible implementation, described device further include:
Determination unit, if the text string meets preset condition, is held for determining that the text string meets preset condition
Row first recognition unit and subsequent step.
In one possible implementation, the determination unit is specifically used for the byte number for determining that the text string includes
Reach predetermined word joint number, and/or, determine that the text string includes to put question to be intended to.
In one possible implementation, described device further include:
Computing unit, for calculating the correlation of described problem text with the text string;
Display unit, for the correlation be more than preset threshold the problem of text be shown.
In one possible implementation, described device further include:
Retrieval unit, for obtaining answering for described problem text in response to the answer retrieval request to described problem text
Case text.
In one possible implementation, the searching unit, specifically for being segmented to the text string;For
Each participle is extracted when existing in the slot position information that the intention classification includes with the slot position information for segmenting and matching
The slot position information is used as the corresponding slot position value of the target slot position information as target slot position information, and by the participle.
In one possible implementation, the generation unit, including
Subelement is obtained, is used to obtain template the problem of including the target slot position information;
Subelement is generated, for being filled into the slot position value of the target slot position information in described problem template, generation is asked
Inscribe text.
In one possible implementation, first recognition unit is specifically used for inputting the text string preparatory
Trained text intent classifier model obtains the corresponding intention classification of the text string.
A kind of device generated for realizing problem, includes memory and one or more than one program,
In one perhaps more than one program be stored in memory and be configured to execute institute by one or more than one processor
It states one or more than one program includes the instruction for performing the following operation:
Obtain the text string of input;
Identify the corresponding intention classification of the text string;
Obtain the corresponding slot position information for being intended to classification and including of the text string;
Finding from the slot position information that the intention classification includes with the text string includes segmenting the target to match
Slot position information, and the corresponding slot position value of the target slot position information is obtained from the text string;
According to the slot position value for the slot position information for including in the text string, question text is generated.
A kind of computer-readable medium is stored thereon with instruction, when executed by one or more processors, so that device
Execute the method that above-mentioned problem of implementation generates.
It can be seen that the embodiment of the present application has the following beneficial effects:
The embodiment of the present application obtains the text string of user's input first, and identifies the corresponding intention classification of text string.When
When identifying the corresponding intention classification of text, slot position information included by the intention classification is obtained.Then, then from be intended to classification packet
Being found in the slot position information included with text string includes that the target slot position information that matches of participle and target slot position information are corresponding
Slot position value.Finally, generating question text according to target slot position information and the corresponding slot position value of target slot position information.As it can be seen that
The embodiment of the present application identifies that user inputs the intention class of text string before carrying out content search according to the input of user first
Not, further according to be intended to classification from extracted in text string under the intention classification it is preset needed for key message (i.e. slot position information)
Specific value (i.e. slot position value), to generate question text according to these fine-grained information, so as to user's showing problem
Text carries out the search of related content according to question text, recommends, and content recommended to the user is made to be more in line with user's
It is intended to, improves the user experience.
Specific embodiment
In order to make the above objects, features, and advantages of the present application more apparent, with reference to the accompanying drawing and it is specific real
Mode is applied to be described in further detail the embodiment of the present application.
Technical solution provided by the embodiments of the present application for ease of understanding will first be said the background technique of the application below
It is bright.
Inventor has found in traditional recommendation service research, under normal conditions can be according to included in the input of user
Certain important entity segments retrieved to carry out recommendation service.And this recommendation service can generate following problems, first is that, directly
It connects and relevant search is carried out according to the input of user, the input intention of user is not judged accurately, will cause and continually show
The content for not meeting user's intention very much, influences experience of the user to input product;Second is that only according in user's input content
Important keyword or phrase generation question text so that question text is more inflexible lack the flexibility of dialogue;Third is that directly
It connects and is scanned for using the keyword of user's input, certain privacy risk may be brought.
Based on this, the embodiment of the present application provides a kind of method that problem of implementation generates, when user carries out input operation, example
After such as inputting text string using instant message applications, the text string of available user's input, and identify that text string is corresponding
It is intended to classification.Then, the slot position information that the intention classification includes is obtained, and is searched from slot position information included by intention classification
It include the target slot position information that matches of participle and the corresponding slot position value of target slot position information with text string.Again by the slot of identification
Place value fills the corresponding position into question template, so that question text is generated, to open up the question text to user
Show, and then can also be scanned for using the question text, obtains the corresponding search result of the question text.As it can be seen that when obtaining
When the text string of user's input, intention assessment is carried out, first to carry out intention positioning for subsequent recommendation service.It is intended to class when determining
After not, slot position information corresponding to the intention classification is obtained, to find and text from the slot position information that intention classification includes
This string includes segmenting matched target slot position information and the corresponding slot position value of target slot position information.And then by slot position value fill to
In correspondence problem template, the problem of generating specification text, and be worth question texts generated more according to these fine-grained slot positions
Add and meets user's intention.In addition, being scanned for using the question text, retrieve, protects without the input directly using user
Protect the privacy of user.
Referring to Fig. 1, which is the block schematic illustration of exemplary application scene provided by the embodiments of the present application.Wherein, this Shen
Please embodiment provide problem of implementation generation method can be applied in client 10 or server 20.
When practical application, server 20 can obtain the text string of user's input by client 10, and identify text string
Corresponding intention classification.Obtain slot position information included by the intention classification again, with from be intended to classification included by slot position information
In find groove location corresponding with the matched target slot position information of participle included by text string and target slot position information.So
Afterwards, question text is generated using target slot position information and the corresponding slot position value of target slot position information, the problem of to generate
Text is sent to client 10 and is shown, and/or carries out relevant search according to the question text.
Alternatively, client 10 obtains the text string of user's input, and identify the corresponding intention classification of text string.Obtain this again
Be intended to slot position information included by classification, with from be intended to find in slot position information included by classification with included by text string
Segment matched target slot position information and the corresponding groove location of target slot position information., utilize target slot position information and target
The corresponding slot position value of slot position information generates question text.Further, client 10 can also send out question text generated
Server 20 is given, so that server 20 carries out relevant search according to the question text.
It will be understood by those skilled in the art that block schematic illustration shown in FIG. 1 is only that presently filed embodiment can be
An example being wherein achieved.The scope of application of the application embodiment is not limited by any aspect of the frame.
It should be noted that client 10 can be carried on terminal, which can be existing, researching and developing or incites somebody to action
Come it is researching and developing, can pass through it is any type of wiredly and/or wirelessly connect (for example, Wi-Fi, LAN, honeycomb, coaxial cable etc.)
Any user equipment interacted, including but not limited to: existing, researching and developing or research and development in the future intelligence are wearable to be set
Standby, smart phone, non-smart mobile phone, tablet computer, laptop PC, desktop personal computer, minicomputer,
Medium-size computer, mainframe computer etc..Presently filed embodiment is unrestricted in this regard.It is also to be noted that
In the embodiment of the present application server 20 can be it is existing, researching and developing or in the future research and development, search can be provided a user
One example of the equipment of service.Presently filed embodiment is unrestricted in this regard.
Problem of implementation generation method provided by the present application for ease of understanding says this method below in conjunction with attached drawing
It is bright.
Referring to fig. 2, which is the flow chart for the method that a kind of problem of implementation provided by the embodiments of the present application generates, such as Fig. 2
Shown, this method may include:
S201: the text string of input is obtained.
S202: the corresponding intention classification of identification text string.
In the present embodiment, when user inputs, the text string that available user is inputted, to identify the text
Go here and there corresponding intention classification.
In practical application, the corresponding intention classification of identification text string can both be carried out in client, can also service
Device end carries out, and the present embodiment is it is not limited here.When be intended to classification identification by client, client is defeated in acquisition user
After the text string entered, identification operation can be directly carried out;When be intended to classification identification by server, client is obtaining use
After the text string of family input, text string is sent to server, so that server carries out the intention classification of text string
Identification.Wherein, client can carry out input for user and operate used software, such as instant message applications, input method etc..
Being intended to classification can preset according to service field, for example, tourism is intended to, traffic booking is intended to, financing is thrown
Intention, health care intention, customized horoscope intention etc. are provided, so that the intention of user's input is accurately positioned, raising is subsequently generated problem
The accuracy of text.
In some possible implementations, a kind of reality for identifying the corresponding intention classification of text string is present embodiments provided
Existing mode, specifically: by text string input text intent classifier model trained in advance, obtain the corresponding intention of text string
Classification.In specific implementation, text intent classifier model can be inputted using text string as input data, is intended to divide by the text
Class model determines its corresponding intention classification according to the text string inputted.It is of course also possible to first be segmented to text string
Processing, obtains the word feature of each participle, is then input to text using word feature corresponding to text string as input data
Intent classifier model, so that text intent classifier model determines the intention class of text string according to the word feature inputted
Not.It is understood that specifically the data of input text intent classifier model are text string or the corresponding word feature of text string,
It need to be consistent with training data used in training text intent classifier model.
Wherein, text intent classifier model can use a large amount of training text string comprising being intended to classification and corresponding meaning
Figure class label, training text string and the corresponding class label that is not intended to comprising being intended to classification do not train generation.Specifically instructing
When practicing generation text intent classifier model, it can directly be trained, can also will instruct using training text string as training data
Practice text string and carry out word segmentation processing, then obtain the word feature of each participle, using word feature corresponding to the training text string into
Row training.Wherein, text intent classifier model can be decision-tree model, Logic Regression Models, model-naive Bayesian, convolution
Neural network model, Recognition with Recurrent Neural Network model etc..
S203: the corresponding slot position information for being intended to classification and including of text string is obtained.
S204: including segmenting the target slot position to match from being intended to be found in the slot position information that classification includes with text string
Information, and the corresponding slot position value of target slot position information is obtained from text string.
In the present embodiment, after identifying the intention classification of text string, slot position information included by the intention classification is obtained,
And for slot position information included by classification is intended to, slot position information is matched one by one with participle included by text string, from
And obtaining with text string includes segmenting the target slot position information to match, then acquisition target slot position information is corresponding from text string
Slot position value, the generally participle with the text string of the target slot position information matches.The process may be considered slot position filling
Process, slot position filling can regard sequence labelling problem as, stamp corresponding label respectively for the word in given text string,
The label may be considered slot position information, and the corresponding participle of the label is the slot position value of the corresponding slot position information.
In practical applications, multiple slot position information included by every kind of intention classification can be preset, and are carried out one by one
It saves.When determine currently obtain text string intention classification when, according to the intention classification determine it included by slot position information.
Then it finds from slot position information included by intention classification and segments the target slot position information to match included by text string,
And it is extracted from text string and obtains the corresponding slot position value of each target slot position information.For example, customized horoscope is intended to include that slot position is believed
Breath can be { constellation name } { gender } { age } { event };When the text string for determining that user is inputted " does not know Aquarius
The intention classification of boy student's fortune good or not " is customized horoscope intention, then segments to text string, and can determine this by matching
The participle " Aquarius " and slot position information { constellation name } for including in text string match, segment " boy student " and slot position information { property
Do not match }, segment " fortune " and match with slot position information { event }, so as to obtain { constellation name } { gender } { event }
Then three target slot position information identify the corresponding slot position value of each target slot position information, as { pollux from text string
Slot position value be referred to as " Aquarius ", { gender } slot position value be " boy student ", the slot position value of { event } is " luck tendency ".
In some possible implementations, step S204: found from the slot position information that intention classification includes and text
The target slot position information that matches of this string packet participle, and the corresponding slot position value of target slot position information is obtained from text string, can be with
Include: to be segmented to text string, for each participle, execute following step respectively: when the slot position information that intention classification includes
When the slot position information that middle presence matches with participle, slot position information is extracted as target slot position information, and using the participle as institute
State the corresponding slot position value of target slot position information.
It namely in the concrete realization, can be right after obtaining the slot position information that the corresponding intention classification of text string includes
Text string is segmented, any one participle is chosen, and determine whether there is and this point in slot position information that the intention classification includes
The slot position information that word matches determines whether the participle is a certain slot position information in slot position information that the intention classification includes
Slot position value, if a certain slot position information matches that the participle and intention classification include, extract the slot position information as target slot
Position information, and using the participle as the slot position value of the target slot position information.After being matched to each participle in text string,
Available each target slot position information and the corresponding slot position value of target slot position information.
S205: according to target slot position information and the corresponding slot position value of target slot position information, question text is generated.
In the present embodiment, after obtaining target slot position information and target slot position information corresponding slot position value, according to obtaining
Target slot position information and the corresponding slot position value of target slot position information, generate question text.That is, according to extracted slot position
Value, generate specification the problem of text.
In specific implementation, every kind of intention classification can correspond at least a set of question template, include extremely in the question template
Few slot position information.Then, in step S205, it can first select text string is corresponding to be intended to the corresponding a certain set problem mould of classification
Then plate will be filled from the corresponding slot position value of target slot position information extracted in text string into the question template, it can raw
Problematic text.Wherein, it will be illustrated in subsequent embodiment about the realization process of Utilizing question template generation question text.
In practical application, the question text can be shown to improve the participation of user when generating question text
To user, if the customer acceptance question text, can be carried out according to the trigger action of user subsequent literary for this problem
This answer search.Specifically, obtaining the answer text of question text in response to the answer searching request to question text.That is,
When customer acceptance is shown the problem of when text, the search operation of text for this problem can be triggered by the modes such as clicking;
Server can carry out subsequent search in response to the trigger action of user, corresponding to obtain the question text from database
Answer text, and show the answer text to user.
It is understood that, to avoid the complexity shown, can also first be calculated each when generating multiple question texts
The problem of correlation of question text and text string is more than preset threshold to correlation text is shown.That is, by correlation compared with
Big problem textual presentation improves the standard of search to user to carry out subsequent searches according to the biggish question text of correlation
True property.For example, can use each question template when the corresponding more set question templates of intention type and generate a question text,
To obtain the corresponding multiple question texts of text string.
It is understood that being analyzed in text string in the present embodiment when determining question text according to the input of user
The slot position value of included target slot position information may be considered one kind more to the analysis of target slot position information specific in text string
Comprehensively, more fine-grained analysis avoids the important keyword for including merely with user's input text come when determining question text
The deviation of appearance improves the accuracy of positioning problems.For example, " not knowing Aquarius in this year for the text string of user's input
Boy student's fortune good or not ", using scheme provided in this embodiment, text can be " Aquarius boy student 2019 the problem of generation
Luck tendency how ", closer to user true intention;And if may be matched to merely with important keyword " Aquarius "
In database " how is Aquarius schoolgirl luck tendency ", does not consider boy student, the lower keyword of schoolgirl's equal weight, only consider constellation
The higher keyword of corresponding " Aquarius " this weight causes question text generated and does not meet user's intention.In addition,
Compare specification using the problem text that the slot position value combination question template of text string determines, so that using literary the problem of specification
This offer subsequent searches service can be avoided and directly be scanned for using the text string that user is inputted, protects the privacy of user.
As can be seen from the above description, in the embodiment of the present application, the text string of user's input is obtained, and identifies text string pair
The intention classification answered.When identifying the corresponding intention classification of text string, the slot position information that the intention classification includes is obtained.So
Afterwards, then from be intended to find in the slot position information that classification includes with text string include the target slot position information that matches of participle and
The corresponding slot position value of target slot position information.Finally, according to target slot position information and the corresponding slot position value of target slot position information, it is raw
Problematic text.As it can be seen that the embodiment of the present application, before carrying out commending contents according to the input of user, identification user inputs first
The intention classification of text string, further according to being intended to classification from extracting the preset required key message in the case where being intended to classification in text string
The specific value (i.e. slot position value) of (i.e. slot position information), so that question text is generated according to fine-grained information, so as to user
Showing problem text carries out the search of related content according to question text, recommends, and accords with content recommended to the user more
The intention for sharing family, improves the user experience.
In a kind of possible implementation of the embodiment of the present application, described in step S205 according to target slot position information and
The slot position value of target slot position information generates question text, may include: to obtain template the problem of including target slot position information;It will
The corresponding slot position value of target slot position information, is filled into question template, generates question text.I.e. selection includes target slot position first
The problem of information template, then the corresponding slot position value of target slot position information is filled, to obtain question text.
Specifically, can choose the covering target slot position information when obtaining template the problem of including target slot position information
Most problem templates is also that can choose the problem template most including the target slot position information.It should be noted that
In S204 from be intended to find in the slot position information that classification includes include the target slot position information that matches of participle with text string can
The problem of capable of covering all target slot position information mould can be selected as far as possible first including multiple, then in select permeability template
Plate;When there is no all target slot position information are covered the problem of when template, then preferentially selection coverage goal slot position information is most
Question template;When there is multiple selection most templates of coverage goal slot position information, can also further consider to be coated
The different degree of each slot position information of lid, the most problem template of the selection covering higher target slot position information of different degree, etc..
In practical application, may include target complete slot position information or partial target slot position information in question template,
After extraction target slot position information corresponding slot position value, which is filled into the corresponding position of question template, to generate
Question text, to show question text generated to user.For example, customized horoscope is intended to, corresponding question template are as follows:
How is { event } in { constellation name } { gender } { age }.The text string that user is inputted " does not know the boy student of Aquarius in this year
Fortune good or not ", then extract the corresponding slot position value of each target slot position information from text string: { constellation name }-Aquarius,
The problem of { gender }-male, { age } -2019, { event }-luck tendency, and after slot position value is filled into question template, generation, text was
" how is Aquarius boy student luck tendency in 2019 ".
It should be noted that in some scenes, the text string that user is inputted may not exclusively include being intended to classification institute
Including the corresponding slot position value of each slot position information, such as, it is intended that slot position information included by classification be { constellation name } { property
Not } { age } { event }, and the text string of user's input is " the boy student's fortune good or not for not knowing Aquarius ", wherein slot position
The not corresponding slot position value of information { age }.It can be able to be each intention with matching problem template to guarantee in this case
Classification presets multiple question templates, and multiple question templates cover as far as possible includes the case where various slot position information combinations.?
After the slot position value for obtaining in text string included target slot position information, may further be selected from multiple question templates include
All or part of question template is filled in these target slot position information, to obtain multiple question texts, and then can be with
Each question text is shown to user.It is understood that being intended in order to which question text generated more meets user, Ke Yixuan
Select the problem template more including target slot position information in text string.
For example, customized horoscope is intended to corresponding question template 1 are as follows: { event } in { constellation name } { gender } { age } is such as
What, including four slot position information;Question template 2 are as follows: how is { event } in { constellation name } { age }, including three slot position letters
Breath;Question template 3 are as follows: how is { event } of { constellation name } { gender }, including three slot position information;Question template 4 are as follows: { star
Seat title } { event } how, including two slot position information etc..The text string of user's input is that " why is the fortune of Aquarius schoolgirl
Sample ", text string can match to obtain { constellation name } { gender } { event } these three target slot position information, then question template
3 also include these three slot position information, and question template 4 includes the two of them in these three slot position information, then can choose problem
Template 3,4.The problem of further can be generated text 1 " what luck of Aquarius schoolgirl " and 2 " water bottle of question text
The what luck of seat ".Wherein, the target slot position information in text string included by question template 3 is more, problem text generated
This is intended to closer to user.
In addition, in some scenes, it is shorter and/or itself have no enquirement meaning there is text string that user is inputted
Figure, will cause can not carry out question text generation or without recommending relevant question text.Therefore, the knowledge described in step S202
Before the corresponding intention classification of other text string, it can also detect whether text string meets preset condition, if text string meets
Preset condition then carries out the operations such as the identification for being intended to classification to text string again.Wherein, preset condition can be according to the actual situation
It determines, can be the byte number that text string includes at least, and/or, text string, which exists to put question to, to be intended to.
When specific implementation, before the corresponding intention classification of the identification text string described in step S202, this article can detecte
Whether the byte number that this string includes reaches default value, and/or whether detection text string includes to put question to be intended to.That is, in reality
In application, can only detect whether byte number included by text string reaches default value, if reaching default value, text is indicated
This string meets preset condition, then can carry out the identification and the subsequent step that are intended to classification;Only text string can also be detected whether
It is intended to comprising puing question to, if be intended to comprising puing question to, indicates that text string meets preset condition, then can carry out the identification for being intended to classification
And subsequent step.If detected simultaneously, the byte number included by the text string reaches default value and text string includes to mention
When asking intention, just indicate that text string meets preset condition, then carry out the identification and the subsequent step that are intended to classification.
In practical applications, can use disaggregated model to text string whether include put question to be intended to detect, and according to
The classification results that disaggregated model is exported determine whether text string includes to put question to be intended to.Wherein, disaggregated model can use greatly
The training text string comprising puing question to intention of amount and corresponding tag along sort do not include to put question to the training text string being intended to and correspondence
Tag along sort training generate.Wherein, disaggregated model can for decision-tree model, Logic Regression Models, model-naive Bayesian,
Convolutional neural networks model etc., the application is to this without limiting.
Based on above method embodiment, present invention also provides the devices that a kind of problem of implementation generates, below in conjunction with this
Device is illustrated.
Referring to Fig. 3, which is the structure drawing of device that a kind of problem of implementation provided by the embodiments of the present application generates, such as Fig. 3 institute
Show, the apparatus may include:
First acquisition unit 301, for obtaining the text string of input;
Recognition unit 302, for identification corresponding intention classification of the text string;
Second acquisition unit 303, for obtaining the corresponding slot position information for being intended to classification and including of the text string;
Searching unit 304, for finding from the slot position information that the intention classification includes and including with the text string
The target slot position information to match is segmented, and obtains the corresponding slot position value of the target slot position information from the text string;
Generation unit 305 is used for according to the target slot position information and the corresponding slot position value of the target slot position information,
Generate question text.
In one possible implementation, described device further include:
Determination unit, if the text string meets preset condition, is held for determining that the text string meets preset condition
Row first recognition unit and subsequent step.
In one possible implementation, the determination unit, the byte for including specifically for the determination text string
Number reaches predetermined word joint number, and/or, determine that the text string includes to put question to be intended to.
In one possible implementation, described device further include:
Computing unit, for calculating the correlation of described problem text with the text string;
Display unit, for the correlation be more than preset threshold the problem of text be shown.
In one possible implementation, described device further include:
Retrieval unit, for obtaining answering for described problem text in response to the answer retrieval request to described problem text
Case text.
In one possible implementation, the searching unit, specifically for being segmented to the text string;For
Each participle is extracted when existing in the slot position information that the intention classification includes with the slot position information for segmenting and matching
The slot position information is used as the corresponding slot position value of the target slot position information as target slot position information, and by the participle.
In one possible implementation, the generation unit, comprising:
Subelement is obtained, is used to obtain template the problem of including the target slot position information;
Subelement is generated, for being filled into the slot position value of the target slot position information in described problem template, generation is asked
Inscribe text.
In one possible implementation, first recognition unit is specifically used for inputting the text string preparatory
Trained text intent classifier model obtains the corresponding intention classification of the text string.
It should be noted that the realization of each unit may refer to above method embodiment, the present embodiment in the present embodiment
Details are not described herein.
Fig. 4 shows a kind of block diagram of input unit 600.For example, device 600 can be mobile phone, computer, number
Broadcast terminal, messaging devices, game console, tablet device, Medical Devices, body-building equipment, personal digital assistant etc..
Referring to Fig. 4, device 600 may include following one or more components: processing component 602, memory 604, power supply
Component 606, multimedia component 608, audio component 610, the interface 69 of input/output (I/O), sensor module 614, Yi Jitong
Believe component 616.
The integrated operation of the usual control device 600 of processing component 602, such as with display, telephone call, data communication, phase
Machine operation and record operate associated operation.Processing element 602 may include that one or more processors 620 refer to execute
It enables, to perform all or part of the steps of the methods described above.In addition, processing component 602 may include one or more modules, just
Interaction between processing component 602 and other assemblies.For example, processing component 602 may include multi-media module, it is more to facilitate
Interaction between media component 606 and processing component 602.
Memory 604 is configured as storing various types of data to support the operation in equipment 600.These data are shown
Example includes the instruction of any application or method for operating on device 600, contact data, and telephone book data disappears
Breath, picture, video etc..Memory 604 can be by any kind of volatibility or non-volatile memory device or their group
It closes and realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile
Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash
Device, disk or CD.
Power supply module 606 provides electric power for the various assemblies of device 600.Power supply module 606 may include power management system
System, one or more power supplys and other with for device 600 generate, manage, and distribute the associated component of electric power.
Multimedia component 608 includes the screen of one output interface of offer between described device 600 and user.One
In a little embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen
Curtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensings
Device is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding action
Boundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakers
Body component 608 includes a front camera and/or rear camera.When equipment 600 is in operation mode, such as screening-mode or
When video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera and
Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 610 is configured as output and/or input audio signal.For example, audio component 610 includes a Mike
Wind (MIC), when device 600 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone is matched
It is set to reception external audio signal.The received audio signal can be further stored in memory 604 or via communication set
Part 616 is sent.In some embodiments, audio component 610 further includes a loudspeaker, is used for output audio signal.
I/O interface provides interface between processing component 602 and peripheral interface module, and above-mentioned peripheral interface module can be
Keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and locking are pressed
Button.
Sensor module 614 includes one or more sensors, and the state for providing various aspects for device 600 is commented
Estimate.For example, sensor module 614 can detecte the state that opens/closes of equipment 600, and the relative positioning of component, for example, it is described
Component is the display and keypad of device 600, and sensor module 614 can be with 600 1 components of detection device 600 or device
Position change, the existence or non-existence that user contacts with device 600,600 orientation of device or acceleration/deceleration and device 600
Temperature change.Sensor module 614 may include proximity sensor, be configured to detect without any physical contact
Presence of nearby objects.Sensor module 614 can also include optical sensor, such as CMOS or ccd image sensor, at
As being used in application.In some embodiments, which can also include acceleration transducer, gyro sensors
Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 616 is configured to facilitate the communication of wired or wireless way between device 600 and other equipment.Device
600 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.In an exemplary implementation
In example, communication component 616 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel.
In one exemplary embodiment, the communication component 616 further includes near-field communication (NFC) module, to promote short range communication.Example
Such as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology,
Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 600 can be believed by one or more application specific integrated circuit (ASIC), number
Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing following methods:
Obtain the text string of input;
Identify the corresponding intention classification of the text string;
Obtain the corresponding slot position information for being intended to classification and including of the text string;
Finding from the slot position information that the intention classification includes with the text string includes segmenting the target to match
Slot position information, and the corresponding slot position value of the target slot position information is obtained from the text string;
According to the target slot position information and the corresponding slot position value of the target slot position information, question text is generated.
Optionally, before the corresponding intention classification of the identification text string, the method also includes:
Determine that the text string meets preset condition.
Optionally, the determination text string meets preset condition, comprising:
Determine that the byte number that the text string includes reaches default value, and/or, determine that the text string includes to put question to meaning
Figure.
Optionally, the method also includes:
The problem of correlation for calculating described problem text and the text string is more than preset threshold to correlation text
Originally it is shown.
Optionally, the method also includes:
In response to the answer retrieval request to described problem text, the answer text of described problem text is obtained.
Optionally, described found from the slot position information that the intention classification includes with the text string includes participle phase
Matched target slot position information, and the corresponding slot position value of the target slot position information is obtained from the text string, comprising:
The text string is segmented, for each participle, executes following step respectively:
When existing in the slot position information that the intention classification includes with the slot position information for segmenting and matching, institute is extracted
Slot position information is stated as target slot position information, and by the participle as the corresponding slot position value of the target slot position information.
Optionally, described according to the target slot position information and the corresponding slot position value of the target slot position information, it generates
Question text, comprising:
Obtain template the problem of including the target slot position information;
It is filled into the target slot position information corresponding slot position value in described problem template, generates question text.
Optionally, the corresponding intention classification of the identification text string, comprising:
By text string input text intent classifier model trained in advance, the corresponding intention class of the text string is obtained
Not.
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of mobile terminal
When device executes, so that mobile terminal is able to carry out display methods, which comprises
Obtain the text string of input;
Identify the corresponding intention classification of the text string;
Obtain the corresponding slot position information for being intended to classification and including of the text string;
Finding from the slot position information that the intention classification includes with the text string includes segmenting the target to match
Slot position information, and the corresponding slot position value of the target slot position information is obtained from the text string;
According to the target slot position information and the corresponding slot position value of the target slot position information, question text is generated.
Optionally, before the corresponding intention classification of the identification text string, the method also includes:
Determine that the text string meets preset condition.
Optionally, the determination text string meets preset condition, comprising:
Determine that the byte number that the text string includes reaches default value, and/or, determine that the text string includes to put question to meaning
Figure.
Optionally, the method also includes:
The problem of correlation for calculating described problem text and the text string is more than preset threshold to correlation text
Originally it is shown.
Optionally, the method also includes:
In response to the answer retrieval request to described problem text, the answer text of described problem text is obtained.
Optionally, described found from the slot position information that the intention classification includes with the text string includes participle phase
Matched target slot position information, and the corresponding slot position value of the target slot position information is obtained from the text string, comprising:
The text string is segmented, for each participle, executes following step respectively:
When existing in the slot position information that the intention classification includes with the slot position information for segmenting and matching, institute is extracted
Slot position information is stated as target slot position information, and by the participle as the corresponding slot position value of the target slot position information.
Optionally, described according to the target slot position information and the corresponding slot position value of the target slot position information, it generates
Question text, comprising:
Obtain template the problem of including the target slot position information;
It is filled into the target slot position information corresponding slot position value in described problem template, generates question text.
Optionally, the corresponding intention classification of the identification text string, comprising:
By text string input text intent classifier model trained in advance, the corresponding intention class of the text string is obtained
Not.
Fig. 5 is the structural schematic diagram of server in the embodiment of the present invention.The server 700 can be due to configuration or performance be different
Generate bigger difference, may include one or more central processing units (central processing units,
CPU) 722 (for example, one or more processors) and memory 732, one or more storage application programs 742 or
The storage medium 730 (such as one or more mass memory units) of data 744.Wherein, memory 732 and storage medium
730 can be of short duration storage or persistent storage.The program for being stored in storage medium 730 may include one or more modules
(diagram does not mark), each module may include to the series of instructions operation in server.Further, central processing unit
722 can be set to communicate with storage medium 730, and the series of instructions behaviour in storage medium 730 is executed on server 700
Make.
Terminal 700 can also include one or more power supplys 726, one or more wired or wireless networks connect
Mouthfuls 750, one or more input/output interfaces 756, one or more keyboards 756, and/or, one or one with
Upper operating system 741, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment emphasis is said
Bright is the difference from other embodiments, and the same or similar parts in each embodiment may refer to each other.For reality
For applying system or device disclosed in example, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, phase
Place is closed referring to method part illustration.
It should be appreciated that in this application, " at least one (item) " refers to one or more, and " multiple " refer to two or two
More than a."and/or" indicates may exist three kinds of relationships, for example, " A and/or B " for describing the incidence relation of affiliated partner
It can indicate: only exist A, only exist B and exist simultaneously tri- kinds of situations of A and B, wherein A, B can be odd number or plural number.Word
Symbol "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or"." at least one of following (a) " or its similar expression, refers to
Any combination in these, any combination including individual event (a) or complex item (a).At least one of for example, in a, b or c
(a) can indicate: a, b, c, " a and b ", " a and c ", " b and c ", or " a and b and c ", and wherein a, b, c can be individually, can also
To be multiple.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one
Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation
There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain
Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.