This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am alabama on github. | |
* I am kandakov (https://keybase.io/kandakov) on keybase. | |
* I have a public key ASBr-TALrXb--6zan3Vt9AfsrTGG6TimzAK-lFA2jhJnrgo | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# we can improve top keywords, if we cache (write into keyword table) the count of the messages | |
def top_theme_suggestion_keywords(project_id, filters) do | |
similar_keyword_preloader = fn keyword_ids -> | |
# gets all grouped keywords from the given keyword_ids which have a cosine_similarity > 0.3 | |
# returns a list with the id in keywords_ids and the id of the grouped keyword as well as the vector_norm of that | |
# eg: | |
# id1, id45, [vector_of_45] | |
# id1, id84, [vector_of_84] | |
# id1, id32, [vector_of_32] | |
# id2, id33, [vector_of_33] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for simple type checks: the given array should only have string values | |
$aTypes = array_map( "gettype", $aArray ); //we fill an type array with all types we find in the content array | |
$aTypes = array_unique( $aTypes ); // we unique the found types | |
return count( $aTypes ) === 1 && $aTypes[0] === "string"; |