如何解决使用python标准化来自Web应用程序的json输出分析的最佳方法是什么?
我正在使用微任务Web应用程序,其中,工作队正在为我标记数据点。他们拥有的问卷非常灵活,这意味着他们可以使用无限数量的属性标记数据点。 json模式中有一些默认值和必填字段,但是并非所有这些都是其中之一。最后有2个示例,用于2个不同数据点的输出。
我需要在python中有一个脚本,该脚本可以让我将结果解压缩为可摘要格式,以进行非数据分析,例如csv。 JSON模式使用是否适用于此处? 有什么建议或线索吗?
谢谢
1)
{
"source_relevance_section": {
"source_relevance": [
"Source report refers to the subject"
]
},"micro_event_section": {
"micro_event_list": [
{
"subject_section": {
"subject_list": [
{
"subject_type": "people (unspecified/other)","subject_number_txt": "at least one","subject_info": "Mad man drove into a shop"
}
]
},"location_object_info_section": {
"location_object_info": "Warsaw,"
},"actions_section": {
"action_section": {
"action_list": [
{
"action_type": "vehicle-impact [attack]"
}
]
},"building_object_section": {
"building_object_list": []
},"people_object_section": {
"people_object_list": [
{
"people_object_impact_list": [
{
"people_object_impact": "incident object [person]"
}
],"people_object_type": "people in shop","people_object_number_txt": "at least one","people_object_info": "one or more people got injured"
}
]
},"vehicles_section": {
"vehicles_list": []
},"property_object_section": {
"property_object_list": []
},"temporary_object_section": {
"temporary_object_list": []
}
}
}
]
}
}
2)
{
"source_relevance_section": {
"source_relevance": [
"Source report refers to the subject"
]
},"micro_event_section": {
"micro_event_list": [
{
"subject_section": {
"subject_list": [
{
"subject_type": "gunmen","subject_info": "Unspecified individuals"
}
]
},"location_object_info_section": {
"location_object_info": "Paris"
},"actions_section": {
"action_section": {
"action_list": [
{
"action_type": "firearm [attack,gunbattle]"
}
]
},"building_object_section": {},"people_object_section": {
"people_object_list": [
{
"people_object_impact_list": [
{
"people_object_impact": "injury [person]"
}
],"people_object_type": "people (unspecified/other)","people_object_number_int": 1,"people_object_info": "A man injured"
}
]
},"vehicles_section": {
"vehicles_list": [
{
"vehicle_object_section": {
"vehicle_object_list": [
{
"vehicle_object_impact_list": [
{
"vehicle_object_impact": "set on fire [vehicle]"
}
],"vehicle_object_type": "car","vehicle_object_number_int": 1,"vehicle_object_number_txt": "at least one","vehicle_object_info": "A second vehicle probably involved in the shooting was set on fire"
}
]
},"aircraft_object_section": {},"vessel_object_section": {}
}
]
},"temporary_object_section": {}
}
}
]
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。