From fb20c3ab1b6efadcc6e29121f4e9e3eb71631e08 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Sun, 15 Feb 2026 20:29:17 +0000 Subject: [PATCH] perf: use lighter topic model --- server/app.py | 2 +- server/nlp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/app.py b/server/app.py index 36f3ac5..92a9810 100644 --- a/server/app.py +++ b/server/app.py @@ -12,7 +12,7 @@ app = Flask(__name__) CORS(app, resources={r"/*": {"origins": "http://localhost:5173"}}) # Global State -posts_df = pd.read_json('posts_test.jsonl', lines=True) +posts_df = pd.read_json('posts.jsonl', lines=True) with open("topic_buckets.json", "r", encoding="utf-8") as f: domain_topics = json.load(f) stat_obj = StatGen(posts_df, domain_topics) diff --git a/server/nlp.py b/server/nlp.py index 98a7d54..379d918 100644 --- a/server/nlp.py +++ b/server/nlp.py @@ -63,7 +63,7 @@ class NLP: def _get_topic_model(cls, device_str: str) -> SentenceTransformer: model = cls._topic_models.get(device_str) if model is None: - model = SentenceTransformer("all-mpnet-base-v2", device=device_str) + model = SentenceTransformer("all-MiniLM-L6-v2", device=device_str) cls._topic_models[device_str] = model return model