cleanup notebook and make usable
This commit is contained in:
@@ -2,4 +2,4 @@ from .ollama_utils import connect_qumo_ollama
|
||||
from .data_utils import create_sentiment_matrix, extract_theme
|
||||
from .transcript_utils import load_srt, csv_to_markdown, cpc_smb_to_markdown
|
||||
from .sentiment_analysis import dummy_sentiment_analysis, ollama_sentiment_analysis
|
||||
from .keyword_analysis import ollama_keyword_extraction, worker_extraction
|
||||
from .keyword_analysis import ollama_keyword_extraction, worker_extraction, blue_color_func
|
||||
|
||||
@@ -2,6 +2,23 @@ import pandas as pd
|
||||
|
||||
from ollama import Client
|
||||
import json
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
import random
|
||||
import matplotlib.colors as mcolors
|
||||
|
||||
def blue_color_func( word, font_size, position, orientation, random_state=None, **kwargs):
|
||||
# Use the provided random_state for reproducibility if available, else use random module
|
||||
r = random_state if random_state else random
|
||||
|
||||
# Sample from the darker end of the 'Blues' colormap (e.g., 0.4 to 1.0)
|
||||
# 0.0 is white/light, 1.0 is dark blue
|
||||
min_val, max_val = 0.4, 1.0
|
||||
color_val = r.uniform(min_val, max_val)
|
||||
|
||||
# Get color from matplotlib colormap
|
||||
rgba = plt.cm.Blues(color_val)
|
||||
return mcolors.to_hex(rgba)
|
||||
|
||||
|
||||
def worker_extraction(row, host, model):
|
||||
|
||||
Reference in New Issue
Block a user