def main(): access_token = ACCESS_TOKEN id = '1010487' dataset = DataSet(access_token=access_token) response = dataset.delete_dataset(id) print('Status Code: ' + str(response.status_code)) print('Text Message: ' + response.text)
def main(): access_token = ACCESS_TOKEN dataset = DataSet(access_token=access_token) response = dataset.get_all_datasets() data = response['data'] for d in data: print(str(d))
def main(): #curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" # -H "Content-Type: multipart/form-data" -F "path=http://einstein.ai/text/weather.csv" # -F "type=text-intent" https://api.einstein.ai/v2/language/datasets/upload access_token = ACCESS_TOKEN dataset = DataSet(access_token=access_token) path = 'http://einstein.ai/text/weather.csv' response = dataset.create_intent_dataset(path) print(json.dumps(response, indent=4, sort_keys=True))
def main(): access_token = ACCESS_TOKEN id = '1016532' dataset = DataSet(access_token=access_token) response = dataset.get_dataset_details(id) if ('available' in response): print(json.dumps(response, indent=4, sort_keys=True)) else: print('Response status ok?: ' + str(response.ok)) print(response.text)
def main(): access_token = ACCESS_TOKEN id = '1016532' name = 'Movie Review DataSet' dataset = DataSet(access_token=access_token) response = dataset.train_dataset(id, model_name=name) if ('available' in response): print(json.dumps(response, indent=4, sort_keys=True)) else: print('Response status ok?: ' + str(response.ok)) print(json.dumps(response.text, indent=4, sort_keys=True))
def main(): access_token = ACCESS_TOKEN id = 'NLTHWYUZ4JU5HRTSTEDPFL5NDM' dataset = DataSet(access_token=access_token) response = dataset.get_model_details(id) try: print(json.dumps(response, indent=4, sort_keys=True)) except TypeError: print('response ok? ' + str(response.ok)) print('response content: ' + str(response.content)) return True
def main(): access_token = ACCESS_TOKEN dataset = DataSet(access_token=access_token) path = 'https://www.dropbox.com/s/fi501unouuzet39/movie_review_train_1000_v2.tsv?dl=1' response = dataset.create_sentiment_dataset(path) print(json.dumps(response, indent=4, sort_keys=True))