Skip to content

How to get code graph and text graph? #5

@skye95git

Description

@skye95git

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)

捕获

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions