Skip to content

Instantly share code, notes, and snippets.

View peckjon's full-sized avatar

Jon Peck peckjon

View GitHub Profile
@peckjon
peckjon / getdataset.py
Created August 1, 2018 18:38
Train a Machine to Turn Documents into Keywords, via Document Classification
import Algorithmia
remote_url = 'data://.my/collection/training_data.json'
local_dataset = '/path/to/my/training_dataset.json'
client = Algorithmia.client('YOUR_API_KEY_HERE')
client.file(remote_url).putFile(local_dataset)
@peckjon
peckjon / translate.py
Created July 31, 2018 23:51
pre-translation in NLP
import Algorithmia
client = Algorithmia.client("your_api_key")
algo_input = {
"action": "translate",
"text": "Me gustan los aguacates"
}
translated_text = client.algo("translation/GoogleTranslate/0.1.1").pipe(algo_input).result["translation"]