<jupyter_start><jupyter_text>Extract NER results<jupyter_code>%load_ext autoreload
%autoreload 1
%aimport nb_utils
import requests
api_url = "http://127.0.0.1:8000"
doc_id = "NCBI_Disease:10192393" # "NCBI_Disease:10556285"

doc_req = requests.get(f"{api_url}/documents/{doc_id}")
doc_json = doc_req.json()
doc_json
m = nb_utils.display_matches(doc_json["summary"],
                             nb_utils.get_matches(doc_json, "NCBI_Disease_Train", "summary"), "NCBI Disease annotation")
m = nb_utils.display_matches(doc_json["summary"],
                             nb_utils.get_matches(doc_json, "scispacy_en_ner_bc5cdr_md", "summary"), "scispacy_en_ner_bc5cdr_md annotation")
m = nb_utils.display_matches(doc_json["summary"],
                             nb_utils.get_matches(doc_json, "scispacy_en_ner_craft_md", "summary"), "scispacy_en_ner_craft_md annotation")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12276785714285714, 'fraction_numerical': 0.03236607142857143, 'mean_word_length': 4.862745098039215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '272924', 'license': 'MIT', 'n_tokens_mistral': 358, 'n_tokens_neox': 332, 'n_words': 42, 'path': 'notebooks/20201106-re.ipynb', 'repo_name': 'JungeAlexander/kbase_db_api', 'size': '896'}