final tweaks

This commit is contained in:
2025-12-17 01:37:42 -08:00
parent 417273c745
commit 069e568d00

View File

@@ -161,7 +161,7 @@ def _(KEYWORD_FREQ_FPATH, mo):
return
@app.cell
@app.cell(hide_code=True)
def _(OLLAMA_LOCATION, connect_qumo_ollama, mo):
try:
client, _models = connect_qumo_ollama(OLLAMA_LOCATION, print_models=False)
@@ -188,7 +188,7 @@ def _(mo, model_select, start_processing_btn, tag_select):
return
@app.cell
@app.cell(hide_code=True)
def _(client, mo, model_select, pd, start_processing_btn, tags_df):
from utils import ollama_keyword_extraction, worker_extraction
# Wait for start processing button
@@ -295,23 +295,22 @@ def _(
_fdf.reset_index(drop=True, inplace=True)
print(f"Loaded `{KEYWORD_FREQ_FPATH}` successfully.")
if tag_select.value.startswith('V'):
# Read exclusion list
excl_kw = []
with VOICE_EXCLUDE_KEYWORDS_FILE.open('r') as _f:
for line in _f:
excl_kw.append(line.strip())
_drop_idx = _fdf[_fdf['keyword'].isin(excl_kw)].index
_fdf.drop(index=_drop_idx, inplace=True, axis=0)
print(f"Dropped {len(_drop_idx)} keywords automatically")
frequency_df = _fdf
else:
frequency_df = freq_df
if tag_select.value.startswith('V'):
# Read exclusion list
excl_kw = []
with VOICE_EXCLUDE_KEYWORDS_FILE.open('r') as _f:
for line in _f:
excl_kw.append(line.strip())
_drop_idx = frequency_df[frequency_df['keyword'].isin(excl_kw)].index
frequency_df.drop(index=_drop_idx, inplace=True, axis=0)
print(f"Dropped {len(_drop_idx)} keywords automatically")
return (frequency_df,)