Sonnyjim commited on
Commit
0b7839c
1 Parent(s): 81f1b56

Changed zero shot min similarity to 0.5

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. funcs/representation_model.py +3 -0
app.py CHANGED
@@ -185,7 +185,7 @@ def extract_topics(in_files, in_file, min_docs_slider, in_colnames, max_topics_s
185
  min_topic_size = min_docs_slider,
186
  nr_topics = max_topics_slider,
187
  zeroshot_topic_list = zero_shot_topics_lower,
188
- zeroshot_min_similarity = 0.7,
189
  representation_model=representation_model,
190
  verbose = True)
191
 
 
185
  min_topic_size = min_docs_slider,
186
  nr_topics = max_topics_slider,
187
  zeroshot_topic_list = zero_shot_topics_lower,
188
+ zeroshot_min_similarity = 0.5,#0.7,
189
  representation_model=representation_model,
190
  verbose = True)
191
 
funcs/representation_model.py CHANGED
@@ -118,6 +118,8 @@ llm_config = LLamacppInitConfigGpu(last_n_tokens_size=last_n_tokens_size,
118
  ## Create representation model parameters ##
119
  # KeyBERT
120
  keybert = KeyBERTInspired(random_state=random_seed)
 
 
121
 
122
  def create_representation_model(create_llm_topic_labels, llm_config, hf_model_name, hf_model_file, chosen_start_tag):
123
 
@@ -141,6 +143,7 @@ def create_representation_model(create_llm_topic_labels, llm_config, hf_model_na
141
 
142
  elif create_llm_topic_labels == "No":
143
  representation_model = {"KeyBERT": keybert}
 
144
 
145
  # Deprecated example using CTransformers. This package is not really used anymore
146
  #model = AutoModelForCausalLM.from_pretrained('NousResearch/Nous-Capybara-7B-V1.9-GGUF', model_type='mistral', model_file='Capybara-7B-V1.9-Q5_K_M.gguf', hf=True, **vars(llm_config))
 
118
  ## Create representation model parameters ##
119
  # KeyBERT
120
  keybert = KeyBERTInspired(random_state=random_seed)
121
+ # MMR
122
+ mmr = MaximalMarginalRelevance(diversity=0.3)
123
 
124
  def create_representation_model(create_llm_topic_labels, llm_config, hf_model_name, hf_model_file, chosen_start_tag):
125
 
 
143
 
144
  elif create_llm_topic_labels == "No":
145
  representation_model = {"KeyBERT": keybert}
146
+ #representation_model = {"mmr": mmr}
147
 
148
  # Deprecated example using CTransformers. This package is not really used anymore
149
  #model = AutoModelForCausalLM.from_pretrained('NousResearch/Nous-Capybara-7B-V1.9-GGUF', model_type='mistral', model_file='Capybara-7B-V1.9-Q5_K_M.gguf', hf=True, **vars(llm_config))