/ Модель

Характеристики

Лицензия
MIT
Библиотека
transformers
Опубликована
13 янв 2024

microsoft-finetuned-personality

Классификация текстаТекст → label3 профессии

Англоязычный классификатор на MiniLM оценивает черты Big Five по текстовым ответам на личностные утверждения.

40скачиваний за 30 дней14лайковвеса обновлены11 дек 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель разработал Nasser Elsaman: это англоязычный классификатор, дообученный на microsoft/MiniLM-L12-H384-uncased для оценки пяти черт личности по тексту — доброжелательности, добросовестности, экстраверсии, нейротизма и открытости опыту. Она принимает текст с ответами на утверждения о себе и предсказывает профиль Big Five; в README заявлена точность свыше 97%, однако описание не уточняет методику оценки этой метрики. Модель построена на MiniLM, использует токенизатор с максимальной длиной 275 токенов, а веса опубликованы в формате safetensors.

Автор позиционирует модель для обучения и исследований, а также для получения ориентировочной оценки собственных черт. Прогнозы могут отражать смещения обучающего набора и не должны служить основанием для значимых решений о людях, например при найме, обучении или в юридической сфере. Для пользователей, не подпадающих под условия лицензии MIT, применяются условия этой лицензии; README отдельно ограничивает предполагаемое назначение образовательными и исследовательскими сценариями.

Сценарии применения

  • оценка черт Big Five по ответам на анкету
  • получение ориентировочного профиля личности по тексту
  • учебные эксперименты по классификации личности
  • исследование переноса обучения для анализа текста

Ограничения

Оценки могут быть смещены из-за особенностей обучающего набора, а заявленная точность свыше 97% не сопровождается описанием методики проверки. Не используйте прогнозы как единственное основание для решений о найме, обучении или юридических вопросах.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Model Description

  • Many of the most significant developments in the modern corporate sector are driven by data. Data will become more crucial and revolutionary to daily individual operations in the near future.
  • In order to predict the Big Five personality traits for this project, I employed transfer learning using the microsoft/MiniLM-L12-H384-uncased.
  • The model's learning patterns between personality attributes and input text were refined using a carefully selected dataset for personality traits.
  • The microsoft/MiniLM-L12-H384-uncased model increased the prediction accuracy of personality traits by utilising transfer learning to reach more than 97% comparing to my last model which was depended on roberta-large "65%".
  • This finetuned model is able to estimate an individual's Big Five personality traits based on their input text with high accuracy by utilising transfer learning and optimising microsoft/MiniLM-L12-H384-uncased.
  • This experiment demonstrates the efficacy of predicting the Big Five personality traits and the strength of transfer learning in machine learning.
  • Developed by: [Nasser Elsaman]
  • Model type: [Text/ Personality Classification Model]
  • Language (NLP): [English]
  • License: [MIT]
  • Finetuned from model: microsoft/MiniLM-L12-H384-uncased
  • Goal from this finetuned model: This model is for educational and research purposes only, any uses outside of this, the author is not responsible.

Uses:-

Direct Use:

  • Individuals can utilise the personality prediction model directly to acquire insights into their own personality qualities based on the input text. Users can input text to get predictions for the Big Five personality characteristics, and this model is for educational and research purposes only, any uses outside of this, the author is not responsible.

Downstream Use:

  • This model is designed for later usage or fine-tuning for certain needs. It was created as a stand-alone personality prediction finetuned model.

Out-of-Scope Use:

  • Use this model with caution when making significant choices about people in fields like employment, education, or law.

Biases, Risks, and Limitations:

  • The personality prediction model, like any machine learning models, has limits and potential biases that should be considered.

Generalisations:

  • The algorithm predicts personality qualities using patterns acquired from a given dataset. Its results will not alter when applied to people from diverse ethnic or cultural backgrounds who are underrepresented in the training data.

Ethical considerations:

  • Personality prediction models should be utilised responsibly, with the awareness that personality features do not define a person's value or talents. It is critical to avoid forming unjust judgements or discriminating against someone based on their expected personality characteristics.

Privacy concerns:

  • The model is based on user-provided input text, which may include sensitive or confidential information. Users should be cautious while giving personal information and maintain the security of their data.

Recommendations:

  • To reduce the dangers and limits associated with personality prediction models, the following guidelines are proposed:

Awareness and Education:

  • Users should understand the model's limits and potential biases. Increase awareness that personality traits are multifaceted and cannot be fully represented by a single model or text analysis.

Avoid Stereotypes and Discrimination:

  • Users should use caution when making judgements or conclusions based primarily on projected personality attributes. Personality forecasts should not be used to discriminate against people or reinforce stereotypes, and this model is for educational and research purposes only.

Contextual Interpretation:

  • Place the model's predictions in context and evaluate extra information about the individual beyond the input text.

Data Privacy and Security:

  • Ensure that user data is processed securely and in accordance with privacy legislation. Users should be cautious while giving personal information.

Promote Ethical Use:

  • Encourage the proper use of personality prediction models while discouraging abuse or harmful uses.

  • It is crucial to highlight that the preceding recommendations are generic principles; additional context-specific recommendations should be made depending on the individual use case and the ethical issues.

How to Get Started with the Model:

Use the code below to get started with the model.


