Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/concerns/alegre_similarity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def get_threshold_hash_from_threshold(threshold)
end

def get_min_es_score(team_id)
self.get_alegre_tbi(team_id)&.get_min_es_score || Bot::Alegre::DEFAULT_ES_SCORE
RequestStore.store.dig(:smooch_bot_settings,"min_es_score") || self.get_alegre_tbi(team_id)&.get_min_es_score || Bot::Alegre::DEFAULT_ES_SCORE
end

def similar_texts_from_api_conditions(text, models, fuzzy, team_id, fields, threshold, match_across_content_types=true)
Expand Down
3 changes: 2 additions & 1 deletion app/models/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def recalculate_media_type
def text_similarity_settings
{
::Bot::Alegre::ELASTICSEARCH_MODEL => { 'threshold' => 0.85, 'min_words' => 4 },
::Bot::Alegre::MEAN_TOKENS_MODEL => { 'threshold' => 0.9, 'min_words' => 2 }
::Bot::Alegre::MEAN_TOKENS_MODEL => { 'threshold' => 0.9, 'min_words' => 2 },
::Bot::Alegre::PARAPHRASE_MULTILINGUAL_MODEL => { 'threshold' => 0.875, 'min_words' => 2 }
}
end

Expand Down