iknow-utils

Downloads2
Subscribe
0
Bookmark
0
This application is not supported by InterSystems Corporation. Please be notified that you use it at your own responsibility.
Details
Releases
Reviews
Issues

What's new in this version

Initial Release

Repo-GitHub

iKnow Utilities

This repository bundles a few reusable IRIS NLP utilities for common scenarios. You can easily install the bundle using IPM:

USER> zpm

zpm:USER> install iknow-utils

Alternatively, use $SYSTEM.OBJ.LoadDir() passing in the path where you downloaded this repository.

All classes are in a bdb.iKnow package to avoid conflicting with existing namespace contents and provided without any warranty. Feel free to report issues through the GitHub repo.

For a sample code bundle accessing the iKnow APIs directly from your Python code, please check this related Github repo

Converters

bdb.iKnow.Converters.SemiStructured is a simple %iKnow.Source.Converter implementation that tries to prevent common key-value style elements from messing up iKnow output. For example:

MRN: 12345
HISTORY OF PRESENT ILLNESS: Patient reported wobbly toes in an earlier encounter, for which close
followup was recommended. Wobbling subsided after 3w of intense inactivity.

BP: 123/mmHg
LS: 456
KV: 78xyz
TREATMENT: Patient will continue to watch Netflix 14h pd.

iKnow expects natural language text and does not consider single line breaks to mean the end of a real sentence. Therefore, when passing the above text verbatim to the iKnow engine, you'll get those structured BP: 123/mmHg, LS: 456, etc elements concatenated to one another as if it were a sentence.

The bdb.iKnow.Converters.SemiStructured class can be used in a <converter ... /> tag in your domain definition to sneak a double line break in right before such keys so they are not appended to the previous line. Note that the implementation is somewhat cautious in only adding a line break before the keys and only getting triggered by all-uppercase keys to limit false positives that might mess up genuine use of colons in natural language sentences. This is a sample after all and easy to adapt to your needs.

As a bonus, this Converter can also pick up key values as metadata, by supplying a list of keys as the converter parameter, as shown in the example below:

USER> set converted = ##class(bdb.iKnow.Converters.SemiStructured).TestFull(str,$lb("MRN,KV,LS"),.meta)

USER> zwrite meta
meta("KV")="78xyz"
meta("LS")=456
meta("MRN")=12345

IPM installation
zpm "install iknow-utils"
Rating
4.5 (1)
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for HealthInterSystems IRIS NLP
Tags
Info
Version
0.3.1
Last updated
2023-01-17
Repository
Open
Documentation
Open
License
Link