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
#!/usr/bin/env python | |
""" | |
Bert similarity script. | |
Save this file as bert_similarity.py and then run like this: | |
python bert_similarity.py rank --query "open source" "linux" "windows" "mac os" | |
And get a result like this: | |
{'similarity': 0.5847581, 'text': 'linux'} | |
{'similarity': 0.52185637, 'text': 'windows'} |
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
PROMPT="%F{magenta}\$?" | |
PROMPT=$PROMPT"%F{red}|%F{cyan}\${timer_show}%F{red}" | |
PROMPT=$PROMPT"%F{red}|%F{green}\$(date "+%H:%M:%S" )" | |
PROMPT=$PROMPT"%F{red}|%F{yellow}%~" | |
PROMPT=$PROMPT"%F{red}|%F{blue}\$(git rev-parse --short HEAD 2> /dev/null | tr -d \\n )" | |
PROMPT=$PROMPT"%F{red}|%F{blue}\$(git rev-parse --abbrev-ref HEAD 2> /dev/null | tr -d \\n)" | |
PROMPT=$PROMPT'%F{red}>%f ' | |
setopt prompt_subst |