Skip to content

Repository files navigation

Instruction to train word2vec model

python Main_Word2Vec.py --vocab_file_path="vocab/word2vec.vocabulary.txt" --vector_length=32 --model_dir="model" --model_name="w2v"

The vocab file can be downloaded here

You can used our pre-trained model

Instruction to embed features of nodes and edges of the graphs

python Main_Graph_Embedding.py --node_graph_dir="/Users/nguyenbinhminh/MasterUET/Thesis/code-smell-classifier/data-graph/positive/node" --edge_graph_dir="/Users/nguyenbinhminh/MasterUET/Thesis/code-smell-classifier/data-graph/positive/edge" --label=1 --embedding_graph_dir="/Users/nguyenbinhminh/MasterUET/Thesis/code-smell-classifier/data-graph/embedding"

You can used our embedded graphs

Instruction to train and test GNN models

python Main_VULJIT_Detection.py --graph_dir='/Users/nguyenbinhminh/MasterUET/Thesis/code-smell-classifier/data-graph/embedding'  --train_file='/Users/nguyenbinhminh/MasterUET/Thesis/code-smell-classifier/data-graph/train_test_split/train.txt' --test_file='/Users/nguyenbinhminh/MasterUET/Thesis/code-smell-classifier/data-graph/train_test_split/test.txt'  --model_dir='Model'  --model_name="rgcn"

Download the commit ids in the training and testing sets from here

In order to train GNN models, you need to install the required libraries such as torch and pytorch_geometrics

# Install required packages.
import os
import torch
os.environ['TORCH'] = torch.__version__
print(torch.__version__)

!pip install -q torch-scatter -f https://data.pyg.org/whl/torch-${TORCH}.html
!pip install -q torch-sparse -f https://data.pyg.org/whl/torch-${TORCH}.html
!pip install -q git+https://github.com/pyg-team/pytorch_geometric.git

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages