Metadata-Version: 2.1
Name: graphsense
Version: 0.0.1
Summary: graphsense is a library to train and infer graph embedding based code completion models
Home-page: https://github.com/NavodPeiris/graphsense
Author: Navod Peiris
Author-email: navodpeiris1234@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

### Requirements

* Python 3.8 or greater


### installation:
```
pip install graphsense
```


### Training example:

```
from graphsense import GraphSense

g = GraphSense()

g.line_completion(input_path="code_files", output_path="output")

```

### Inference example:

```
from graphsense import GraphSense

g = GraphSense()

g.load_model("output/graph_embeddings.model")
next = g.infer("def factorial(n):")

print("next item predicted: ", next)
```

### Performance Comparison with gpt2_medium finetuned model
Dataset used to train models: https://github.com/TheAlgorithms/Python 
#### gpt2_medium finetuned model
```
input: def factorial(n)  
output: return 1 if n == 1 else n * factorial(n - 1)   
model size: 1.44GB   
avg inference time: 10.3302 seconds  
CPU Usage: 8.3%  
Memory Usage: 68.54 MB  
```

#### graph embedding model 
```
input: def factorial(n)  
output: return 1 if n == 1 else n * factorial(n - 1)   
model size: 13.2MB
avg inference time: 2.1870 seconds  
CPU Usage: 0.2%
Memory Usage: 4.54 MB  
``` 
