analyze_my_system.py
def annotate_data(source_file, annotations_file, tag=False, compounds=False):
    "Function to annotate existing coco data"
    data = load_json(source_file)
    for entry in data:
        raw_description = entry['caption']
        doc = nlp.tokenizer(raw_description)
        entry['tokenized'] = [tok.orth_ for tok in doc]
        if tag:
            # Call the tagger on the document.
            nlp.tagger(doc)
            entry['tagged'] = [(tok.orth_,tok.tag_) for tok in doc]
        if compounds:
            list_of_compounds = compounds_from_doc(doc)
            entry['compounds'] = list_of_compounds
    save_json(data, annotations_file)
    return data
Function to annotate existing coco data
Function to annotate existing coco data
Function to annotate existing coco data
def annotate_data(source_file, annotations_file, tag=False, compounds=False):
    data = load_json(source_file)
    for entry in data:
        raw_description = entry['caption']
        doc = nlp.tokenizer(raw_description)
        entry['tokenized'] = [tok.orth_ for tok in doc]
        if tag:
            nlp.tagger(doc)
            entry['tagged'] = [(tok.orth_,tok.tag_) for tok in doc]
        if compounds:
            list_of_compounds = compounds_from_doc(doc)
            entry['compounds'] = list_of_compounds
    save_json(data, annotations_file)
    return data
def annotate_data ( source_file , annotations_file , tag = False , compounds = False ) : data = load_json ( source_file ) for entry in data : raw_description = entry [ 'caption' ] doc = nlp . tokenizer ( raw_description ) entry [ 'tokenized' ] = [ tok . orth_ for tok in doc ] if tag : nlp . tagger ( doc ) entry [ 'tagged' ] = [ ( tok . orth_ , tok . tag_ ) for tok in doc ] if compounds : list_of_compounds = compounds_from_doc ( doc ) entry [ 'compounds' ] = list_of_compounds save_json ( data , annotations_file ) return data
Function to annotate existing coco data
Function to annotate existing coco data
"Function to annotate existing coco data" # Call the tagger on the document.
source_file
annotations_file
tag
compounds