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许可证获得许可的。