HLP Research Center API

Variants API


Description


"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."


Input Specification


Variants provide one service through a POST request. The parameters, is a list of keywords with the following JSON format:

{ "keywords": ["one", "two", "three", "four", "five",...] }


Ouput Specification


If the process is successful, Variants service will return a JSON with the following format:

{ "four": [ "four", "fourty" ], "one": [ "one", "on", "onnce", "one", "onece", "pzone", "oone", "onthe", "once" ], "five": [ "five" ], "three": [ "three", "threee", "thirteen", "quitthree", "three" ], "two": [ "two" ] }


Python Example

import requests
import json        

if __name__ == '__main__':

      
    exJSON = {}
      #For testing the service if needed:
    exJSON = {
        "keywords": ["one", "two", "three", "four", "five"]
    }
      
    # POST
    resp = requests.post('http://hlp.ibi.upenn.edu/variants/v0.1', json=exJSON)
    if resp.status_code != 200:
        raise Exception(f'POST /predict/ ERROR: {resp.status_code}')
    else:
        exJSON = resp.json()
        if 'errors' in exJSON:
            raise Exception(f'POST /predict/ ERROR: {resp.json()}')
        else:
            print(exJSON)