How to store ner result in json/ database

偶尔善良 提交于 2019-12-02 09:39:49

It's not very clear what ne_tagged_sent list contains (Is there a LOCATION for each PERSON, ORGANIZATION ?), you must clarify it that we could answer your question.

You should format your data as a dictionary, each entry corresponds to a person like:

import json
data = {
        'Rami Eid':{'job': 'engineer', 'location':'NY'},
        'GuruRaj Bagali':{'job': 'professor', 'location': 'NY'}
       }
#Save it in a json file
json.dump(data, open('path/to_your_file', 'w')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!