<jupyter_start><jupyter_text>Get The ADMSIn this case we'll just make adms from LightTag data. You probably have ADMs in a file or in memory  Notes on the adm_document_list_to_lighttag_suggestions functionThis function takes two optional callback arguments* **example_id_fn** extracts the lighttag example id from the ADM Doc* **lighttag_tag_name_extractor** resolves the LightTag tag name of the entityBoth of these have defaults defined in adm_to_lighttag<jupyter_code>adms = []
for root,d,files in os.walk('/tmp/sixgill/'):
    for f in files:
        if f.endswith('adm.json'):
            adms.append(json.load(open(os.path.join(root,f))))
            
seen_examples = adm_document_list_to_lighttag_suggestions(adms)
suggestions = seen_examples['suggestions']

seen_example_ids = seen_examples['seen_example_ids']<jupyter_output><empty_output><jupyter_text>TODO For Sixgill/ Nadav * Notice that the example_id is a list, please modify the example_id_fn to match your branch * Implement the lighttag_tag_name_extractor to get the lighttag tag name * Is Basis sending more tags than what is in your schema ? We'll reject those<jupyter_code>pd.DataFrame(suggestions)<jupyter_output><empty_output><jupyter_text>Sanity Check conflicts which LightTag might rejectWe'll run the conflict resolveer, if you get any warnings here than you need to check why you have overlapping suggestions.<jupyter_code>import copy
from itertools import groupby
pseudo_annotations = []
for sug in suggestions:
    x = copy.copy(sug)
    x['annotated_by'] = ["my_model"]
    pseudo_annotations.append(x)

pseudos_by_example = groupby(pseudo_annotations,key=lambda x:x['example_id'])

from conflict_resolver import resolve_annotation_conflicts
for example_id, example_suggestions in pseudos_by_example:
        resolve_annotation_conflicts(list(example_suggestions))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07207688200747464, 'fraction_numerical': 0.0, 'mean_word_length': 6.152671755725191, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '6118', 'license': 'MIT', 'n_tokens_mistral': 582, 'n_tokens_neox': 561, 'n_words': 171, 'path': 'rosette/Converting ADM TO LightTag Suggestions On Sixgill.ipynb', 'repo_name': 'LightTag/lighttag-to-adm', 'size': '1873'}