<jupyter_start><jupyter_text>Get list of paper ids from Europe PMC Open AccessGET https://www.ebi.ac.uk/europepmc/webservices/rest/fields:warning: check that the number of papers retrieved because it seeems very low.<jupyter_code>def searchEuropePMCclient(query, format='XML',sort='CITED asc'):
    '''
    Search Europe PMC using the REST service with a query term
    
    Params
    -----
    query: str
      a word definying the query such as 'covid-19'. Enclose your term in quotes for exact terms : "covid-19 virus"
    format: XML or JSON
      the format in which to return the results. Default is XML.
    sort: "CITED asc" or "CITED desc"
      sort results by citation numbers (ascending or descending order
    
    Returns
    ------
    
    '''
    base_url = "https://www.ebi.ac.uk/europepmc/webservices/rest/search?"
    payload = {"query": query, "format": format, "sort": sort}
    # REST request
    result = requests.get(base_url, params=payload)
    if result.ok:
        return result.content.decode("UTF-8")
    else:
        print("Something went wrong with your query, please try again.")
res = searchEuropePMCclient("covid-19", format="XML")
# 'res' is a string -> First 1000 characters
res[1:1000]<jupyter_output><empty_output><jupyter_text>Experiment wellcomeml client<jupyter_code>import wellcomeml # installed using pip install wellcomeml with 'nlp' conda activated env
wellcomeml.__version__
from wellcomeml.io import EPMCClient
epmc_client = EPMCClient(max_retries=3)
session = epmc_client.requests_session()
# 24884371
# https://europepmc.org/search?query=myc1%20schuurink
paper = epmc_client.search_by_pmid(session, pmid=24884371)
paper["title"]
epmc_client.get_full_text(session, pmid=24884371)<jupyter_output>2021-12-03 15:18:38 wellcomeml.io.epmc.client INFO: epmc.get_full_text: http-404 pmid=24884371
{'fraction_non_alphanumeric': 0.10537751222161869, 'fraction_numerical': 0.037479630635524175, 'mean_word_length': 4.203389830508475, 'pattern_counts': {'":': 3, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '514957', 'license': 'Apache-2.0', 'n_tokens_mistral': 652, 'n_tokens_neox': 597, 'n_words': 164, 'path': 'emblebi_webinar_rest_api.ipynb', 'repo_name': 'ScienceParkStudyGroup/nlp_pubmed', 'size': '1841'}