|
ArKanjo 0.5.1
A tool for find code duplicated functions in codebases
|
Semantic duplication detector using LLM embeddings. More...
#include <embedding_method.hpp>
Inheritance diagram for EmbeddingMethod:
Collaboration diagram for EmbeddingMethod:Public Member Functions | |
| EmbeddingMethod (const fs::path &base_path_, double similarity_, std::vector< std::string > pass_through_args_={}) | |
| Constructs the LLM detector. More... | |
| void | on_function (const FunctionData &fd) override |
| void | execute () override |
Public Member Functions inherited from IMethod | |
| virtual | ~IMethod ()=default |
| virtual void | save_duplications (std::vector< DuplicationEntry > &) |
| Output line format: More... | |
| virtual void | on_function (const FunctionData &fd)=0 |
| virtual void | execute ()=0 |
Semantic duplication detector using LLM embeddings.
Materializes each function body as a file under the source feature directory (same as the other methods), then invokes a Python script that embeds every function with a Hugging Face model and prints the pairwise similarities, which are parsed back into duplication entries.
Definition at line 29 of file embedding_method.hpp.
| EmbeddingMethod::EmbeddingMethod | ( | const fs::path & | base_path_, |
| double | similarity_, | ||
| std::vector< std::string > | pass_through_args_ = {} |
||
| ) |
Constructs the LLM detector.
| base_path_ | Root path of the codebase cache. |
| similarity_ | Minimum similarity threshold (0-100) to consider as duplicate. |
| pass_through_args_ | Raw arguments forwarded to the embedding script (e.g. –max-seq-length, –batch-size, –model). |
Definition at line 17 of file embedding_method.cpp.
|
overridevirtual |
Implements IMethod.
Definition at line 116 of file embedding_method.cpp.
|
overridevirtual |
Implements IMethod.
Definition at line 103 of file embedding_method.cpp.