Run this model with HF Jobs
Run Minej/bert-base-personality on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Minej/bert-base-personality. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Minej/bert-base-personality on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Minej/bert-base-personality with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Minej/bert-base-personality with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Minej/bert-base-personality")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Minej/bert-base-personality") model = AutoModelForSequenceClassification.from_pretrained("Minej/bert-base-personality", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files5 unmodified lines6789101168 unmodified lines808182838485868788899091929394959697989910010110210310410568 unmodified lines1741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102115 unmodified linespipeline_tag: text-classification---### Model DescriptionTransfer Learning for Big Five Personality Prediction68 unmodified linesIt is important to note that the above recommendations are general guidelines, and further context-specific recommendations should be developed based on the particular use case and ethical considerations.## How to Get Started with the ModelTo use the model through Hosted inference API, follow the code snippet provided below:```pythonfrom transformers import BertTokenizer, BertForSequenceClassificationdef personality_detection(text):tokenizer = BertTokenizer.from_pretrained("Minej/bert-base-personality")model = BertForSequenceClassification.from_pretrained("Minej/bert-base-personality")inputs = tokenizer(text, truncation=True, padding=True, return_tensors="pt")outputs = model(**inputs)predictions = outputs.logits.squeeze().detach().numpy()label_names = ['Extroversion', 'Neuroticism', 'Agreeableness', 'Conscientiousness', 'Openness']result = {label_names[i]: predictions[i] for i in range(len(label_names))}return result```If you would like to download the model files and use them instead of the Hosted inference API, then you can follow the code snippet provided below:68 unmodified linesPlease note that this code assumes you have already downloaded the necessary model files (config.json, pytorch_model.bin, special_tokens_map.json, tokenizer_config.json, vocab.txt) and placed them in the current directory (indicated by "."). Adjust the paths and filenames accordingly if needed.#### Result FormatThe 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:Extroversion: A value between 0 and 1 representing the predicted extroversion trait.Neuroticism: A value between 0 and 1 representing the predicted neuroticism trait.Agreeableness: A value between 0 and 1 representing the predicted agreeableness trait.Conscientiousness: A value between 0 and 1 representing the predicted conscientiousness trait.Openness: A value between 0 and 1 representing the predicted openness trait.```pythontext_input = "I am feeling excited about the upcoming event."personality_prediction = personality_detection(text_input)print(personality_prediction)```###### Output:```python{"Extroversion": 0.535,"Neuroticism": 0.576,"Agreeableness": 0.399,"Conscientiousness": 0.253,"Openness": 0.563}```Note: The values in the example output are just placeholders and may not reflect the actual predictions.You can modify the example code and the result format to match your specific use case and desired output format.## Citation5 unmodified lines67891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636468 unmodified lines13313413513613713813968 unmodified lines2082092102112122132145 unmodified linespipeline_tag: text-classification---## How to Get Started with the ModelTo use the model through Hosted inference API, follow the code snippet provided below:```pythonfrom transformers import BertTokenizer, BertForSequenceClassificationdef personality_detection(text):tokenizer = BertTokenizer.from_pretrained("Minej/bert-base-personality")model = BertForSequenceClassification.from_pretrained("Minej/bert-base-personality")inputs = tokenizer(text, truncation=True, padding=True, return_tensors="pt")outputs = model(**inputs)predictions = outputs.logits.squeeze().detach().numpy()label_names = ['Extroversion', 'Neuroticism', 'Agreeableness', 'Conscientiousness', 'Openness']result = {label_names[i]: predictions[i] for i in range(len(label_names))}return result```#### Result FormatThe 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:Extroversion: A value between 0 and 1 representing the predicted extroversion trait.Neuroticism: A value between 0 and 1 representing the predicted neuroticism trait.Agreeableness: A value between 0 and 1 representing the predicted agreeableness trait.Conscientiousness: A value between 0 and 1 representing the predicted conscientiousness trait.Openness: A value between 0 and 1 representing the predicted openness trait.```pythontext_input = "I am feeling excited about the upcoming event."personality_prediction = personality_detection(text_input)print(personality_prediction)```###### Output:```python{"Extroversion": 0.535,"Neuroticism": 0.576,"Agreeableness": 0.399,"Conscientiousness": 0.253,"Openness": 0.563}```Note: The values in the example output are just placeholders and may not reflect the actual predictions.You can modify the example code and the result format to match your specific use case and desired output format.### Model DescriptionTransfer Learning for Big Five Personality Prediction68 unmodified linesIt is important to note that the above recommendations are general guidelines, and further context-specific recommendations should be developed based on the particular use case and ethical considerations.## How to Download the ModelIf you would like to download the model files and use them instead of the Hosted inference API, then you can follow the code snippet provided below:68 unmodified linesPlease note that this code assumes you have already downloaded the necessary model files (config.json, pytorch_model.bin, special_tokens_map.json, tokenizer_config.json, vocab.txt) and placed them in the current directory (indicated by "."). Adjust the paths and filenames accordingly if needed.## Citation
README.md+54-51