personality prediction
Code for ICDM'20 paper

該存儲庫包含紙質自下而上和自上而下的代碼:具有心理語言和語言模型特徵的人格,發表在IEEE國際數據挖掘會議2020年。
以下是用Tensorflow + Pytorch編寫的一組實驗,用於使用論文數據集中的語言模型探索自動化的個性檢測(標記為特質的大五個個性)和Kaggle MBTI數據集。
從GitHub中提取存儲庫,然後創建一個新的虛擬環境(CONDA或VENV):
git clone https : // github . com / yashsmehta / personality - prediction . git
cd personality - prediction
conda create - n mvenv python = 3.10安裝詩歌,並使用它來安裝運行項目所需的依賴項:
curl - sSL https : // install . python - poetry . org | python3 -
poetry install 首先運行通過語言模型將數據集傳遞的LM提取器代碼,並將(所有層)嵌入(所有層)存儲在泡菜文件中。創建此“新數據集”可節省我們大量的計算時間,並有效地搜索填充網絡的超參數。在運行代碼之前,請在回購文件夾中創建一個PKL_DATA文件夾。所有參數都是可選的,並且傳遞沒有參數以默認值運行提取器。
python LM_extractor.py -dataset_type ' essays ' -token_length 512 -batch_size 32 -embed ' bert-base ' -op_dir ' pkl_data '接下來,運行一個固定模型,以將提取的功能作為醃製文件中的輸入並訓練一個固定模型。我們發現淺MLP是表現最好的一個
python finetune_models/MLP_LM.py| 結果表 | 語言模型與心理語言特徵 |
|---|---|
![]() | ![]() |
請按照以下步驟預測個性(例如,大五:海洋特徵)在新文本/文章中:
python finetune_models/MLP_LM.py -save_model ' yes '現在使用下面的腳本預測看不見的文本:
python unseen_predictor.pyLM_extractor.py在rtx2080 gpu上,``bert-base'iffertor''提取器大約需要〜2m 30s,而“伯特 - 大''的提取器大約需要〜5m 30s
在CPU上,“ Bert-base”提取器大約需要約25m
python finetune_models/MLP_LM.py在RTX2080 GPU上,根據MLP體系結構,在5s-60s上運行15個時期(沒有交叉驗證)。
@article { mehta2020recent ,
title = { Recent Trends in Deep Learning Based Personality Detection } ,
author = { Mehta, Yash and Majumder, Navonil and Gelbukh, Alexander and Cambria, Erik } ,
journal = { Artificial Intelligence Review } ,
pages = { 2313–2339 } ,
year = { 2020 } ,
doi = { https://doi.org/10.1007/s10462-019-09770-z } ,
url = { https://link.springer.com/article/10.1007/s10462-019-09770-z }
publisher= { Springer }
}如果您發現此存儲庫對您的研究有用,請使用以下內容引用它:
@inproceedings { mehta2020bottom ,
title = { Bottom-up and top-down: Predicting personality with psycholinguistic and language model features } ,
author = { Mehta, Yash and Fatehi, Samin and Kazameini, Amirmohammad and Stachl, Clemens and Cambria, Erik and Eetemadi, Sauleh } ,
booktitle = { 2020 IEEE International Conference on Data Mining (ICDM) } ,
pages = { 1184--1189 } ,
year = { 2020 } ,
organization = { IEEE }
}該項目的源代碼是根據MIT許可證獲得許可的。