ryderling / DGMS

Code for "Deep Graph Matching and Searching for Semantic Code Retrieval"
24 stars 7 forks source link

How to get code graph and text graph? #5

Open skye95git opened 2 years ago

skye95git commented 2 years ago

Thank you for this awesome work. I have a few question about the graph data.

  1. The data stored in Baidu's web disk is Graph representation. How can I get the raw data of code graph and text graph?

  2. How do you get the code graph from source code? Do you have any plans to open source of generating graph code? The code you give in other answers seems to get the tree from the graph: https://github.com/IBM/Graph2Tree

  3. The SampledDatasets/java/code_processed/code_100000.pt save each graph representation with torch_geometric.data.Data (PyTorch_Geometric). How do you get each graph representation with torch_geometric.data.Data (PyTorch_Geometric)? As far as know, constructing a graph using torch_geometric.data. data requires specifying node feature x. How do you set node feature x for token in AST? Whether the code generated code.pt is easy to share?

    data = Data(x=x, edge_index=edge_index)
    捕获
  4. How can I see the data in SampledDatasets/java/code_processed/code_100000.pt? When I run

    data = torch.load('DGMS/SampledDatasets/python/code_processed/code_100000.pt')
    print(data)

    there is an error The 'data' object was created by an older version of PyG. If this error occurred while loading an already existing dataset, remove the 'processed/' directory in the dataset's root folder and try again.

isHuangXin commented 2 years ago

there is an error The 'data' object was created by an older version of PyG. If this error occurred while loading an already existing dataset, remove the 'processed/' directory in the dataset's root folder and try again.

I have the same problem, have you solved it? Thanks a lot.