CN109918058A - Information processing unit and method and the method for recommending code in programmed environment - Google Patents

Information processing unit and method and the method for recommending code in programmed environment Download PDF

Info

Publication number
CN109918058A
CN109918058A CN201711328030.5A CN201711328030A CN109918058A CN 109918058 A CN109918058 A CN 109918058A CN 201711328030 A CN201711328030 A CN 201711328030A CN 109918058 A CN109918058 A CN 109918058A
Authority
CN
China
Prior art keywords
information processing
prediction result
processing unit
sequence
predicting
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.)
Granted
Application number
CN201711328030.5A
Other languages
Chinese (zh)
Other versions
CN109918058B (en
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to CN201711328030.5A priority Critical patent/CN109918058B/en
Publication of CN109918058A publication Critical patent/CN109918058A/en
Application granted granted Critical
Publication of CN109918058B publication Critical patent/CN109918058B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This disclosure relates to information processing unit and information processing method and the method for recommending code chip in programmed environment.It is used to handle to predict further element the element sequence that several elements in element set are constituted according to the information processing unit of the disclosure, there are logical relations between element in element sequence, the information processing unit includes: the first predicting unit, receives element sequence and generates intermediate state and the first prediction result based on element sequence;One or more second predicting units, its number corresponds to the number of the element type in element set, for every kind of element type there are corresponding second predicting unit, the second predicting unit receives intermediate state and generates the second prediction result based on intermediate state and parameter relevant with corresponding element type;And determination unit, it receives the first prediction result and the second prediction result and further element is determined based on the first prediction result and the second prediction result.

Description

Information processing unit and method and the method for recommending code in programmed environment
Technical field
This disclosure relates to information processing unit and information processing method.Particularly, this disclosure relates to be pushed away in programmed environment Recommend code chip.
Background technique
Code is recommended to be one of the major function in modern Integrated Development Environment (IDE).It is static for Java etc. to compile Cheng Yuyan, has benefited from type of identifier annotation, and traditional code recommended method can work well.However, in recent years The dynamic programming languages such as widely used Python, JavaScript since there is no type of identifier annotation, thus pass The code recommended method of system cannot provide the support being equal with static programming language.
Accordingly, it is desirable to provide a kind of information processing technology, can overcome the defect of existing code recommended method, be State programming language provides good code recommendation function.
It should be noted that the above description of the technical background be intended merely to it is convenient to the technical solution of the application carry out it is clear, Complete explanation, and facilitate the understanding of those skilled in the art and illustrate.Cannot merely because these schemes the application's Background technology part is expounded and thinks that above-mentioned technical proposal is known to those skilled in the art.
Summary of the invention
It will be given for the brief overview of the disclosure, hereinafter in order to provide the basic of some aspects about the disclosure Understand.It should be appreciated that this general introduction is not the exhaustive general introduction about the disclosure.It is not intended to determine the pass of the disclosure Key or pith, nor intended limitation the scope of the present disclosure.Its purpose only provides certain concepts in simplified form, Taking this as a prelude to a more detailed description discussed later.
A kind of programmed environment for being designed to provide information processing technology, can be applied in dynamic programming language of the disclosure Middle recommendation code.By the code recommended method realized according to the information processing technology of the disclosure, recommend compared with traditional code Method can improve the accuracy that code is recommended under the premise of not improving and calculating cost.
In order to realize the purpose of the disclosure, according to one aspect of the disclosure, a kind of information processing unit is provided, is used for To in element set several elements constitute element sequence handled the element to predict further element, in element sequence it Between there are logical relation, which includes: the first predicting unit, receives element sequence and raw based on element sequence At intermediate state and the first prediction result;One or more second predicting units, one or more second predicting units Number corresponds to the number of the element type in element set, and for every kind of element type, there are corresponding second prediction is single Member, one or more second predicting units receive intermediate state and based on intermediate state and with corresponding element type phase The parameter of pass generates one or more second prediction results;And determination unit, receive the first prediction result and one or more Multiple second prediction results and further element is determined based on the first prediction result and one or more second prediction results.
According to another aspect of the present disclosure, a kind of information processing method is provided, for several members in element set The element sequence that element is constituted is handled between the element to predict further element, in element sequence, and there are logical relation, the letters Breath processing method includes: to receive element sequence and generate intermediate state and the first prediction result based on element sequence;For every Kind element type receives intermediate state and generates one based on intermediate state and parameter relevant with corresponding element type Or more the second prediction result;And receive the first prediction result and one or more second prediction results and based on the One prediction result and one or more second prediction results determine further element.
According to another aspect of the present disclosure, a kind of use by realizing according to the information processing unit of the disclosure is additionally provided In the method for recommending code chip in programmed environment.
According to another aspect of the present disclosure, the computer that can be realized the information processing method according to the disclosure is additionally provided Program.In addition, additionally providing the computer program product at least computer-readable medium form, record has for real thereon Now according to the computer program code of the information processing method of the disclosure.
By according to the information processing technology of the disclosure realize in programmed environment recommend code chip method, Accurately it can recommend code to programming personnel in the case where not increasing and calculating cost.
Detailed description of the invention
Referring to the explanation of disclosure embodiment, can be more readily understood that with reference to the accompanying drawing the above of the disclosure and Other objects, features and advantages, in the accompanying drawings:
Fig. 1 is the schematic diagram for showing the code in Integrated Development Environment and recommending;
Fig. 2 is the schematic flow chart for showing the training process of code recommended models;
Fig. 3 is the block diagram for showing the information processing unit of the first embodiment according to the disclosure;
Fig. 4 is the internal structure for showing each unit of information processing unit of the first embodiment according to the disclosure Schematic diagram;
Fig. 5 is the distance shown between the definition and calling of identifier different types of in JavaScript programming language Statistical data schematic diagram;
Fig. 6 is the block diagram for showing the information processing unit of the second embodiment according to the disclosure;
Fig. 7 is the internal structure for showing each unit of information processing unit of the second embodiment according to the disclosure Schematic diagram;
Fig. 8 is the schematic diagram for showing the internal structure of the second predicting unit used in Fig. 7;
Fig. 9 is the flow chart for showing the information processing method according to the disclosure;And
Figure 10 is to show the information processing unit and information processing method that can be used to realize according to embodiment of the present disclosure General-purpose machinery structure diagram.
Specific embodiment
It is described hereinafter in connection with illustrative embodiments of the attached drawing to the disclosure.It rises for clarity and conciseness See, does not describe all features of actual implementation mode in the description.It should be understood, however, that developing any this reality Much decisions specific to embodiment can be made during embodiment, to realize the objectives of developer, And these decisions may be changed with the difference of embodiment.
Here, and also it should be noted is that, in order to avoid having obscured the disclosure because of unnecessary details, in the accompanying drawings Illustrate only with the component closely related according to the scheme of the disclosure, and be omitted with disclosure relationship it is little other are thin Section.
In general, code recommendation can be accomplished in that from the source code library of programming language and learn language model, root The highest code of next possibility is predicted for the code of input according to the language model learnt and recommends programming people Member.In fact, all codes in programming language can be considered as constituting vector space, formed by the code combination as element Code snippet, i.e. element sequence, the sequence vector that can be considered as in vector space.In other words, code recommendation can be regarded Element sequence to constitute to several elements in element set is handled to predict further element, wherein in element sequence There are logical relations between element.
For example, all codes in the programming language can be made of chip for a certain specific programming language.Assuming that All chips of programming language constitute vector space, and the length of each vector is the total number of all chips.For by one The code snippet that a little chips are constituted, can by it, intermediate step is split as vector set on time, between the vector in the vector set There are logical relations, and the example of the logical relation can be the grammer of programming language to a certain extent.Pass through the language learnt Speech model can predict the highest vector of next possibility, that is, the highest code of the next possibility of code snippet Piece.
For this purpose, including: the first predicting unit according to the information processing unit of the disclosure, element sequence is received and based on member Prime sequences generate intermediate state and the first prediction result;One or more second predicting units, one or more second is pre- The number for surveying unit corresponds to the number of the element type in element set, and for every kind of element type, there are one corresponding the Two predicting units, one or more second predicting units receive intermediate state and based on intermediate state and with corresponding member One or more second prediction results of the plain relevant parameter generation of type;And determination unit, receive the first prediction result and One or more second prediction results and after being determined based on the first prediction result and one or more second prediction results Continuous element.
The natural language model based on sparse attention network is used according to the information processing technology of the disclosure, in order to obtain The relation of interdependence of the long range between the element in element sequence is taken, to improve the accurate of the prediction to further element Property.For example, can be used in Integrated Development Environment what personnel based on programming had inputted according to the information processing technology of the disclosure Program code recommends the following highest code of possibility to programming personnel.
In Integrated Development Environment, code recommends the recommendation and statement that can be classified as chip (token) level (statement) recommendation of level.The example of chip can be various identifiers used in programming language, and the example stated It can be sentence used in programming language.
Fig. 1 is the schematic diagram for showing the code in Integrated Development Environment and recommending.
As shown in fig. 1, chip level recommend can personnel have inputted based on programming character automatically recommended Whole chip, and state level recommend can personnel have inputted based on programming chip sequence recommend following possibility most High chip.For example, as shown in Figure 1, recommendation for chip level, when programming personnel inputs " Re ", Integrated Development Environment Recommendation function can automatically recommend prefix be the chip " Reader " of " Re ", " Reduce (function, sequence) ", The candidate as the chip to be inputted such as " ReferenceEror ".Furthermore for example, as shown in Figure 1, pushing away for statement level It recommends, when programming personnel's input code segment, i.e. chip sequence " for (int i=0;i<10;" when, the recommendation of Integrated Development Environment Function can automatically recommend chip " i++) " with the completion statement.
Embodiments described herein only relates to the recommendation of statement level, i.e., according to the model that constructs in advance to programming people Member recommends the next highest chip of possibility.
Fig. 2 is the schematic flow chart for showing the training process of code recommended models.
As shown in Figure 2, chipping processing can be carried out to the source code as training data first to obtain chip sequence Column.Then, chip sequence is split to obtain chip, i.e. training data (context chip) and band of the acquisition without label The training data (prediction chip) of label.Then it is trained using training data of the learning algorithm to tape label to obtain code Recommended models, so as to the processing of the training data for no label to obtain label, i.e., the following highest chip of possibility.
It is described referring to Fig. 3 to Fig. 8 to according to the information processing unit of embodiment of the present disclosure.
First embodiment
Fig. 3 is the block diagram for showing the information processing unit 300 according to the first embodiment of the disclosure.Fig. 4 is to show root According to the schematic diagram of the internal structure of each unit of the information processing unit 300 of the first embodiment of the disclosure.
As shown in figure 3, information processing unit 300 includes the first predicting unit 301, the second predicting unit 302 and determines single Member 303.
First predicting unit 301 can receive the chip sequence as element sequence and be generated based on chip sequence intermediate State and the first prediction result.As shown in Figure 4, the first predicting unit 301 can remember (LSTM) nerve net by shot and long term Network is realized.
LSTM neural network is a kind of time recurrent neural network (RNN), and it is suitable in processing and predicted time sequence The critical event that interval and delay are grown very much.It is well known to the skilled person in view of LSTM neural network, it is only right herein Its application in embodiment of the present disclosure is described, without its principle is described in more detail.
As shown in Figure 4, it is received by element by the first predicting unit 301 of LSTM neural fusion (for example, code Piece) constitute sequence inputting (x0,x1,…,xt) and export intermediate state (h0,h1,…,ht).In addition, the first predicting unit 301 according to the following formula (1) calculate be used as the first prediction result ytA possibility that highest next element distribution.
Wherein,WithIt is the parameter that can be adjusted by training, | V | it is element set The total number of element in conjunction.For example, in Integrated Development Environment, | V | it is the sum of all chips in programming language.
Second predicting unit 302 receives the intermediate state of the first predicting unit 301 output and based on the centre received State generates the second prediction result.As shown in Figure 4, the second predicting unit 302 can pass through sparse attention network (Sparse Attention Netword;SAN) model is realized.In recent years, sparse attention network is widely used at natural language In the various types of deep learning tasks such as reason, image recognition and speech recognition, it is well known to the skilled person , the application only to it in embodiment of the present disclosure is described herein, without its principle is described in more detail.
Specifically, as shown in figure 4, in time step t, by nearest previous K element connection (concatenate) one Rising indicates as context, and there are memories by themIn.K indicates attention length.Then, according to Following formula (2) to (5) is based on memory M in each time step ttThe content of middle storage generates attention (attention) distributionAnd context vector
WhereinWithBeing can be by training the parameter that be adjusted, and 1KIt indicates Element is 1 K dimensional vector.Tanh expression takes tanh function, and softmax expression takes softmax function.
In addition, the second predicting unit 302 saves the vector m of the symbol id about these element representationst=[id1,id2,…, idK]T∈NK(that is, for pointer (pointer) of big whole element sets).Then, (6) and (7) obtain entirely according to the following formula Sparse distribution on portion's element set.
Wherein-C is big negative constant, such as -1000.
Determination unit 303 receives the first prediction result ytWith the second prediction result itAnd further element is determined based on it.Example Such as, in Integrated Development Environment, further element is the highest chip of following possibility.
Specifically, as shown in figure 4, determination unit 303 according to the following formula (8) to (10), for the first predicting unit 301 and First prediction result y of two predicting units 302tWith the second prediction result itCalculate its probability distributionAnd it obtains most The prediction result of whole weighting
WhereinWithBeing respectively can be by training the weight matrix being adjusted and biasing.
The prediction result that determination unit 303 obtainsIt can be used for predicting subsequent element.For example, in Integrated Development Environment In, subsequent element is the highest chip of following possibility.
It can be in the case where not increasing calculating cost according to the information processing unit 300 of the first embodiment of the disclosure It improves and recommends accuracy.
In the information processing unit 300 according to the first embodiment of the disclosure, the second predicting unit 302 will about appoint The attention length of the element of what type is set as the same value, i.e. K.In addition, the second predicting unit 302 will be about any class The attention initial position of the element of type is also set as the same value, i.e. t-K.
However, inventors noted that in practical applications, such as the source code of JavaScript, it is different types of The distance between the definition of identifier and calling be not identical in different shared ratios on section.Fig. 5 is to show The schematic diagram of the statistical data of the definition and the distance between calling of different types of identifier in JavaScript programming language.
There are the identifiers of five seed types, i.e. variable (variable), array in JavaScript programming language (argument), function (function), class (class) and attribute (attribute).For example, as shown in Figure 5, with chip For unit, in the distance of 0-10, the distance between the definition of array and calling account for maximum ratio, and the definition of function and tune With the distance between account for the smallest ratio.In the distance of 10-20, between the definition and calling of the identifier of five seed types away from From ratio it is substantially similar.In the distance of 20-30, the distance between the definition of class and calling account for maximum ratio. In the distance of 30-40 and 40-50, the distance between the definition of function and calling account for maximum ratio.
Based on above-mentioned statistical data, the information processing unit of the first embodiment according to the disclosure can be improved To further increase the accuracy of recommendation.
Second embodiment
Fig. 6 is the block diagram for showing the information processing unit 600 according to the second embodiment of the disclosure.Fig. 7 is to show root According to the schematic diagram of the internal structure of each unit of the information processing unit 600 of the second embodiment of the disclosure.
It is similar to according to the information processing unit 300 of first embodiment of the disclosure, implement according to the second of the disclosure The information processing unit 600 of mode also includes the first predicting unit 601, the second predicting unit 602 and determination unit 603.However, Different from the information processing unit 300 according to the first embodiment of the disclosure, according to the letter of the second embodiment of the disclosure Ceasing processing unit 600 includes multiple second predicting units 602.
According to the second embodiment of the disclosure, the number of the second predicting unit 602 corresponds to the element in element set The number of type, for every kind of element type, there are corresponding second predicting units 602.For example, for JavaScript Chip in programmed environment is recommended, and there are 5 the second predicting units 602, correspond respectively to different type of identifier variables, number Group, function, class and attribute.
It is similar to the first predicting unit 301 of information processing unit 300 according to first embodiment, implement according to second First predicting unit 601 of the information processing unit 600 of mode can receive the chip sequence as element sequence and be based on Chip sequence generates intermediate state and the first prediction result.As shown in Figure 7, the first predicting unit 601 again may be by growing Short-term memory neural network is realized.
As shown in Figure 7, it is received by element by the first predicting unit 601 of LSTM neural fusion (for example, code Piece) constitute sequence inputting (x0,x1,…,xt) and export intermediate state (h0,h1,…,ht).In addition, the first predicting unit 601 according to the following formula (11) calculate be used as the first prediction result y0,tA possibility that highest next element distribution.
Wherein,WithIt is the parameter that can be adjusted by training, | V | it is element set The total number of element in conjunction, such as the sum of all chips in programming language.
According to disclosed second embodiment, multiple second predicting units 602 are received in the output of the first predicting unit 601 Between state and multiple second prediction results are generated based on intermediate state and parameter relevant with corresponding element type.Such as figure Shown in 7, the second predicting unit 602 again may be by sparse attention network to realize.However, due to the second predicting unit 602 correspond with element type, therefore can set the second different predicting units 602 for different element types.
As described above, in practical applications, different attention start bits can be set for different element types Set with attention length, to further increase recommendation accuracy.For this purpose, according in disclosed second embodiment, for Corresponding second predicting unit 602, the corresponding attention start bit of each second predicting unit 602 is arranged in each element type It sets and is individually set with attention length for corresponding element type.
It is related with corresponding element type in multiple second predicting units 602 according to the second embodiment of the disclosure Parameter may include for corresponding element type setting corresponding attention initial position and attention length.
As shown in fig. 7, being different from the second predicting unit 302 according to first embodiment, according to second embodiment There are four inputs for second predicting unit 602 tool.First input is the intermediate state h exported by the first predicting unit 6010, h1,…,ht.Second input is the attention initial position about i-th of element type indicated at time step t-1 b1,t-1,b2,t-1,…,bN,t-1, wherein 1≤i≤N.N indicates the number of element type, the i.e. number of the second predicting unit 602.It is right In JavaScript programmed environment, N=5.Third input be indicate at time step t-1 about i-th of element type Attention length l1,t-1,l2,t-2,…,lN,t-1.4th input is mi,t∈NK, be at time step t about The vector of the symbol id of element type i.
In addition, according to the second predicting unit 602 of second embodiment tool, there are four outputs.First output ci,tIt indicates The context vector of the sparse attention network about element type i at time step t.Second output bi,tIt indicates The attention initial position about i-th of element type at time step t.Third exports li,tIt indicates at time step t The attention length about i-th of element type.4th output yi,tIndicate at time step t by corresponding second The pseudo- sparse distribution on whole element sets that predicting unit 602 generates.
Fig. 8 is the schematic diagram for showing the internal structure of the second predicting unit 602 used in Fig. 7.
As shown in figure 8, will be nearest in time step t for the second predicting unit 602 corresponding with i-th of element type Previous K element link together and indicate that and there are memories by them as contextIn.With Afterwards, according to the following formula (12) to (15) each time step t be based on memory Mi,tThe content of middle storage generates attention distributionWith context vector ci,t∈Rk
WhereinWithIt is the parameter that can be adjusted by training, andIndicate that element is 1 li,t-1Dimensional vector.
In addition, the second predicting unit 602 saves the vector of the symbol id about these element representations
(that is, for pointer of big whole element sets).Then, (16) and (17) obtain the sparse distribution on whole element sets according to the following formula.
Wherein-C is big negative constant, such as -1000.
According to the second embodiment of the disclosure, can be trained by (18) according to the following formula to (20) to be indicated Second output b of the attention initial position about i-th of element type at time step ti,t
bi,t=round (qi,t×t)∈N,0≤bi,t≤t (20)
Wherein,WithIt is the parameter that can be adjusted by training. Round indicates bracket function, that is, takes qi,tThe integer part of × t, thus bi,t∈[0,t]。
Similarly, according to the second embodiment of the disclosure, can be trained by (21) according to the following formula to (23) come Obtaining indicates that the third of the attention length about i-th of element type at time step t exports li,t
li,t=round (vi,t×t)∈N,0≤li,t≤t (23)
Wherein,WithIt is the parameter that can be adjusted by training. Round indicates bracket function, that is, takes vi,tThe integer part of × t, thus li,t∈[0,t]。
Determination unit 603 receives the first prediction result y0,tWith the second prediction result yi,tAnd subsequent member is determined based on it Element.For example, subsequent element is the highest chip of following possibility in Integrated Development Environment.
Specifically, as shown in fig. 7, determination unit 303 according to the following formula (24) to (26), for 601 He of the first predicting unit First prediction result y of the second predicting unit 6020,tWith the second prediction result yi,tCalculate its probability distributionAnd And obtain the prediction result of final weighting
WhereinWithIt is the weight that can be adjusted by training respectively Matrix and biasing.
The prediction result that determination unit 603 obtainsIt can be used for predicting subsequent element.For example, in Integrated Development Environment In, subsequent element is the highest chip of following possibility.
According to the second embodiment of the disclosure, can be set for different element types different attention length and Attention initial position, to further improve forecasting accuracy in the case where not increasing and calculating cost.
In addition, according to the second embodiment of the disclosure, can the training data based on tape label by way of iteration It is trained for the attention length and attention initial position of different element types, is suitble to accordingly to finally determine The attention length of element type and attention initial position.
Fig. 9 is the flow chart for showing the information processing method 900 according to the disclosure.Information processing method 900 is used for member Element set in several elements constitute element sequence handled to predict further element, wherein the element in element sequence it Between there are logical relations
Information processing method 900 starts from step S901.Then, it in step S902, receives element sequence and is based on Element sequence generates intermediate state and the first prediction result.Step S902 can be by according to the second embodiment of the disclosure First predicting unit 601 is realized.
Then, in step S903, for every kind of element type, receive intermediate state and based on intermediate state and with One or more second prediction results of the corresponding relevant parameter generation of element type.Step S903 can be by according to this public affairs Second predicting unit 602 of the second embodiment opened is realized.
Then, in step S904, the first prediction result and one or more second prediction results is received and is based on First prediction result and one or more second prediction results determine further element.Step S904 can be by according to the disclosure The determination unit 603 of second embodiment realize.
Finally, information processing method 900 ends at step S905.
Although embodiment of the present disclosure is described above in association with the code recommendation in Integrated Development Environment, for this Field technical staff is it is evident that next embodiment of the present disclosure can be applied equally to according to existing element sequence prediction Other applications of the highest element of possibility, such as natural language processing, speech processes etc..
Figure 10 is to show the information processing unit and information processing method that can be used to realize according to embodiment of the present disclosure General-purpose machinery 1000 structure diagram.General-purpose machinery 1000 can be such as computer system.It should be noted that general-purpose machinery 1000 An only example does not imply that the limitation of the use scope or function to disclosed method and device.Also should not will lead to With machine 1000 it is construed to that there is any component shown in above- mentioned information processing method and information processing unit or combinations thereof Dependence or demand.
In Figure 10, central processing unit (CPU) 1001 according to the program stored in read-only memory (ROM) 1002 or from The program that storage section 1008 is loaded into random access memory (RAM) 1003 executes various processing.In RAM 1003, root is gone back The data required when CPU 1001 executes various processing etc. are stored according to needs.CPU 1001, ROM 1002 and RAM 1003 It is connected to each other via bus 1004.Input/output interface 1005 is also connected to bus 1004.
Components described below is also connected to input/output interface 1005: importation 1006 (including keyboard, mouse etc.), defeated Part 1007 (including display, such as cathode-ray tube (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.), storage out Part 1008 (including hard disk etc.), communications portion 1009 (including network interface card such as LAN card, modem etc.).Communication Part 1009 executes communication process via network such as internet.As needed, driver 1010 can be connected to input/output Interface 1005.Detachable media 1011 such as disk, CD, magneto-optic disk, semiconductor memory etc., which can according to need, is pacified On driver 1010, so that the computer program read out can be mounted to as needed in storage section 1008.
It, can be from network such as internet or from storage medium example through the above-mentioned series of processes of software realization As detachable media 1011 installs the program of composition software.
It will be understood by those of skill in the art that this storage medium is not limited to shown in Fig. 10 wherein be stored with journey Sequence is separately distributed with equipment to provide a user the detachable media 1011 of program.The example packet of detachable media 1011 Containing disk (including floppy disk), CD (including compact disc read-only memory (CD-ROM) and digital versatile disc (DVD)), magneto-optic disk (packet (MD) containing mini-disk (registered trademark)) and semiconductor memory.Alternatively, storage medium can be ROM1002, storage section 1008 In include hard disk etc., wherein computer program stored, and user is distributed to together with the equipment comprising them.
In addition, the disclosure also proposed a kind of program product of instruction code for being stored with machine-readable.Described instruction When code is read and executed by machine, the above-mentioned information processing method according to the disclosure can be performed.Correspondingly, this for carrying The various storage mediums that the upper surface of program product is enumerated are also included in the scope of the present disclosure.
It is described in detail by block diagram, flow chart and/or embodiment above, illustrates the reality according to the disclosure Apply the device of mode and/or the specific embodiment of method.When these block diagrams, flow chart and/or embodiment include one or When multiple functions and/or operation, it will be obvious to those skilled in the art that each function in these block diagrams, flow chart and/or embodiment Can and/or operation can by various hardware, software, firmware or substantially they any combination individually and/or jointly Implement on ground.In one embodiment, several parts of theme described in this specification can pass through application-specific IC (ASIC), field programmable gate array (FPGA), digital signal processor (DSP) or other integrated forms are realized.However, ability The technical staff in domain is, it will be recognized that some aspects of embodiment described in this specification can be entirely or partly integrated In circuit in the form of the one or more computer programs run on one or more computers (for example, at one or The form of the one or more computer programs run in multiple computer systems), to run on the one or more processors One or more programs form (for example, with the shape of the one or more programs run in one or more microprocessors Formula), equally implement in the form of firmware or in the form of substantially their any combination, also, according in this specification Disclosure, designed for the disclosure circuit and/or write and be entirely for the software of the disclosure and/or the code of firmware Within the limit of power of those skilled in the art.
It should be emphasized that term "comprises/comprising" refers to the presence of feature, element, step or component when using herein, but simultaneously It is not excluded for the presence or additional of one or more other features, element, step or component.It is related to the term " first " of ordinal number, " second " etc. is not offered as the implementation sequence or importance degree of feature defined by these terms, element, step or component, And it is used between these features, element, step or component be identified for the sake of understanding just for the sake of description.
To sum up, according in embodiment of the present disclosure, present disclose provides following scheme, but not limited to this:
A kind of information processing unit of scheme 1., at the element sequence to several elements composition in element set Reason is to predict further element, and there are logical relation between the element in the element sequence, the information processing unit includes:
First predicting unit receives the element sequence and generates intermediate state and first in advance based on the element sequence Survey result;
One or more second predicting units, the number of one or more the second predicting unit correspond to described The number of element type in element set, for every kind of element type there are corresponding second predicting unit, described one A or more the second predicting unit receive the intermediate state and based on the intermediate state and with corresponding element class The relevant parameter of type generates one or more second prediction results;And
Determination unit receives first prediction result and one or more the second prediction result and is based on institute It states the first prediction result and one or more the second prediction result determines the further element.
The information processing unit as described in scheme 1 of scheme 2., wherein first predicting unit is remembered by shot and long term Network implementations.
The information processing unit as described in scheme 1 of scheme 3., wherein one or more the second predicting unit is logical Cross sparse attention network implementations.
Information processing unit of the scheme 4. as described in scheme 3, wherein in one or more the second predicting unit Parameter relevant with corresponding element type include for corresponding element type setting corresponding attention initial position and Attention length.
The information processing unit as described in scheme 1 of scheme 5., wherein the determination unit is according to first prediction result The further element is determined with the weight of one or more the second prediction result.
The information processing unit as described in scheme 1 of scheme 6., wherein the information processing unit can be based on existing member Prime sequences are trained to adjust the parameter of first predicting unit, second predicting unit and the determination unit.
The information processing unit as described in scheme 1 of scheme 7., wherein the element is the code code of computer programming language Piece, and the element sequence is the code snippet of computer programming language.
A kind of information processing method of scheme 8., at the element sequence to several elements composition in element set Reason is to predict further element, and there are logical relation between the element in the element sequence, the information processing method includes:
It receives the element sequence and intermediate state and the first prediction result is generated based on the element sequence;
For every kind of element type, receive the intermediate state and based on the intermediate state and with corresponding element The relevant parameter of type generates one or more second prediction results;And
Receive first prediction result and one or more the second prediction result and pre- based on described first It surveys result and one or more the second prediction result determines the further element.
Information processing method of the scheme 9. as described in scheme 8, wherein the parameter relevant with corresponding element type Including the corresponding attention initial position set for corresponding element type and attention length.
Scheme 10. is a kind of for recommending the method for code chip in programmed environment, and the method is by using such as scheme Information processing unit described in any one of 1-7 is realized.
A kind of computer readable storage medium of scheme 11., is stored thereon with computer program, the computer program is in quilt Computer makes the computer execute information processing method as claimed in claim 8 when executing.
Although being had been disclosed above by the description of the specific embodiment to the disclosure to the disclosure, The various of the disclosure are repaired it should be understood that those skilled in the art can design in the spirit and scope of the appended claims Change, improve or equivalent.These modifications, improvement or equivalent should also be as the protection scope for being to be considered as included in the disclosure It is interior.

Claims (10)

1. a kind of information processing unit, the element sequence for constituting to several elements in element set is handled to predict Further element, there are logical relation between the element in the element sequence, the information processing unit includes:
First predicting unit receives the element sequence and generates intermediate state and the first prediction knot based on the element sequence Fruit;
The number of one or more second predicting units, one or more the second predicting unit corresponds to the element The number of element type in set, for every kind of element type there are corresponding second predicting unit, it is one or More second predicting units receive the intermediate state and based on the intermediate state and with corresponding element type phase The parameter of pass generates one or more second prediction results;And
Determination unit receives first prediction result and one or more the second prediction result and based on described the One prediction result and one or more the second prediction result determine the further element.
2. information processing unit as described in claim 1, wherein first predicting unit is by shot and long term memory network It realizes.
3. information processing unit as described in claim 1, wherein one or more the second predicting unit is by dilute Dredge attention network implementations.
4. information processing unit as claimed in claim 3, wherein in one or more the second predicting unit with phase The relevant parameter of the element type answered includes the corresponding attention initial position and attention for the setting of corresponding element type Power length.
5. information processing unit as described in claim 1, wherein the determination unit is according to first prediction result and institute The weight for stating one or more second prediction results determines the further element.
6. information processing unit as described in claim 1, wherein the information processing unit can be based on existing element sequence Column are trained to adjust the parameter of first predicting unit, second predicting unit and the determination unit.
7. information processing unit as described in claim 1, wherein the element is the code chip of computer programming language, And the element sequence is the code snippet of computer programming language.
8. a kind of information processing method, the element sequence for constituting to several elements in element set is handled to predict Further element, there are logical relation between the element in the element sequence, the information processing method includes:
It receives the element sequence and intermediate state and the first prediction result is generated based on the element sequence;
For every kind of element type, receive the intermediate state and based on the intermediate state and with corresponding element type Relevant parameter generates one or more second prediction results;And
Receive first prediction result and one or more the second prediction result and based on the first prediction knot Fruit and one or more the second prediction result determine the further element.
9. information processing method as claimed in claim 8, wherein the parameter relevant with corresponding element type includes Corresponding attention initial position and attention length for the setting of corresponding element type.
10. a kind of for recommending the method for code chip in programmed environment, the method is by using in such as claim 1-7 Described in any item information processing units are realized.
CN201711328030.5A 2017-12-13 2017-12-13 Information processing apparatus and method, and method of recommending code in programming environment Active CN109918058B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711328030.5A CN109918058B (en) 2017-12-13 2017-12-13 Information processing apparatus and method, and method of recommending code in programming environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711328030.5A CN109918058B (en) 2017-12-13 2017-12-13 Information processing apparatus and method, and method of recommending code in programming environment

Publications (2)

Publication Number Publication Date
CN109918058A true CN109918058A (en) 2019-06-21
CN109918058B CN109918058B (en) 2022-08-12

Family

ID=66958735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711328030.5A Active CN109918058B (en) 2017-12-13 2017-12-13 Information processing apparatus and method, and method of recommending code in programming environment

Country Status (1)

Country Link
CN (1) CN109918058B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303731A (en) * 2023-05-22 2023-06-23 四川互慧软件有限公司 Code matching method and device for hospital standard main data and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140016719A (en) * 2012-07-31 2014-02-10 이선아 Method for contextual code collection recommanation associated with user interation and program coding apparatus using the same
WO2014099828A1 (en) * 2012-12-19 2014-06-26 Microsoft Corporation Test scope determination based on code change(s)
CN104765728A (en) * 2014-01-08 2015-07-08 富士通株式会社 Method and device for training neural network and method for determining sparse feature vector
CN106462399A (en) * 2014-06-30 2017-02-22 微软技术许可有限责任公司 Code recommendation
CN106710596A (en) * 2016-12-15 2017-05-24 腾讯科技(上海)有限公司 Answer statement determination method and device
CN107066973A (en) * 2017-04-17 2017-08-18 杭州电子科技大学 A kind of video content description method of utilization spatio-temporal attention model
US20170323198A1 (en) * 2016-05-03 2017-11-09 Fujitsu Limited Neural network mapping dictionary generation
CN107463683A (en) * 2017-08-09 2017-12-12 上海壹账通金融科技有限公司 The naming method and terminal device of code element

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140016719A (en) * 2012-07-31 2014-02-10 이선아 Method for contextual code collection recommanation associated with user interation and program coding apparatus using the same
WO2014099828A1 (en) * 2012-12-19 2014-06-26 Microsoft Corporation Test scope determination based on code change(s)
CN104765728A (en) * 2014-01-08 2015-07-08 富士通株式会社 Method and device for training neural network and method for determining sparse feature vector
CN106462399A (en) * 2014-06-30 2017-02-22 微软技术许可有限责任公司 Code recommendation
US20170323198A1 (en) * 2016-05-03 2017-11-09 Fujitsu Limited Neural network mapping dictionary generation
CN106710596A (en) * 2016-12-15 2017-05-24 腾讯科技(上海)有限公司 Answer statement determination method and device
CN107066973A (en) * 2017-04-17 2017-08-18 杭州电子科技大学 A kind of video content description method of utilization spatio-temporal attention model
CN107463683A (en) * 2017-08-09 2017-12-12 上海壹账通金融科技有限公司 The naming method and terminal device of code element

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
郭源生等: "《智慧医疗与健康养老》", 30 September 2017, 中国科学技术出版社 *
高原: ""基于代码库和特征匹配的函数名称推荐方法"", 《软件学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303731A (en) * 2023-05-22 2023-06-23 四川互慧软件有限公司 Code matching method and device for hospital standard main data and electronic equipment
CN116303731B (en) * 2023-05-22 2023-07-21 四川互慧软件有限公司 Code matching method and device for hospital standard main data and electronic equipment

Also Published As

Publication number Publication date
CN109918058B (en) 2022-08-12

Similar Documents

Publication Publication Date Title
CN111125331B (en) Semantic recognition method, semantic recognition device, electronic equipment and computer readable storage medium
CN104598611B (en) The method and system being ranked up to search entry
CN108133038A (en) A kind of entity level emotional semantic classification system and method based on dynamic memory network
US8190537B1 (en) Feature selection for large scale models
CN108062388A (en) Interactive reply generation method and device
CN108701253A (en) The target output training neural network of operating specification
CN105893476A (en) Intelligent questioning and answering method, knowledge base optimization method and device, and intelligent knowledge base
CN110619044B (en) Emotion analysis method, system, storage medium and equipment
US10482185B1 (en) Methods and arrangements to adjust communications
CN106909931A (en) A kind of feature generation method for machine learning model, device and electronic equipment
CN107861954A (en) Information output method and device based on artificial intelligence
CN112507209B (en) Sequence recommendation method for knowledge distillation based on land moving distance
CN112465226B (en) User behavior prediction method based on feature interaction and graph neural network
Mukunthu et al. Practical automated machine learning on Azure: using Azure machine learning to quickly build AI solutions
CN112101039A (en) Learning interest discovery method for online learning community
CN113312480A (en) Scientific and technological thesis level multi-label classification method and device based on graph convolution network
CN111309975A (en) Method and system for enhancing attack resistance of graph model
Krantsevich et al. Stochastic tree ensembles for estimating heterogeneous effects
CN114372475A (en) Network public opinion emotion analysis method and system based on RoBERTA model
Ayyadevara Neural Networks with Keras Cookbook: Over 70 recipes leveraging deep learning techniques across image, text, audio, and game bots
Rai Advanced deep learning with R: Become an expert at designing, building, and improving advanced neural network models using R
CN109918058A (en) Information processing unit and method and the method for recommending code in programmed environment
Khoshnevis et al. Application of pool‐based active learning in physics‐based earthquake ground‐motion simulation
CN116756281A (en) Knowledge question-answering method, device, equipment and medium
US20180247246A1 (en) Method and system for the construction of dynamic, non-homogeneous b2b or b2c networks

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
GR01 Patent grant
GR01 Patent grant