This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Written by Bowei Liu 05/27/16 | |
| # repo at https://gist.github.com/01142bc0ab45e754afbd554b8e0072b5 | |
| # gist -u 01142bc0ab45e754afbd554b8e0072b5 convert-yahoo-data.sh | |
| # Goal: convert the corpii of answers and yahoo data into 3 files: | |
| # train.csv, test.csv, real_test.csv | |
| # suitable for feeding into tensorflow. | |
| # categories files already ahve all the answers/yahoo hierarchy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| const fs = require('fs'), | |
| knox = require('knox'), | |
| Promise = require('bluebird'), | |
| request = Promise.promisify(require('request')), | |
| _ = require('lodash') | |
| Promise.promisifyAll(fs) | |
| Promise.promisifyAll(knox) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(d) { | |
| var dl = d.createElement('a'); | |
| dl.innerText = 'Download MP3'; | |
| dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
| dl.download = d.querySelector('em').innerText+".mp3"; | |
| d.querySelector('.primary').appendChild(dl); | |
| dl.style.marginLeft = '10px'; | |
| dl.style.color = 'red'; | |
| dl.style.fontWeight = 700; | |
| })(document); |
NewerOlder