microsoft / CodeBERT

CodeBERT
MIT License
2.16k stars 446 forks source link

Clarification about DFG extraction #199

Closed imamnurby closed 1 year ago

imamnurby commented 1 year ago

Dear authors,

Thank you for your amazing work! I have 2 questions regarding the result of DFG extraction:

  1. The result of calling extract dataflow function is a list of identifiers and a list tuple where each tuple consists of 5 elements. I would like to clarify what is element 1, 2, 3, and 4, 5 in the resulted tuple?
  2. When instantiating InputFeatures object inside convert_examples_to_features function, could you elaborate what is dfg_to_dfg and dfg_to_code?

Thank you!

guoday commented 1 year ago
  1. (subject, subject index, relation, a list of objects, a list of objects index)
  2. dfg_to_dfg and dfg_to_code are adjacency matrices of DFG. dfg_to_dfg is the adjacency matrix between nodes in DFG. dfg_to_code is the adjacency matrix between node in DFG and code in input sequence.
imamnurby commented 1 year ago

@guoday Thanks for your prompt response.

May I clarify again, in (subject, subject index, relation, a list of objects, a list of objects index), is the list of objects corresponds to the source where the subject is computed or comes from?

This is an example of input and output that I got from your code. Input

public ListSpeechSynthesisTasksResult listSpeechSynthesisTasks(ListSpeechSynthesisTasksRequest request) {
            request = beforeClientExecution(request);
            return executeListSpeechSynthesisTask (request);
        }

Output

[('request', 6, 'comesFrom', [], []), 
('request', 9, 'computedFrom', ['beforeClientExecution'], [11]), 
('request', 9, 'computedFrom', ['request'], [13]), 
('beforeClientExecution', 11, 'comesFrom', [], []), 
('request', 13, 'comesFrom', ['request'], [6]), 
('request', 19, 'comesFrom', ['request'], [9])]
guoday commented 1 year ago

Yes.