from transformers import AutoTokenizer, AutoModelForSequenceClassification

    def personality_detection(text, threshold=0.05, endpoint= 1.0):
        token="Write_Your_HUG_Access_token_Id_Here"
        tokenizer = AutoTokenizer.from_pretrained ("Nasserelsaman/microsoft-finetuned-personality",token=token)
        model = AutoModelForSequenceClassification.from_pretrained ("Nasserelsaman/microsoft-finetuned-personality",token=token)
        
        inputs = tokenizer(text, truncation=True, padding=True, return_tensors="pt")
        outputs = model(**inputs)
        predictions = outputs.logits.squeeze().detach().numpy()
        
        # Get raw logits
        logits = model(**inputs).logits
        
        # Apply sigmoid to squash between 0 and 1
        probabilities = torch.sigmoid(logits)
        
        # Set values less than the threshold to 0.05
        predictions[predictions < threshold] = 0.05
        predictions[predictions > endpoint] = 1.0
        
        label_names = ['Agreeableness', 'Conscientiousness', 'Extraversion', 'Neuroticism', 'Openness']
        result = {label_names[i]: f"{predictions[i]*100:.0f}%" for i in range(len(label_names))}
        
        return result

Results

[I get a fine-tuned model with a high accuracy more than 97%; test by yourself on my streamlit app

The personality_detection function returns a dictionary containing the predicted personality traits based on the given input text. The dictionary contains the following personality traits with their corresponding predicted values:

  1. Agreeableness: A value between 5% and 100% represents the predicted agreeableness trait.
  2. Conscientiousness: A value between 5% and 100% represents the predicted conscientiousness trait.
  3. Extroversion: A value between 5% and 100% represents the predicted extroversion trait.
  4. Neuroticism: A value between 5% and 100% represents the predicted neuroticism trait.
  5. Openness: A value between 5% and 100% represents the predicted openness trait.

Please note that I made the min value is 5% not 0% as 0% has no meaning but 5% means the user has low peronslaity type in this trait, but max value 100% meaning this personality type is the dominant type.

Example:-

text_input = "Strongly Agree with that I am the life of the party. Disagree with that I sympathize with others’ feelings. Strongly Agree with that I get chores done right away. Disagree with that I have frequent mood swings. Disagree with that I have a vivid imagination. Neutral with that I don’t talk a lot. Strongly Disagree with that I am not interested in other people’s problems. Neutral with that I often forget to put things back in their proper place. Strongly Agree with that I am relaxed most of the time. Neutral with that I am not interested in abstract ideas. Strongly Agree with that I talk to a lot of different people at parties. Agree with that I feel others’ emotions. Disagree with that I like order. Strongly Agree with that I get upset easily. Neutral with that I have difficulty understanding abstract ideas. Strongly Disagree with that I keep in the background. Agree with that I am not really interested in others. Strongly Disagree with that I make a mess of things. Strongly Agree with that I seldom feel blue. Strongly Disagree with that I do not have a good imagination."

personality_prediction = personality_detection(text_input) print(personality_prediction)

Output:-

{ "Agreeableness":"5%" "Conscientiousness":"5%" "Extraversion":"6%" "Neuroticism":"100%" "Openness":"5%" }

* In addition to a spider graph in my streamlit app

Epochs:

  • There were 3 epochs only, and I got a high accuracy from the second one as follows without overfitting:
EpochTraining LossValidation LossAccuracy
10.6266000.1882800.945493
20.1665000.0958030.970488
30.1043000.0748640.976524

** Please note the following points explaining my result and why this were not overfitting:

  1. With a large training dataset of 360,855 samples, good performance may be achieved in a few epochs. The model has enough data to learn from.
  2. Using a pretrained language model, such as microsoft/MiniLM-L12-H384-uncased, results in stronger initialization, allowing for faster convergence than random initialization, and this model with 12-layer, 384-hidden, 12-heads, 33M parameters, and 2.7x faster than BERT-Base and for more details in this point check the paper "MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers".
  3. The low training and validation losses after only 2-3 epochs show that the model is fitting the data correctly and is not overfitting.
  4. Increasing accuracy and decreasing loss values over epochs demonstrate smooth continuous learning, rather than spikes, which may imply overfitting.
  5. The high accuracy of 97.65% after only three epochs is amazing and understandable considering the massive sample quantity, pretrained weights, and smooth learning curves.

Evaluation Metrics:

  • The evaluation metrics used are: Accuracy, Recall and F1-score.
  1. Accuracy:- Training data (0.976524) - Test data (0.9765239651189411)
  2. Recall:- {'recall': 0.9765239651189411}
  3. F1-score:- {'f1': 0.9765239651189411}

Model Summary:

  1. Model_Name: microsoft/MiniLM-L12-H384-uncased
  2. Dataset Size: 360855 rows; after making data cleansing and class balance to the Kaggle personality dataset
  3. Num_Of_Epochs: 3
  4. Tokenizer Max_length: 275
  5. Batch size: 64
  6. Learning Rate: 5e-6
  7. Software: Google Colab with free GPU

* Final Finetuning Model is: Nasserelsaman/microsoft_finetuned_personality, and please note that his model is for educational and research purposes only, any uses outside of this, the author is not responsible.

* Model streamlit app: Personality_Assessment

* This project is based on The Mini IPIP personality measure

Model Card Authors:

Prepared by:- Nasser Elsaman

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Нельзя запустить

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
ae5bcd4

0 моделей