Releases: MaastrichtU-IDS/translator-openpredict
Translator OpenPredict 0.2.1
Translator OpenPredict 0.2.0
Changelog
- Add
TRAPI
class to theopenpredict
package, so users can easily deploy their own TRAPI based on their prediction functions
Full Changelog: v0.1.0...v0.2.0
OpenPredict Translator API 0.1.0
Major refactor of OpenPredict
- OpenPredict now uses
dvc
(data version control) and DagsHub (a platform to publish the data) to handle all data files required to train the models and run the predictions that are all in thedata/
folder at the root of the repository (instead of having half of them committed to git, and the other half to be downloaded from some obscure servers, now every single CSV input and model output at stored in thedata/
folder).
dvc
/DagsHub works and looks a lot like git
/GitHub, but specialized for large data files (and it can also be used to store metadata about your runs). The repo size limit for open source projects on DagsHub is 10G
You can find the data used for OpenPredict (prediction + similarity + evidence path + drkg model) at https://dagshub.com/vemonet/translator-openpredict
- There is now a decorator
@trapi_predict
to mark a functions that return predictions that can be integrated automatically in a TRAPI query. It allows the dev to specify which relations this prediction function can resolve in a TRAPI query. So the dev just need to insure that his prediction functions take the input we expect, and returns the predictions in the expected format (cf. the code example below, note that it is vastly inspired from ElasticSearch and BioThings return formats).
Then the predictions generated by this function can be automatically integrated to our TRAPI API, and a simple GET endpoint to query the prediction individually is also automatically generated
from openpredict import trapi_predict, PredictOptions, PredictOutput
@trapi_predict(path='/predict',
name="Get predicted targets for a given entity",
description="Return the predicted targets for a given entity: drug (DrugBank ID) or disease (OMIM ID), with confidence scores.",
relations=[
{
'subject': 'biolink:Drug',
'predicate': 'biolink:treats',
'object': 'biolink:Disease',
},
{
'subject': 'biolink:Disease',
'predicate': 'biolink:treated_by',
'object': 'biolink:Drug',
},
]
)
def get_predictions(
input_id: str, options: PredictOptions
) -> PredictOutput:
# Add the code the load the model and get predictions here
predictions = {
"hits": [
{
"id": "DB00001",
"type": "biolink:Drug",
"score": 0.12345,
"label": "Leipirudin",
}
],
"count": 1,
}
return predictions
- When someone wants to add a new prediction model to the Translator OpenPredict API they can either create a new folder under
src/
in the existing translator-openpredict repo, and add all the python files they need to train and run the prediction (and use the decorator to annotate the prediction function).
Or do it in a separate repository published to GitHub, with data stored usingdvc
. So we can easily import the code and data required to run the prediction from the OpenPredict API. There is a template repository to help people get started with the recommended architecture: https://github.com/MaastrichtU-IDS/cookiecutter-openpredict-api
pip install cookiecutter
cookiecutter https://github.com/MaastrichtU-IDS/cookiecutter-openpredict-api
- Now use hatch instead of poetry for build process
Full Changelog: v0.0.8...v0.1.0
OpenPredict API 0.0.8
Last version with the TRAPI API defined in the package. Uses embedded RDFLib triplestore
What's Changed
- fix: translator-ops branch is removed by @pahmadi8740 in #29
- Update Jenkinsfile by @pahmadi8740 in #30
- fix local deployment servers in openapi schema by @elifozkn in #31
- Kgxpredict by @arifx in #38
- add evidence path by @elifozkn in #39
New Contributors
- @pahmadi8740 made their first contribution in #29
- @elifozkn made their first contribution in #31
Full Changelog: v0.0.7...v0.0.8
OpenPredict 0.0.7 using GraphDB backend
OpenPredict 0.0.7 still using a GraphDB backend in production
Dec2021Demo
Release for the Translator December 2021 Demo
OpenPredict 0.0.6
- Improve the OpenPredict API storage and reuse of models when new embeddings are added
- Use
.ttl
file locally to store OpenPredict metadata - Make the
/predict
call compatible with the BioThings Explorer operations annotations
OpenPredict 0.0.5
Improve openpredict
pip package:
- Include
openapi.yml
and all files from thedata
folder in theopenpredict
package - Now generating RDF from the classifier training scores
- Fix issue with the server URL, add a new argument:
--server-url
, default to/
- Improve examples and documentation
Release 0.0.4
Update openapi description to ReasonerAPI 0.9.2
Create get /predicates
call
Release 0.0.3
- Fix error message in API response
- Remove documentation generation from the workflows