The Wisecube SDK provides a Python interface to interact with the Wisecube AI services. This SDK allows developers to seamlessly integrate with Wisecube's APIs for various functionalities.
pip install wisecube
Create an instance of the WisecubeClient class with your API key. This is done in a python console:
from wisecube_sdk.client import WisecubeClient
from wisecube_sdk.model_formats import OutputFormat
client = WisecubeClient("key").client
Set the output format for our methods (JSON, PANDAS).
#DATAFRAME output
client.output_format=OutputFormat.PANDAS
#JSON output
client.output_format=OutputFormat.JSON
# Replace with your API key
client = WisecubeClient("key").client
client.output_format=OutputFormat.PANDAS
# Perform operations using the SDK methods
client.qa("Which proteins participate in the formation of the ryanodine receptor quaternary macromolecular complex?")
***Below is a table with the APIs and a short descirption. ***
APIs | Description |
---|---|
qa | returns the answer and documents related to the question |
documents | return documents for the question |
search_graph | returns results containing nodes and edges |
search_text | returns a list of entities related to the search term |
advance_search | returns a dataframe with multiple rows, each representing a different entity with its URI and label |
get_predicates | retrieves information about predicates associated with a given label |
execute_vector_function | retrieves embeddings for the given entities |
execute_score_function | returns the score for each triple |
get_admet_prediction | returns prediction using ADMET models and sagemaker |
nl_to_sparql | returns text converted to sparql |
ask_pythia | return claims about the input |
search_qid | based on disease and biological terms from question,it returns a qid for each term |
This API provides relevant summary information for the specified question, including the answer and relevant documents associated with them.
client.qa(question)
- question (String): the input must be a question you want the answer to
This API query provides insights and relevant documents related to the question.
client.documents(question)
- question (String): the input must be a question to get the documents
This API retrieves insights based on specified parameters and returns the results in the form of a subgraph containing nodes and edges.
client.search_graph(graphIds, nr=20)
- -graphIds ([String]): the input must be a list of ids, ID of the starting node in the graph
- -maxNeighbors(Int): represented by nr : optional variable, default is 10,representing the maximum number of neighbor nodes to retrieve
The API returns a list of entities related to the search term.
client.search_text(searchText)
- searchText (String): the string you want to search
This API returns the entities retrieved from the Wikidata database based on the provided query.
client.advance_search(query)
- query (String): query for advanced search, encoded as a string
The API retrieves information about predicates associated with a given label.
client.get_predicates(labels)
- labels(String): represents the label of a predicate
The API retrieves embeddings for the given entities.
client.execute_vector_function(graphIds)
- graphIds[String]: variable used to specify a list of graph IDs
This API retrieves the score for each triple.
client.execute_score_function(triples)
- triples[[String]]: variable representing a list of lists of strings, containing three elements
This API retrieves prediction using ADMET models and sagemaker.
List of models: [BBB, logS, CYP2CI9i, LogD7, PGPi, PGPs, HIA, F20, F30, PPB, VD, CYPIA2i, CYPIA2s, CYP3A4i, CYP3A4s, CYP2C9i, CYP2C9s, CYP2C19s, CYP2D6i, CYP2D6s, CL, Ames, DILI, SkinS, Caco2, THALF, hERG, HHT ]
client.get_admet_prediction(smiles=smiles, model=model.BBB)
- smiles[String]: specification in the form of a line notation for describing the structure of chemical species
- model (String): represents the model name
This API converts text to sparql.
client.nl_to_sparql(question)
- question[String]: the input must be a question
- graphIds[String]: variable used to specify a list of graph IDs
This API obtains related claims or information about the input reference, response and question.
client.ask_pythia(reference,response,question)
- question(String): the input must be a question
- reference([String]): information related to a medical report
- response (String): response related to a medical report
This API takes a question, extract the disease and biological terms from question and returns a qid for each term.
client.search_qid(question)
- question(String): the input must be a question