您的位置:首页 > 其它

利用IBM Personality Insights接口进行人格特质预测

2018-03-04 15:51 519 查看
近年来,研究者们在人格描述模式上形成了比较一致的共识,提出了人格的大五模式, Goldberg(1992)称之为人格心理学中的一场革命,研究者通过词汇学的方法,发现大约有五种特质可以涵盖人格描述的所有方面。 大五人格(OCEAN),也被称之为人格的海洋,可以通过NEO-PI-R评定。
·开放性(openness): 具有想象、审美、情感丰富、求异、创造、智能等特质。
责任心(conscientiousness):显示胜任、公正、条理、尽职、成就、自律、谨慎、克制等特点。
外倾性(extraversion):表现出热情、社交、果断、活跃、冒险、乐观等特质。
·宜人性 (agreeableness):具有信任、利他、直率、依从、谦虚、移情等特质。

神经质或情绪稳定性(neuroticism):具有焦虑、敌对、压抑、自我意识、冲动、脆弱等特质。

Agreeableness is a person's tendency to be compassionate and cooperative toward others.
Conscientiousness is a person's tendency to act in an organized or thoughtful way.
Extraversion is a person's tendency to seek stimulation in the company of others.
Emotional range, also referred to as Neuroticism or Natural reactions, is the extent to which a person's emotions are sensitive to the person's environment.
Openness is the extent to which a person is open to experiencing a variety of activities.
本篇利用IBM的Personality Insights接口进行人格特质预测。点击这查看里官方文档
代码如下
# -*- coding: utf-8 -*-
"""Created on Sat Dec 30 19:09:10 2017@author: zhangfeng"""import jsonfrom watson_developer_cloud import PersonalityInsightsV3personality_insights = PersonalityInsightsV3( url= "https://gateway.watsonplatform.net/personality-insights/api", username= "00b1926b-167f-4910-ac68-a051ccca9765", password= "LIZRrPsxMw5t", version= "2017-12-30") with open('C:\\Users\\ZhangFeng\\Desktop\\test\\test2.json','r',encoding= 'utf-8') as profile_json: profile = personality_insights.profile( profile_json.read(), content_type='application/json',raw_scores=True, consumption_preferences=False)#print(json.dumps(profile, indent=4))personality = profile['personality']openness = personality[0]['percentile'] * 5conscientiousness = personality[1]['percentile'] * 5extraversion = personality[2]['percentile'] * 5agreeableness = personality[3]['percentile'] * 5emotionalrange = personality[4]['percentile'] * 5项目开始前必须进行IBM Cloud account注册,并创建相应的Personality Insights项目,随后就会生成自己的用户名和密码。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: