Skip to content

AI powered OSINT engine to discover and map 840+ social media identities across the web

fix issue

arxhr0070c58ba188e6e
diff --git a/src/aliens_eye/core/analyzer.py b/src/aliens_eye/core/analyzer.py
index 48fdcb1..af5dcd5 100644
--- a/src/aliens_eye/core/analyzer.py
+++ b/src/aliens_eye/core/analyzer.py
@@ -1,4 +1,3 @@
-import json
import re
from dataclasses import dataclass
from typing import Any
@@ -6,8 +5,6 @@ from urllib.parse import urlparse
from selectolax.parser import HTMLParser
-_JSON_LD_PERSON_RE = re.compile(r'"@type"\s*:\s*"Person"', re.IGNORECASE)
-
from .config import (
AUTH_PATTERNS,
ERROR_CLASS_HINTS,
@@ -17,6 +14,8 @@ from .config import (
PROFILE_CLASS_HINTS,
)
+_JSON_LD_PERSON_RE = re.compile(r'"@type"\s*:\s*"Person"', re.IGNORECASE)
+
@dataclass
class FeatureBundle:
diff --git a/src/aliens_eye/ml/train.py b/src/aliens_eye/ml/train.py
index 5209098..4b2effe 100644
--- a/src/aliens_eye/ml/train.py
+++ b/src/aliens_eye/ml/train.py
@@ -36,7 +36,7 @@ def load_dataset(path: Path) -> tuple[list[list[float]], list[int]]:
def _optimize_thresholds(
- y: "np.ndarray", probas: "np.ndarray"
+ y: list[int], probas: list[float]
) -> tuple[float, float]:
"""Find Found/NotFound thresholds that maximise F1 on the training set."""
from sklearn.metrics import precision_recall_curve
@@ -104,7 +104,10 @@ def train_model(dataset_path: Path, output_path: Path, logger=None) -> dict:
# Blend weight optimisation via OOF (out-of-fold) predictions.
# heuristic_score is stored as a feature; derive heuristic_prob from it.
h_idx = FEATURE_SCHEMA.index("heuristic_score")
- _sig = lambda z: 1.0 / (1.0 + math.exp(-max(-50.0, min(50.0, z / 6.0))))
+
+ def _sig(z: float) -> float:
+ return 1.0 / (1.0 + math.exp(-max(-50.0, min(50.0, z / 6.0))))
+
oof_h = np.array([_sig(float(row[h_idx])) for row in X_list])
oof_ml = np.zeros(len(y))
if min_class >= 2: