Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/improved categories #37

Merged
merged 19 commits into from
Jul 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b3aee47
feat: first category draft
KaiserRuben Jun 27, 2024
3c68f11
Enum Renaming (vulnerability-reporting): Replaced enums to provide mo…
KaiserRuben Jun 28, 2024
f7b0796
refactor: added todos and newlines
KaiserRuben Jun 28, 2024
0c01fa4
Merge branch 'refs/heads/main' into feat/improved_categories
KaiserRuben Jul 4, 2024
034d9bb
feat: category class with str and to_dict
KaiserRuben Jul 4, 2024
8ac897a
feat: adapted class for new category (scheme), removed unused Finding…
KaiserRuben Jul 4, 2024
3590442
feat(LLM service): classify_kind now takes field_name and options par…
KaiserRuben Jul 4, 2024
d59d97f
feat(findings): Improved classification & recommendation logic: Added…
KaiserRuben Jul 4, 2024
9f77adc
feat: Added {field_name} placeholder to classify templates for more f…
KaiserRuben Jul 4, 2024
59b0eb0
feat(Categories.py in src/data/): Enhance categorization with new sec…
KaiserRuben Jul 13, 2024
687d07c
Merge branch 'refs/heads/main' into feat/improved_categories
KaiserRuben Jul 13, 2024
f36cef1
fix(Environment): Removed unnecessary Ω symbol
KaiserRuben Jul 13, 2024
fa65c97
feat(Finding): Introducing support for unsupervised clustering
KaiserRuben Jul 13, 2024
4caed98
feat(unsupervised clustering): Added to notebooks
KaiserRuben Jul 13, 2024
dda0835
fix: removed unused import
KaiserRuben Jul 14, 2024
75e5c32
feat: Added 'category' field to Finding model
KaiserRuben Jul 14, 2024
f40fbce
feat: Added sentence_transformers, kneed, and scikit-learn to enable …
KaiserRuben Jul 14, 2024
5b0effd
feat: Added plotly to requirements.txt
KaiserRuben Jul 14, 2024
fb373f9
feat: Added pandas to requirements.txt
KaiserRuben Jul 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(LLM service): classify_kind now takes field_name and options par…
…ams for nuanced classification enhancements
KaiserRuben committed Jul 4, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
KaiserRuben Ruben Kaiser
commit 3590442aba163be0d2a00d773de8e7a033ecf0a9
33,621 changes: 0 additions & 33,621 deletions data/Dataset.json

This file was deleted.

5 changes: 3 additions & 2 deletions src/ai/LLM/BaseLLMService.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from abc import ABC, abstractmethod
from enum import Enum
from typing import Dict, Optional, List, Union

from data.Finding import Finding, FindingKind
from data.Finding import Finding


class BaseLLMService(ABC):
@@ -18,7 +19,7 @@ def generate(self, prompt: str) -> Dict[str, str]:
pass

@abstractmethod
def classify_kind(self, finding: Finding, options: Optional[List[FindingKind]] = None) -> FindingKind:
def classify_kind(self, finding: Finding, field_name: str, options: List[Enum]) -> Optional[Enum]:
pass

@abstractmethod
7 changes: 4 additions & 3 deletions src/ai/LLM/LLMServiceStrategy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from enum import Enum
from typing import Dict, Optional, List

from ai.LLM.BaseLLMService import BaseLLMService
from data.Finding import Finding, FindingKind
from data.Finding import Finding


class LLMServiceStrategy:
@@ -14,8 +15,8 @@ def generate(self, prompt: str) -> Dict[str, str]:
def get_url(self) -> str:
return self.llm_service.get_url()

def classify_kind(self, finding: Finding, options: Optional[List[FindingKind]] = None) -> FindingKind:
return self.llm_service.classify_kind(finding, options)
def classify_kind(self, finding: Finding, field_name: str, options: List[Enum]) -> Optional[Enum]:
return self.llm_service.classify_kind(finding, field_name, options)

def get_recommendation(self, finding: Finding, short: bool = True) -> str:
return self.llm_service.get_recommendation(finding, short)