Algorithm
Overview
The Algorithm services provide mathematical and ML-based computation used across the application — primarily by the Assistant chatbot for text similarity scoring.
Available Algorithms
| Algorithm | Description |
|---|---|
| CosineSimilarity | Measures cosine angle between two TF-IDF vectors. Returns 0–1. |
| JaccardSimilarity | Token set intersection divided by union. Simple overlap measure. |
| TFIDF | Term Frequency-Inverse Document Frequency vectorizer for text. |
| EuclidianDistance | Straight-line distance between two vectors. |
| SectionClassifier | Classifies text into predefined sections using pattern matching. |
| LineClassifier | Classifies individual lines of text into categories. |
| Bert | BERT-like semantic similarity (simulated fallback when no external model is connected). |
Key Files
app/Services/Algorithm/
├── CosineSimilarity.php
├── JaccardSimilarity.php
├── TFIDF.php
├── EuclidianDistance.php
├── SectionClassifier.php
├── SectionDataset.php
├── LineClassifier.php
└── Bert.php