feat: add nlp topic processing

This commit is contained in:
2026-02-05 17:23:25 +00:00
parent d4db7bec24
commit ba1501e493
2 changed files with 21 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ import datetime
from nltk.corpus import stopwords
from collections import Counter
from server.nlp_processor import add_emotion_cols
from server.nlp_processor import add_emotion_cols, add_topic_col
DOMAIN_STOPWORDS = {
"www", "https", "http",
@@ -41,7 +41,7 @@ class StatGen:
df["weekday"] = df["dt"].dt.day_name()
add_emotion_cols(df, "content")
add_topic_col(df, "content")
def _tokenize(self, text: str):
tokens = re.findall(r"\b[a-z]{3,}\b", text)