Skip to main content

Wisecube SDK for graph Search

Project description

Wisecube SDK - Version - 1.0.2

Overview

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.

Getting Started

1. Install the sdk

pip install wisecube

2. Authentication

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).

!! Output by default is JSON
#DATAFRAME output
client.output_format=OutputFormat.PANDAS

#JSON output
client.output_format=OutputFormat.JSON

API Usage

# 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

QA

Description

This API provides relevant summary information for the specified question, including the answer and relevant documents associated with them.

client.qa(question)

Parameters

  • question (String): the input must be a question you want the answer to

Documents

Description

This API query provides insights and relevant documents related to the question.

client.documents(question)

Parameters

  • question (String): the input must be a question to get the documents

Search Graph

Description

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)

Parameters

  • -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

Description

The API returns a list of entities related to the search term.

client.search_text(searchText)

Parameters

  • searchText (String): the string you want to search

Description

This API returns the entities retrieved from the Wikidata database based on the provided query.

client.advance_search(query)

Parameters

  • query (String): query for advanced search, encoded as a string

Predicate Graph

Description

The API retrieves information about predicates associated with a given label.

client.get_predicates(labels)

Parameters

  • labels(String): represents the label of a predicate

Execute Vector Function

Description

The API retrieves embeddings for the given entities.

client.execute_vector_function(graphIds)

Parameters

  • graphIds[String]: variable used to specify a list of graph IDs

Execute Score Function

Description

This API retrieves the score for each triple.

client.execute_score_function(triples)

Parameters

  • triples[[String]]: variable representing a list of lists of strings, containing three elements

Admet Prediction

Description

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)

Parameters

  • smiles[String]: specification in the form of a line notation for describing the structure of chemical species
  • model (String): represents the model name

Nl to sparql

Description

This API converts text to sparql.

client.nl_to_sparql(question)

Parameters

  • question[String]: the input must be a question

Parameters

  • graphIds[String]: variable used to specify a list of graph IDs

Ask Pythia

Description

This API obtains related claims or information about the input reference, response and question.

client.ask_pythia(reference,response,question)

Parameters

  • question(String): the input must be a question
  • reference([String]): information related to a medical report
  • response (String): response related to a medical report

Search qids

Description

This API takes a question, extract the disease and biological terms from question and returns a qid for each term.

client.search_qid(question)

Parameters

  • question(String): the input must be a question

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

wisecube-1.0.3-py3-none-any.whl (21.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page