lejohnyjohn / learning-stance-embeddings-from-signed-social-graphs Goto Github PK
View Code? Open in Web Editor NEWThis repo contains the code and datasets from our paper Learning Stance Embeddings from Signed Social Graphs.
This repo contains the code and datasets from our paper Learning Stance Embeddings from Signed Social Graphs.
Hi, thanks for sharing the code of your work. I'd love to run this project and see it in action.
I have loaded the BirdwatchSG dataset from HuggingFace:
from datasets import load_dataset
edge_data = load_dataset("Twitter/SignedGraphs")
edge_data = pd.DataFrame(edge_data['train'])
However, I am facing the following error in the last training cell : ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (55,) + inhomogeneous part.
in this part of the code:
Cell In[26], line 124, in TrainingSamples.convert(self, walks, topic_idx, workers)
122 print("check [len(w) for w in walks]")
123 print([len(w) for w in walks])
--> 124 walks_lists = np.array_split(walks, workers)
which indicates that the elements in the walks
array don't have the same shape.
I have printed the walks
array and indeed this is the case:
[2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 2, 3, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 2, 2, 2, 2, 4, 3, 2, 2, 2, 3, 2, 4, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 2, 3, 2]
This is happening because for some of the walks, there are more neighbors present, so there are longer walk_options :
walk_options = d_graph[walk[-1]].get(neighbors_key, None)
For example for source node: 2665, the walk options are: [482, 2804], and for 482 the walk options are [1595]. So the walk length becomes [2665, 482, 1595], (whereas the walk length is normally 2 for other nodes). But for some source nodes, the walk length is only [2345, 593].
I'd like to know if we need to limit the walk length to be homogenous (i.e., either through padding the length)? or allow for inhomogenous walks?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.