Skip to content Skip to sidebar Skip to footer

How To Store Ner Result In Json/ Database

import nltk from itertools import groupby def get_continuous_chunks(tagged_sent): continuous_chunk = [] current_chunk = [] for token, tag in

Solution 1:

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.

Solution 2:

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')

Post a Comment for "How To Store Ner Result In Json/ Database"