Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
---
|
| 5 |
+
license: mit
|
| 6 |
+
language: en
|
| 7 |
+
tags:
|
| 8 |
+
- sklearn
|
| 9 |
+
- text-classification
|
| 10 |
+
- psychology
|
| 11 |
+
- mbti
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# MBTI Personality Predictor
|
| 15 |
+
|
| 16 |
+
This repository contains scikit-learn models for predicting MBTI personality types from text.
|
| 17 |
+
|
| 18 |
+
## Model Details
|
| 19 |
+
|
| 20 |
+
This system consists of a `TfidfVectorizer` and four separate `LogisticRegression` models, one for each of the MBTI dimensions:
|
| 21 |
+
|
| 22 |
+
* **Mind:** Introversion (I) vs. Extraversion (E)
|
| 23 |
+
* **Energy:** Intuition (N) vs. Sensing (S)
|
| 24 |
+
* **Nature:** Thinking (T) vs. Feeling (F)
|
| 25 |
+
* **Tactics:** Judging (J) vs. Perceiving (P)
|
| 26 |
+
|
| 27 |
+
## Intended Use
|
| 28 |
+
|
| 29 |
+
These models are intended for educational purposes and to demonstrate building an NLP classification system. They can be used to predict an MBTI type from a block of English text. **This is not a clinical or diagnostic tool.**
|
| 30 |
+
|
| 31 |
+
## Training Data
|
| 32 |
+
|
| 33 |
+
The models were trained on the [Myers-Briggs Personality Type Dataset](https://www.kaggle.com/datasets/datasnaek/mbti-type) from Kaggle, which contains over 8,600 entries of text from social media forums.
|
| 34 |
+
|
| 35 |
+
## Training Procedure
|
| 36 |
+
|
| 37 |
+
Text was cleaned by removing URLs and punctuation, lemmatizing, and removing stopwords. The text was then vectorized using TF-IDF (`max_features=5000`, `ngram_range=(1, 2)`). Each `LogisticRegression` model was trained with `class_weight='balanced'` to counteract the natural imbalance in the dataset.
|
| 38 |
+
|
| 39 |
+
### Evaluation Results
|
| 40 |
+
|
| 41 |
+
Average F1-Scores on the test set:
|
| 42 |
+
* **I/E Model:** Macro F1-Score: ~0.79
|
| 43 |
+
* **N/S Model:** Macro F1-Score: [Add Your Score]
|
| 44 |
+
* **F/T Model:** Macro F1-Score: [Add Your Score]
|
| 45 |
+
* **J/P Model:** Macro F1-Score: [Add Your Score]
|
| 46 |
+
|
| 47 |
+
## How to Use
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
import joblib
|
| 51 |
+
from huggingface_hub import hf_hub_download
|
| 52 |
+
|
| 53 |
+
# Define the repo ID
|
| 54 |
+
repo_id = "YOUR_USERNAME/mbti-personality-predictor"
|
| 55 |
+
|
| 56 |
+
# Download all the model files
|
| 57 |
+
vectorizer = joblib.load(hf_hub_download(repo_id=repo_id, filename="mbti_vectorizer.joblib"))
|
| 58 |
+
model_ie = joblib.load(hf_hub_download(repo_id=repo_id, filename="mbti_model_ie.joblib"))
|
| 59 |
+
model_ns = joblib.load(hf_hub_download(repo_id=repo_id, filename="mbti_model_ns.joblib"))
|
| 60 |
+
model_ft = joblib.load(hf_hub_download(repo_id=repo_id, filename="mbti_model_ft.joblib"))
|
| 61 |
+
model_jp = joblib.load(hf_hub_download(repo_id=repo_id, filename="mbti_model_jp.joblib"))
|
| 62 |
+
|
| 63 |
+
# You can now use these objects for prediction...
|