Anatomía de un Bot para Resultados Electorales

Post on 16-Apr-2017

236 views 0 download

Transcript of Anatomía de un Bot para Resultados Electorales

BOTDE RESULTADOS ELECTORALES

EN NODE.JSJ AV I E R A B A D Í A , D I C 2 0 1 6

¿POR QUE?

DEMOD I R E C TA M E N T E A L A P I S C I N A

backendservice

ANATOMÍA DE UN BOT

plataforma

entender

procesar

responder

ENTENDERN L - U N D E R S TA N D I N G

INTENTparameterparameter

‘ganador’‘Durango’ 48027

‘2016’

ALTERNATIVAS• NLTK (python)• Freeling (C++)• https://stanfy.com/blog/advanced-natural-language-

processing-tools-for-bot-makers/– wit.ai (Facebook)– LUIS (Microsoft)– api.ai ($)– Alexa (AWS)– Watson (IBM)

ML-’PREDECIR’ LA INTENCIÓN

extraer features

predecir

INTENT

contexto

PRE-PROCESO

FEATURES - REGEX

ML – PREDECIR – DECISION TREES

modificado para añadir classifier.fromJSON()

TRAINING THE MODEL

MANUAL REWIRING = PARCHEAR

DISPATCH

PROCESARP I E C E O F C A K E

TAN FÁCIL COMO LLAMAR A LA API REST

RESPONDERN L - G E N E R AT I O N

VARIEDAD

RESPONDER A LO DESCONOCIDO = NO PROVOCAR

PLATAFORMA

OPCIONES

twitter FB messenger telegram UI Web/Móvilwhatsapp

✓✗

fácil de desarrollar

penetración

chat-friendly

✓ ✓✓ ✗ ✗ ✗✓✓ ✓✓✓✓ ✓✓ ✓✗ ✓✓ ✓✓

TWITTER• API de twitter

–stream o poll• escuchar mensajes (filtrados)• publicar mensajes o enviar dm• quotas

–automation rules and best practices https://support.twitter.com/articles/76915

–the twitter rules https://support.twitter.com/articles/18311

–pri queue

RECIBIEND

O TWEET

S

ASYNC - COORDINAR TAREAS ASÍNCRONAS

POST-MORTEMI N G E N I E R Í A S O C I A L

PRUEBAS PREVIAS - ENTRENAMIENTO•usando la interfaz web•3 generaciones

–yo solo–yo y algunos amigos–yo, algunos amigos y toda la lista de nodejs-madrid

• información muy valiosa•patrón de uso distinto que a través de twitter

TWITTER != INTERACTIVO•en twitter la gente no chatea• responder a @menciones no funciona•quotas

–2500 mensajes por hora

USUARIOS IMPACIENTES• hay que promocionar el bot con antelación• hay que generar contenido “interesante” antes de que empiece el “sarao”• la gente prueba y no vuelve

RECURSOS

RECURSOS• NLP

– NLTK– Freeling– https://stanfy.com/blog/advanced

-natural-language-processing-tools-for-bot-makers/

• Bots– https://botmakers.org/ + canal

de Slack– https://botwiki.org/tutorials/twitt

erbots/

– https://ursooperduper.github.io/2014/10/27/twitter-bot-with-node-js-part-1.html

• twitter– automation rules and best practices

– https://support.twitter.com/articles/76915)

– the twitter rules– https://

support.twitter.com/articles/18311)

• módulos npm– Decision Tree– Twit

¡GRACIAS!E S T O E S T O D O A M I G O S