Dakestei
DakesteiisaMarkovChaiTwitterBotgeerator,basedomakigamashupofdifferetcorpora.
Itisdescribedithisblogpost.
DepedeciesThesoftwareitselfisimplemetedusigBash,Make,adPytho.
You'lleedaTwitterAccoutadaTwitterapplicatio.Fromthelatter,you'lleedacosumerkey,acosumersecret,aaccesstokeadaaccesstokesecret.
EtertheseitotwitterCredetials.sh
Togeeratethesupporteddatasetsyou'lleed:
PopplerbrewistallpoppleromacOSsudoapt-getistall-ypoppler-utilsoUbutuAfterthat,youcarutheimportEv.shscriptithedev-folder.ThiswillcreateaPythovirtualeviromet(codaifyouhaveit,virtualevotherwise)calleddakestei,adistallallpytho-depedecies.
Ifyou'dratheristallthemseparately,theyare:Tweepy,darklyrics,wikiquote,markovify;(optioallyltk)
UsageUsageisbasedaroudMake.Thefollowigoptiosareavailable:
makecorpora:Buildsallcorporamakelist:Listsallavailablecorporamakecombiatios:Pritsallpossiblecombiatiosoftwocadidates-mayicludeduplicates(withswitchedpositios)makemodelARGS="corpus1corpus2[(scale1scale2)stateSizeoverlapTotaloverlapRatiotriessetecesmodelComplexity]":Geeratesamodelbasedotwocorpora(theolyrequiredargs).Ifyoudefiescale1,youmustdefiescale2.Alloptiosisidethesquarebracketsareoptioal.ARGS:corpus1strig-theameofthefirstcorpusodefaultcorpus2strig-theameofthesecodcorpusodefaultscale1float/it-scaleofcorpus1relativetocorpus2defaultsto1scale2float/it-scaleofcorpus2relativetocorpus1defaultsto1stateSizeit-statesizeoftheMarkovchaidefaultsto2overlapTotalit-maximumsequetialwordsthatoverlapwithasetecefromthecorporadefaultsto15overlapRatioit-maximumpercetageofoverlapwithasetecefromthecorporadefaultsto70triesit-attemptstomakeaorigialsetecedefaultsto10setecesit-umberofsetecesdefaultsto5modelComplexitystrig-aive|expertdefaultsto"aive"EXAMPLE:makemodelARGS="tcmjobs21215301025expert"&&makesetecesmakesetece:Outputsoesetecebasedoaavailable(previouslytraied)model.makeseteces:Outputstheamoutofsetecesgiveasaargumetdurigmodelgeeratio.makeclea:Deletesallcorpora.maketweet:Postsatweet.Itispossibletoseallcombiatiosforagivecadidate,e.g.makecombiatios|grep"picard+".
Deploymet:Twittersecretsaresetviaevirometvariables,e.g.
exportCONSUMER_KEY="cosumer_key"exportCONSUMER_SECRET="cosumer_secret"exportACCESS_KEY="access_toke"exportACCESS_SECRET="access_toke_secret"Aexampledeploymetisdescribedithebottomofthisblogpost.







评论