Run QuickUMLS in Client-Server mode
masterQuickUMLS supports a client-server architecture to allow multiple scripts to query a single running server.
1. Start the Server:
Run the server module via CLI. You can specify host, port, and QuickUMLS options.
python -m quickumls.server /path/to/quickumls/files {-P QuickUMLS port} {-H QuickUMLS host} {QuickUMLS options}
- Default host/port:
localhost:4645. - To run in background: Use
nohupand redirect output to a.pidfile.
2. Use the Client:
Import get_quickumls_client from quickumls. The client API is identical to the standard QuickUMLS object.
from quickumls import get_quickumls_client
# Connect to the running server
matcher = get_quickumls_client()
text = "The ulna has dislocated posteriorly from the trochlea of the humerus."
results = matcher.match(text, best_match=True, ignore_syntax=False)