CogStack / MedCATtrainer

A simple interface to inspect, improve and add concepts to biomedical NER+L -> MedCAT.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concept lookup not working. Concepts not being imported into SOLR.

sreesankarp opened this issue · comments

@tomolopolis

It seems like "api/import-cdb-concepts" is not called anywhere
Cant find it anywhere in source except for urls.py

We manually made the call and it created a new collection in solr.
image

image

Can you describe how you imported the cdb through with the Solr api? We are having the same problem, the Solr collection is not made/populated.

This should do it.

import requests
import json

URL = 'http://localhost:8001'

payload = {"username": "admin", "password": "admin"}
headers = {
    'Authorization': f'Token {json.loads(requests.post("http://localhost:8001/api/api-token-auth/", json=payload).text)["token"]}',
} 
json.loads(requests.post(f'{URL}/api/import-cdb-concepts/', headers=headers, 
                               data={'cdb_id': id_of_cdb_in_medcattrainer}).text)

Ah this should also do it ;)

image

yep looks like you've got it. This process is also explained here - albeit not in the clearest way
https://medcattrainer.readthedocs.io/en/latest/project_admin.html#concept-picker-cdb-concept-import