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 return
@app.cell @app.cell(hide_code=True)
def _(OLLAMA_LOCATION, connect_qumo_ollama, mo): def _(OLLAMA_LOCATION, connect_qumo_ollama, mo):
try: try:
client, _models = connect_qumo_ollama(OLLAMA_LOCATION, print_models=False) client, _models = connect_qumo_ollama(OLLAMA_LOCATION, print_models=False)
@@ -188,7 +188,7 @@ def _(mo, model_select, start_processing_btn, tag_select):
return return
@app.cell @app.cell(hide_code=True)
def _(client, mo, model_select, pd, start_processing_btn, tags_df): def _(client, mo, model_select, pd, start_processing_btn, tags_df):
from utils import ollama_keyword_extraction, worker_extraction from utils import ollama_keyword_extraction, worker_extraction
# Wait for start processing button # Wait for start processing button
@@ -294,24 +294,23 @@ def _(
_fdf.sort_values(by='frequency', ascending=False, inplace=True) _fdf.sort_values(by='frequency', ascending=False, inplace=True)
_fdf.reset_index(drop=True, inplace=True) _fdf.reset_index(drop=True, inplace=True)
print(f"Loaded `{KEYWORD_FREQ_FPATH}` successfully.") 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 frequency_df = _fdf
else: else:
frequency_df = freq_df 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,) return (frequency_df,)