😄 For fun: MBTI Translator - Infer probable MBTI from your sentence, using zero-shot NLI model.
- Please give a sentence as a input
- If possible, give a sentence which could imply your 'type' indicator
Input: "I stayed home all day"
===
Output:
You are: ISFP
Ratio {'E': 27.338588094108168, 'I': 72.66141190589182} {'N': 22.149243913056992, 'S': 77.85075608694301} {'T': 46.17274433748438, 'F': 53.82725566251562} {'P': 57.30466611213056, 'J': 42.69533388786944}
Input: "I'm making plans for my trip to Osaka. I'm so excited!"
===
Output:
You are: ESTJ
Ratio {'E': 71.53464326345417, 'I': 28.46535673654582} {'N': 35.33135528913844, 'S': 64.66864471086156} {'T': 58.70273162646018, 'F': 41.29726837353982} {'P': 46.96476087995551, 'J': 53.03523912004449}
- Model: https://huggingface.co/facebook/bart-large-mnli
- Using Zero-shot text classification model
- required to setup torch & transformer library. Pleaase setup virtual environment
-
02.20 update: Highly recommend using requirement.txt to enable frontend UI using streamlit
pip install -r requirements.txt
- For torch & transformer evironment setting, please refer to: https://pytorch.org
pip install transformers
- About Zero-shot model: https://joeddav.github.io/blog/2020/05/29/ZSL.html
- Zero-shot text classification model get texts & set of labels as input
- It outputs probability of the text is related to each of the labels