Package: womg-core
WoMG: Word of Mouth GeneratorWoMGis a Python library forWord-of-MouthCascadesGeneration.We propose a model for the synthetic generation of information cascades in social media. In our model the information “memes” propagating in the social network are characterized by a probability distribution in a topic space, accompanied by a textual description, i.e., a bag of keywords coherent with the topic distribution. Similarly, every person is described by a vector of interests defined over the same topic space. Information cascades are governed by the topic of the meme, its level of virality, the interests of each person, community pressure, and social influence.This repository provides a reference implementation ofWoMGas described in:Generating realistic interest-driven information cascades.Federico Cinus, Francesco Bonchi, André Panisson, Corrado Monti.WoMGgenerates synthetic datasets of documents cascades on network.
It starts with any (un)directed, (un)weighted graph and a collection of documents and it outputs the propagation DAGs of the docs through the network.InstallationInstall usingpip:$pipinstallwomg-coreYou can also download or clone the GitHub repository:$gitclonehttps://github.com/FedericoCinus/WoMG.gitQuickstartThe WoMG package provides a Python module and a command-line method. To runWoMG-coreon ademomode, execute the following command from Terminal:$womgcIt loads 50 documents and their topic distributions located in/womgdataand it spreads them over the default network (Les Miserableshttp://konect.uni-koblenz.de/networks/moreno_lesmis).OptionsYou can check out the other options available to use withWoMGusing:$womg--helpInput[Network] The supported input format is an edgelist (txt extension):node1_id_int node2_id_int <weight_float, optional>You can specify the edgelist path using thegraphargument:$womg--graph/this/is/an/example/path/Graph_Folder/edgelist.txtIf no path is given the default network isLes Miserablesnetwork.Output (default)[Propagations] The output format is:time; item; node[Items descriptions] :item; [topic-dim vector][Topic descriptions] :(topic_index, linear combination of words)You can specify the output folder path:$womg--output/this/is/an/example/path/Output_FolderWoMG extended (TBD)WoMGis an open source reasearch project. More details of the software are reported below:Input[Network] The supported input format is an edgelist (txt extension):node1_id_int node2_id_int <weight_float, optional>The graph is assumed to be undirected and unweighted by default. These options can be changed by setting the appropriate flags. You can specify the edgelist path using thegraphargument):python womg --graph /this/is/an/example/path/Graph_Folder/edgelist.txtIf no path is given the default network isLes Miserablesnetwork.[Documents] The supported input format for documents collection (corpus) is txt. You have to specify the folder path containing them using thedocs_folderargument:$womg--docs_folder/this/is/an/example/path/Corpus_FolderIf no documents folder path is given,WoMGwill be set to generative mode.OutputThere are outputs for each class (or model)[Diffusion] file could be in two formats:list (default):time doc activating_nodedict :{ time: { doc: [activating nodes] } }[Network] files:
[info] dict:{'type': 'Graph', 'numb_nodes': '77', 'numb_edges': '254', 'aver_degree': '6.5974', 'directed': 'False'}[graph] dict:{(u, v): [1.3, 0.2, 0.8, ... , 0.91], ...}Key: link-tuple. Value: weight vector[interests and influence vectors] dict:{(node, 'int'): [interest vector], (node, 'inlf'): [influence vector]}[Topic] files:[topic distributions] dict:{doc: [topic distribution]}[viralities] dict:{doc: virality}One can modify the outputs formats extension with theformatargument:python womg --format picklepython womg --format txtand specify the output folder path:python womg --output /this/is/an/example/path/Output_FolderOptionstopicsnumber of topics to be considered in the topic distributions of documents and nodes interests; it has to be less than number of dimensions of the nodes' space provided by node2vecGraphhomophilyH degree of homophily. Node2vec is used as baseline for generating interests vectors of the nodes starting from the given graph. Parameterspandqcan achieve different decoded degree of homophily and structural equivalence (see paper). The best mix of them can be achieved only by a deep analysis of the network and a grid searh on the parameters. In order to pursuit generality in the input graph we use three degree of mixing: structural equivalence predominant, deepWalk (p=1, q=1), homophily predominant (which are not the best for representing the graph!).  1-H is the degree of social influence between nodes; which is the percentage of the avg interests vecs norms to be assigned to the influence vectors.Documentsdocsnumber of documents TO BE GENERATED by lda, giving this parameter lda will be directly set to generative modeviralityvirality of the doc; if virality is high, exponent of the power law is high and threshold for activation is low.Diffusionstepssteps of the diffusion simulationactivespercentage of active nodes with respect to the total number of nodes in the intial configuration (before diffusion) for each doc.Node2VecdimensionsNumber of dimensions for node2vec. Default 128walk-lengthlength of walk per source. Default 80num-walksnumber of walks per source. Default 10window-sizecontext size for optimization. Default 10iternumber of epochs in SGDworkersnumber of parallel workers. Default 8pmanually set BFS parameter; else: it is set by Hqmanually set DFS parameter; else: it is set by HInput and OutputgraphInput path of the graph edgelistweightedboolean specifying (un)weighted. Default unweightedunweighteddirectedgraph is (un)directed. Default undirectedundirecteddocs-folderInput path of the documents folderoutputOutputs pathformatOutputs formatseedSeed (int) for random distribution extractionCiting@inproceedings{,
author = {},
 title = {},
 booktitle = {Proceedings},
 year = {2019}
}MiscellaneousPlease feel free ..Note:This is only a reference implementation analysis and more details are provided by the thesis.