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
//IE Fix | |
if (typeof(NodeList.prototype.forEach)!==typeof(alert)) | |
{ | |
NodeList.prototype.forEach=Array.prototype.forEach; | |
} | |
function showContent(id){ | |
// get all .content elements |
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
################## | |
# classification # | |
################## | |
# decision trees | |
set.seed(15973) | |
dtree <- train(train.d, train.c.vector, method = 'rpart') | |
conf.mx.dt <- table(test.c, predict(dtree, test.d)) |
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
library(tm) | |
#################################### | |
# load the corpora and pre process # | |
#################################### | |
economia.train = VCorpus(DirSource('../news/train/economia'), readerControl = list(reader = readPlain, language='pt')) | |
desporto.train = VCorpus(DirSource('../news/train/desporto'), readerControl = list(reader = readPlain, language='pt')) | |
economia.test = VCorpus(DirSource('../news/eval/economia'), readerControl = list(reader = readPlain, language='pt')) |
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/sh | |
CATEGORIES=(desporto economia) | |
mkdir -p dev train 'eval' | |
for c in "${CATEGORIES[@]}"; do | |
for i in $(find ./_/$c -type f | sort -R | head); do | |
j=$(basename $i) | |
mv $i dev/${c}_${j} |
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
const mongo = require('promised-mongo'); | |
const db = mongo('metacache', ['contents']); | |
const fs = require('fs-extra'); | |
const htmlToText = require('html-to-text'); | |
const Promise = require('bluebird'); | |
async function dumpDocs(filter, folder, fields){ | |
console.log('['+(new Date().toISOString())+'] Dumping',filter,'into '+folder); | |
const _filter = { | |
...filter, |
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
0x70833BdAaBF2a0efa738C847a1E7bbda3e537B68 |
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 | |
DIR=$(dirname $0) | |
pubID="$1" | |
if [ -z "$pubID" ]; then | |
pubID='4090' | |
fi | |
FILE="$2" | |
if [ -z "$FILE" ]; then | |
FILE='4.png' |
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
[{"title":"Economico","sortTitle":"Data","query":"filter=Source.Name eq | |
\"Economico\"&sort=_InternalRefs.RegisterDate&limit=20","destination":"main | |
","id":1430395633631,"idx":0,"domElement":{"0":{"jQuery11100528639918193221 | |
1":226,"sizzle-1434637889294":{"parentNode":[2289,18,false]}},"length":1,"p | |
revObject":{"0":{},"context":{},"length":1},"context":{}}},{"title":"Expres | |
so","sortTitle":"Data","query":"filter=Source.Name eq | |
\"Expresso\"&sort=_InternalRefs.RegisterDate&limit=20","destination":"main" | |
,"id":1430401119919,"idx":1,"domElement":{"0":{"jQuery111005593397612683475 | |
":225,"sizzle-1433410869016":{"parentNode":[3230,18,false]}},"length":1,"pr | |
evObject":{"0":{},"context":{},"length":1},"context":{}}},{"title":"Renasce |
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
### Keybase proof | |
I hereby claim: | |
* I am andrefs on github. | |
* I am andrefs (https://keybase.io/andrefs) on keybase. | |
* I have a public key whose fingerprint is 9855 D11E 4674 3E1E 1F1A F85F 1E53 063F 6F27 1B13 | |
To claim this, I am signing this object: |