JSON 序列化 Python 使用 simpleJSON
如何创建对象以便我们可以优化对象的序列化
我正在使用 simpleJSON
1,2 是固定变量
3 是类别和分数的固定字典
4 是长度固定的字典数组 (4),该数组是在运行时指定的长度。
该过程需要尽可能快,因此我不确定最佳解决方案。
{
"always-include": true,
"geo": null,
"category-score" : [
{
"Arts-Entertainment": 0.72,
"Business": 0.03,
"Computers-Internet": 0.08,
"Gaming": 0.02,
"Health": 0.02,
}
],
"discovered-entities" : [
{
'relevance': '0.410652',
'count': '2',
'type': 'TelevisionStation',
'text': 'Fox News'
},
{
'relevance': '0.396494',
'count': '2',
'type': 'Organization',
'text': 'NBA'
}
]
],
}